diff --git a/internal/css_parser/css_parser.go b/internal/css_parser/css_parser.go index f1ee8951385..db15593353c 100644 --- a/internal/css_parser/css_parser.go +++ b/internal/css_parser/css_parser.go @@ -279,11 +279,6 @@ skipRule: rule := rules[i] switch r := rule.Data.(type) { - case *css_ast.RAtKeyframes: - if len(r.Blocks) == 0 { - continue - } - case *css_ast.RKnownAt: if len(r.Rules) == 0 { continue diff --git a/internal/css_parser/css_parser_test.go b/internal/css_parser/css_parser_test.go index 8b8d80970ba..db4c1bdd679 100644 --- a/internal/css_parser/css_parser_test.go +++ b/internal/css_parser/css_parser_test.go @@ -899,7 +899,7 @@ func TestEmptyRule(t *testing.T) { expectPrintedMangle(t, "div {}", "") expectPrintedMangle(t, "@media screen {}", "") expectPrintedMangle(t, "@page { @top-left {} }", "") - expectPrintedMangle(t, "@keyframes test { from {} to {} }", "") + expectPrintedMangle(t, "@keyframes test { from {} to {} }", "@keyframes test {\n}\n") expectPrinted(t, "$invalid {}", "$invalid {\n}\n") expectPrinted(t, "@page { color: red; @top-left {} }", "@page {\n color: red;\n @top-left {\n }\n}\n")