gruntjs / grunt-contrib-cssmin

Compress CSS files.
http://gruntjs.com/
MIT License
793 stars 147 forks source link

0% is changed to 0, which then defaults to 0px #250

Closed krishollenbeck closed 8 years ago

krishollenbeck commented 8 years ago

When setting 0% in CSS the % is stripped during the CSS min process. This causes issues when the 0% is intentional. For example we have an odd scenario where a container grows on hover in IE9 and we use this workaround,

.ie9Container {
    height: auto;
    min-height:0%;
}

This does not work after CSS min though because the % is stripped. I know this is sort of a weird use case, but I think the % should be preserved even if the value is 0. There could possibly be other scenarios where a developer is intentionally setting a CSS property to 0%.

Here is the use case I am referring to. http://blog.brianrichards.net/post/6721471926/ie9-hover-bug-workaround

I have also attached an example grunt-css-min-test.zip

sindresorhus commented 8 years ago

From the readme:

Issues with the output should be reported on the clean-css issue tracker.