do not emit empty media queries
This commit is contained in:
parent
11cc99e877
commit
1cb135c833
@ -155,6 +155,9 @@ impl Css {
|
|||||||
}
|
}
|
||||||
Toplevel::AtRule(r) => match r {
|
Toplevel::AtRule(r) => match r {
|
||||||
AtRule::Unknown(u) => {
|
AtRule::Unknown(u) => {
|
||||||
|
if u.body.is_empty() {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
if u.params.is_empty() {
|
if u.params.is_empty() {
|
||||||
writeln!(buf, "{}@{} {{", padding, u.name)?;
|
writeln!(buf, "{}@{} {{", padding, u.name)?;
|
||||||
} else {
|
} else {
|
||||||
|
@ -21,3 +21,4 @@ test!(
|
|||||||
"@foo {\n a {\n color: red;\n }\n}\n"
|
"@foo {\n a {\n color: red;\n }\n}\n"
|
||||||
);
|
);
|
||||||
test!(unknown_at_rule_no_selector, "@foo {\n color: red;\n}\n");
|
test!(unknown_at_rule_no_selector, "@foo {\n color: red;\n}\n");
|
||||||
|
test!(empty, "@media (min-width: 2px) {}", "");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user