background: none in css minifies to background:0

Apr 10, 2014 at 5:47 PM
Hi,

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
div{background:0}

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

Cheers,
Nico
Coordinator
Apr 10, 2014 at 11:15 PM
that would be very helpful :)
Apr 11, 2014 at 6:45 AM
Edited Apr 11, 2014 at 6: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*/

@media
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 :-)

Cheers,
Nico
Coordinator
Apr 11, 2014 at 7:12 AM
Hi,

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



Apr 13, 2014 at 2: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 :-)

Thanks