Skip to content
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

Incorrect reduction of nested expression #38

Closed
gyoshev opened this issue Oct 12, 2017 · 0 comments · Fixed by #39
Closed

Incorrect reduction of nested expression #38

gyoshev opened this issue Oct 12, 2017 · 0 comments · Fixed by #39

Comments

@gyoshev
Copy link
Contributor

gyoshev commented Oct 12, 2017

Reducing the expression calc( (1em - calc( 10px + 1em)) / 2) reduces incorrectly to calc(1em - 5px) (the correct one should be -5px).

A workaround is to add another operation, however this is far from ideal: calc( (1em + (-1 * calc( 10px + 1em))) / 2).

I know the expressions look weird, but these actually are real-world examples from SASS-generated CSS (the inner calc expression is stored in a variable).

gyoshev added a commit to gyoshev/reduce-css-calc that referenced this issue Oct 12, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant