-
Notifications
You must be signed in to change notification settings - Fork 33
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
calc() breaks when using 3+ variable fallbacks #104
Comments
The same issue: #77 |
Seems to be still an issue. But the workaround works for me! |
Any updates? |
Since #137 it should just warn instead of crashing. Does is still crash for you? The underlying problem is that the parser is incomplete, but to fix it we would need to duplicate the code that's already in the existing parsers (postcss-value-parser and postcss-selector-parser) so I would prefer to find a way to refactor so we don't parse multiple times (currently postcss-calc does parse -> stringify -> parse -> stringify) |
This was also reported in #119 (I'm closing that one as duplicate) |
From downstream issue cssnano/cssnano#880 which is from downstream issue angular/angular-cli#16910.
Using a
calc()
command with 3+ variable fallbacks seems to break the parser.For example, paste the following code into the CSS Nano playground (which I'm told uses
postcss-calc
viacssnano-preset-default
:Then look at the JavaScript console and see:
Work around is to use intermediary variables:
The text was updated successfully, but these errors were encountered: