Closed jdelStrother closed 1 year ago
My CSS minifier reduces this -
@media (prefers-color-scheme: dark) { a { color: red; } }
to this -
@media(prefers-color-scheme:dark){a{color:red}}
which CSSParser fails on, losing the @media rule entirely:
@media
parser = CssParser::Parser.new parser.load_string! "@media(prefers-color-scheme:dark){a{color:red}}" puts parser.to_s # => "a {\ncolor: red;\n}\n"
Including a space after @media fixes it, so the bug is avoidable by altering my source to @media screen and (prefers-color-scheme: dark). @media(prefers-color-scheme:dark) { ... } ought to be valid on its own though, right?
@media screen and (prefers-color-scheme: dark)
@media(prefers-color-scheme:dark) { ... }
yeah it should be valid, thx for the bug report I have no idea how to fix that though, so if you find a way please send a PR!
My CSS minifier reduces this -
to this -
which CSSParser fails on, losing the
@media
rule entirely:Including a space after
@media
fixes it, so the bug is avoidable by altering my source to@media screen and (prefers-color-scheme: dark)
.@media(prefers-color-scheme:dark) { ... }
ought to be valid on its own though, right?