Minifying a CSS declaration where sibling-index() is multiplied by a value with a unit can result in an invalid declaration.
For example: animation-delay: calc(sibling-index() * 0.05s); minifies to animation-delay:calc(sibling-index()/20s), which is invalid because the numerator is unitless and the denominator has a unit.
Minimal test case:
- create a css file with this content or clone this repo
div {
animation-delay: calc(sibling-index() * 0.05s);
}
- run
esbuild --bundle {css filename} --minify --outfile=out.css or npm run build in the test repo
- out.css includes the invalid css value
Minifying a CSS declaration where sibling-index() is multiplied by a value with a unit can result in an invalid declaration.
For example:
animation-delay: calc(sibling-index() * 0.05s);minifies toanimation-delay:calc(sibling-index()/20s), which is invalid because the numerator is unitless and the denominator has a unit.Minimal test case:
esbuild --bundle {css filename} --minify --outfile=out.cssornpm run buildin the test repo