Problem with removed parenthesis from calc before var
See original GitHub issueOriginal issue https://github.com/cssnano/cssnano/issues/645
This valid css
--aspect-ratio: 16/9;
padding-top: calc(100% / (var(--aspect-ratio)));
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/
Issue Analytics
- State:
- Created 3 years ago
- Comments:5 (1 by maintainers)
Top Results From Across the Web
Polynomial-Why is the answer for removing parentheses and ...
I assume that when you say "remove parentheses", you are multiplying (x+2) by (x-2), thus simplifying the expression.
Read more >How to remove this parenthesis () from this text value (123)
You've successfully removed the ( and ) , but there are several problems: It will return undefined if either number is 0 ,...
Read more >Removes parentheses in expressions with mixed operators
Can we reopen the issue? I believe it's still a good thing to keep the parenthesis when 2 operators have the same precedence....
Read more >Remove Invalid Parentheses - GeeksforGeeks
We need to remove minimum number of parentheses to make the input string valid. If more than one valid output are possible removing...
Read more >Using Parenthesis in Math - Order of Operations - [5-7-3]
All calculations inside of parenthesis must be done first in a calculation. If we have multiple sets of parenthesis one inside of another, ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I believe it’s not a browser bug. Parenthesis are needed because of math: 100 / (16/9) = 56.25 100 / 16/9 = 0.69
It’s harder to fix than it seems, because the current parser does not distinguish:
from