diff --git a/src/lib.rs b/src/lib.rs index a662857..9cdead1 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -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 diff --git a/tests/main.rs b/tests/main.rs index a03573c..ca0c5da 100644 --- a/tests/main.rs +++ b/tests/main.rs @@ -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)]