background: none in css minifies to background:0

Apr 10, 2014 at 6:47 PM

In 2.3.0 and 2.4.0 (older versions not tried) the following behavior is causing browser issues.
div { background: none;}
is minified to

background:0 is not correctly handled by browsers.
I will try to find this in the sources where this originates and post the result here

Apr 11, 2014 at 12:15 AM
that would be very helpful :)
Apr 11, 2014 at 7:45 AM
Edited Apr 11, 2014 at 7:46 AM
Hi purekrome,

I am wrong about the background:0
Seems that background:0 was not the problem, but this snippet
@media only screen and (min-width: 800px) {
}  /*/mediaquery*/

only screen and (-webkit-min-device-pixel-ratio: 1.5),
only screen and (-o-min-device-pixel-ratio: 3/2),
only screen and (min-device-pixel-ratio: 1.5) {
That minifies to
@media only screen and (-webkit-min-device-pixel-ratio:1.5),only screen and (-o-min-device-pixel-ratio:3/
The minifier stops with a / that will break the rest of the css

I will try to spot that one :-)

Apr 11, 2014 at 8:12 AM

Does it work if you use 1.5 instead of 3/2?

Apr 13, 2014 at 3:10 PM
Hi Freeranger,

Yes, the "3/2" kills the minified CSS by stopping at the / and from there ignoring the rest.
Changing this to 1.5 solves the problem :-)

The older version of yui compressor (1.4.0) that I used had different behavior... it inserted a blank line instead of a crippled line. Positive about that is that that one did not break the minified CSS

Nailed this one :-)