Closed shrpne closed 2 years ago
Is it the browser bug? Why parenthesis needed around of var()?
I believe it's not a browser bug. Parenthesis are needed because of math: 100 / (16/9) = 56.25 100 / 16/9 = 0.69
Probably related #115
Any news on this huge bug, it's very blocking...
It's harder to fix than it seems, because the current parser does not distinguish:
100% / (var(--aspect-ratio))
from
100% / var(--aspect-ratio)
Original issue https://github.com/cssnano/cssnano/issues/645
This valid css
becomes invalid after cssnano compilation, because cssnano removes parenthesis around of var()
Chrome and Firefox don't respect the var() without parenthesis around it and so the code is not working as expected.
Test case: https://jsfiddle.net/z7bsn1r8/4/