Don't print out styles if they are null

This commit is contained in:
ConnorSkees 2020-02-15 09:58:41 -05:00
parent 8f379c425d
commit 48e618c43d
2 changed files with 8 additions and 0 deletions

View File

@ -36,6 +36,9 @@ impl Toplevel {
} }
fn push_style(&mut self, s: Style) { fn push_style(&mut self, s: Style) {
if s.value.is_null() {
return;
}
if let Toplevel::RuleSet(_, entries) = self { if let Toplevel::RuleSet(_, entries) = self {
entries.push(BlockEntry::Style(Box::new(s))); entries.push(BlockEntry::Style(Box::new(s)));
} }

View File

@ -130,3 +130,8 @@ test!(
"a {\n color:red\n}\n", "a {\n color:red\n}\n",
"a {\n color: red;\n}\n" "a {\n color: red;\n}\n"
); );
test!(
removes_null_value,
"a {\n color: null;\n}\n",
""
);