fix: allow duplicate selectors in scope, coz its safe to have them, coz hashing isnt affected by selector position
This commit is contained in:
parent
f5ba30d8f7
commit
1b63e4cd3c
2 changed files with 68 additions and 11 deletions
|
|
@ -28,12 +28,7 @@ impl CompilerAdapter {
|
|||
) -> Result<String, SabryCompilerError> {
|
||||
let options = grass::Options::from(&self.config).input_syntax(syntax.into());
|
||||
|
||||
let mut css = grass::from_string(code, &options)?;
|
||||
|
||||
css = match self.lightningcss(&css) {
|
||||
Ok(c) => c,
|
||||
Err(e) => return Err(e),
|
||||
};
|
||||
let css = self.lightningcss(&grass::from_string(code, &options)?)?;
|
||||
|
||||
Ok(css)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -140,6 +140,7 @@ impl<'s> HashedScope<'s> {
|
|||
/// Struct which represents hashed selector inside of [HashedScope].
|
||||
///
|
||||
/// Does not hold information about hash itself, as meant to be inside of scope.
|
||||
#[derive(PartialEq, Eq, Hash)]
|
||||
pub struct HashedSelector {
|
||||
/// Basic unrelated to hash info about this selector
|
||||
pub sel: ScopedSelector,
|
||||
|
|
@ -258,6 +259,7 @@ impl HashedSelector {
|
|||
}
|
||||
|
||||
/// Just any unary CSS-ish selector
|
||||
#[derive(PartialEq, Eq, Hash)]
|
||||
pub struct ArbitrarySelector {
|
||||
/// CSS-ish identifier
|
||||
pub ident: String,
|
||||
|
|
@ -266,6 +268,7 @@ pub struct ArbitrarySelector {
|
|||
}
|
||||
|
||||
/// Any unary CSS-ish selector, that's able to be scoped, and then hashed
|
||||
#[derive(PartialEq, Eq, Hash)]
|
||||
pub enum ScopedSelector {
|
||||
Class(ArbitrarySelector),
|
||||
Id(ArbitrarySelector),
|
||||
|
|
|
|||
Loading…
Reference in a new issue