-
-
Notifications
You must be signed in to change notification settings - Fork 15
Discard calc operations that operate on zero values #2
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
Comments
You can try here http://cssnext.github.io/cssnext-playground/ since cssnext use postcss-calc which use this package ;) For the first example, we need to handle math operator priorities (which is not the case for now). Meanwhile, maybe you can do something like: div {
width: calc(100vw / 2 - (6px + 0px));
} which is transformed to div {
width: calc(100vw / 2 - 6px);
} |
Didn't realise that was already transformed, thanks 👍 Perhaps it's possible to use this module for it? https://www.npmjs.com/package/math-analysis - though I've got a lot on my plate at the minute so I probably won't be able to work on a PR right away. |
Would it be possible to discard parts of the
calc()
function that operate on zero values? For example:Can be:
And:
Can be:
It's from this edge case in CSSO:
css/csso#222
The text was updated successfully, but these errors were encountered: