Skip to content

Commit

Permalink
Fix important declarations within nested at rules
Browse files Browse the repository at this point in the history
Fixes #356
  • Loading branch information
devongovett committed Dec 9, 2022
1 parent 615893c commit 6a7d19e
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
17 changes: 17 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18673,6 +18673,23 @@ mod tests {
"#},
);

nesting_test(
r#"
.foo {
@media (min-width: 640px) {
color: red !important;
}
}
"#,
indoc! {r#"
@media (min-width: 640px) {
.foo {
color: red !important;
}
}
"#},
);

nesting_test(
r#"
.foo {
Expand Down
2 changes: 1 addition & 1 deletion src/parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1052,7 +1052,7 @@ fn parse_nested_at_rule<'a, 'o, 'i, 't, T: AtRuleParser<'i>>(
let (declarations, mut rules) =
parse_declarations_and_nested_rules(input, default_namespace, namespace_prefixes, options)?;

if declarations.declarations.len() > 0 {
if declarations.len() > 0 {
rules.0.insert(
0,
CssRule::Style(StyleRule {
Expand Down

0 comments on commit 6a7d19e

Please sign in to comment.