Skip to content

Missing unit after 0 #28

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

Closed
dennisfrank opened this issue Jun 9, 2016 · 3 comments
Closed

Missing unit after 0 #28

dennisfrank opened this issue Jun 9, 2016 · 3 comments

Comments

@dennisfrank
Copy link

I use postcss-calc in cssnano and calc(50% - 50vw + (100vw - 100vw) / 2 + 1em) gets optimized to calc(50% - 50vw + 0 / 2 + 1em). Unfortunately, the unit after 0 is missing and the browser does not calculate the calc()statement.

calc(50% - 50vw + 0vw / 2 + 1em) would be the correct optimization.

Or even better: calc(50% - 50vw + 1em)

0 vs 0+ unit.

(If you wonder why I calculate 100vw - 100vw: it’s been generated by a Sass mixin and in most cases it makes more sense.)

@MoOx
Copy link
Contributor

MoOx commented Jun 9, 2016

PR welcome to improve this behavior in https://github.com/MoOx/reduce-css-calc

@dennisfrank
Copy link
Author

@MoOx Done: MoOx/reduce-css-calc#11

Thanks!

@MoOx
Copy link
Contributor

MoOx commented Jun 9, 2016

Fixed by MoOx/reduce-css-calc@1ce8bd0

@MoOx MoOx closed this as completed Jun 9, 2016
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

No branches or pull requests

2 participants