diff --git a/src/output.rs b/src/output.rs index 81e1af5..fe850d9 100644 --- a/src/output.rs +++ b/src/output.rs @@ -155,6 +155,9 @@ impl Css { } Toplevel::AtRule(r) => match r { AtRule::Unknown(u) => { + if u.body.is_empty() { + continue; + } if u.params.is_empty() { writeln!(buf, "{}@{} {{", padding, u.name)?; } else { diff --git a/tests/media.rs b/tests/media.rs index 381de7b..1dde3bd 100644 --- a/tests/media.rs +++ b/tests/media.rs @@ -21,3 +21,4 @@ test!( "@foo {\n a {\n color: red;\n }\n}\n" ); test!(unknown_at_rule_no_selector, "@foo {\n color: red;\n}\n"); +test!(empty, "@media (min-width: 2px) {}", "");