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

Remove spaces to Calc declarations #496

Closed
flaprimo opened this issue Mar 15, 2015 · 4 comments
Closed

Remove spaces to Calc declarations #496

flaprimo opened this issue Mar 15, 2015 · 4 comments
Labels
Milestone

Comments

@flaprimo
Copy link

Hi,
I'm using gulp with the gulp-minify-css plugin (https://www.npmjs.com/package/gulp-minify-css, which uses clean-css).
The tool removes the space after the ")" parenthesis changing the meaning of the following css declarations:

width: calc((978px * 2/3) - 30px); to width: calc((978px * 2/3)- 30px);

and

width: calc((978px / 3) - 30px); to width: calc((978px / 3)- 30px);

@jakubpawlowicz
Copy link
Collaborator

That's a bug indeed. Fix is coming!

@jakubpawlowicz jakubpawlowicz added this to the 3.1.7 milestone Mar 16, 2015
@flaprimo
Copy link
Author

Thank you!
Really appreciate your efforts and this useful software!

jakubpawlowicz added a commit that referenced this issue Mar 16, 2015
In case of `) -` and `) +` in `calc` expressions a space should not
be removed at all times.
@jakubpawlowicz
Copy link
Collaborator

Fixed in 3.1.7.

@zackkrida
Copy link

Still experiencing this issue in 3.1.8, although looking at the source I can't see why: https:/jakubpawlowicz/clean-css/blob/master/lib/selectors/optimizers/simple.js#L181

The snippet in question: left: calc(99.99% * 1/3 - (30px - 30px * 1/3)+ 30px);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants