Closed
Description
@supports (--foo: ) {
html { background: green; }
}
esbuild --minify output:
@supports (--foo:){html{background:green}}
Expectation
Browser page shows green background.
After compression, keep at least one space after --foo:
, otherwise not valid in Chrome.
See also: https://lea.verou.me/2020/10/the-var-space-hack-to-toggle-multiple-values-with-one-custom-property/
Activity
[-]css-minifier: the custom properties in @supports cannot remove spaces[/-][+]css-minifier: CSS custom properties in @supports cannot remove spaces[/+]evanw commentedon Feb 16, 2022
That's strange. Both Firefox and Safari treat these two examples the same while Chrome only respects the first one. I wonder if this is a bug with Chrome or with both Firefox and Safari. I'll work on a fix.
yisibl commentedon Feb 17, 2022
Waiting for answers from CSS experts: https://twitter.com/yisibl/status/1494143919441195011