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

zero percentage value minification #635

Closed
H1D opened this issue Aug 5, 2015 · 9 comments
Closed

zero percentage value minification #635

H1D opened this issue Aug 5, 2015 · 9 comments
Labels
Milestone

Comments

@H1D
Copy link

H1D commented Aug 5, 2015

clean-css tend to minify height: 0% to height:0
But they aren't equal!

Examples:
http://codepen.io/H1D/pen/bdzRJo – before minification
http://codepen.io/H1D/pen/YXBrze – after minification

@jakubpawlowicz
Copy link
Collaborator

It's interesting that no one spotted it before! Are you aware of any kind of rules that govern when we can and can't turn 0% to 0? Does it apply to height only?

@H1D
Copy link
Author

H1D commented Aug 6, 2015

Looks like it depends whether or not selected element has content. So there is no chance to decide turn 0% to 0 or not during minification phase

@jakubpawlowicz
Copy link
Collaborator

Thanks for looking into this. I wonder if it applies to any other elements, like width or min-(width|height).

@H1D
Copy link
Author

H1D commented Aug 7, 2015

looks like it is:
http://codepen.io/H1D/pen/bdzRJo

@jakubpawlowicz
Copy link
Collaborator

That's only for min-height, right?

@H1D
Copy link
Author

H1D commented Aug 10, 2015

I believe yes

@jakubpawlowicz jakubpawlowicz added this to the 3.4 milestone Aug 16, 2015
@jakubpawlowicz
Copy link
Collaborator

Fixed on master, you can still use properties.zeroUnits compatibility switch in 3.3, see: https://github.com/jakubpawlowicz/clean-css#how-to-set-compatibility-mode

@H1D
Copy link
Author

H1D commented Aug 16, 2015

👍

@jakubpawlowicz
Copy link
Collaborator

It's just been released with clean-css 3.4. 🎆 Thanks for valuable input!

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

2 participants