Handle toplevel @include
This commit is contained in:
parent
934f9d860d
commit
1761af0a01
@ -361,6 +361,9 @@ impl<'a> StyleSheetParser<'a> {
|
||||
};
|
||||
rules.push(Stmt::MultilineComment(comment));
|
||||
}
|
||||
TokenKind::AtRule(AtRuleKind::Include) => {
|
||||
rules.extend(eat_include(&mut self.lexer, &self.global_scope, &Selector(Vec::new())).unwrap_or_else(|e| self.error(e.0, &e.1)))
|
||||
}
|
||||
TokenKind::AtRule(AtRuleKind::Import) => {
|
||||
let Token { pos, .. } = self
|
||||
.lexer
|
||||
|
@ -664,6 +664,11 @@ mod test_mixins {
|
||||
"@mixin a($a) {\n color: $a;\n}\nd {\n @include a($a/*foo*/: red);\n}\n",
|
||||
"d {\n color: red;\n}\n"
|
||||
);
|
||||
test!(
|
||||
toplevel_include,
|
||||
"@mixin a {\n a {\n color: red;\n }\n}\n\n@include a;\n",
|
||||
"a {\n color: red;\n}\n"
|
||||
);
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
|
Loading…
x
Reference in New Issue
Block a user