peteboere / css-crush

CSS preprocessor.
http://the-echoplex.net/csscrush
MIT License
537 stars 51 forks source link

Converted "0s" to "0" breaks some things in Firefox #26

Closed lencioni closed 12 years ago

lencioni commented 12 years ago

I am working with a transition delay that changes from 1s to 0s on hover. This makes the effect take place immediately when hovered, and it will linger for a second after hover is lost. Like this (http://dabblet.com/gist/2353159):

div {
    transition: all 1s ease-in-out 1s;
}
div:hover {
    background-color:red;    
    transition-delay: 0s;
}

It seems that if the "s" is removed from the "0" (which CSS Crush is doing), then Firefox (at least FF 11.0) ignores the rule (http://dabblet.com/gist/2353144):

div {
    transition: all 1s ease-in-out 1s;
}
div:hover {
    background-color:red;    
    transition-delay: 0;
}

This is potentially only an issue with the -moz-* prefix, so the "s" could still probably be removed for other prefixes. Also, it is possible that this is a bug in Firefox, I'm not sure.

As a temporary workaround, I am using 0.0000001s instead of 0s.

lencioni commented 12 years ago

FWIW, according to Mozilla's website, "While unitless zero is allowed for <length>, it's invalid for all other units." This includes <time> units. So, this may require some adjustment to the regular expression that removes units from zeroes: https://github.com/peteboere/css-crush/blob/master/lib/Core.php#L883

peteboere commented 12 years ago

Fixed in master branch