alkacon / alkacon-oamp

OAMP - the Alkacon OpenCms additional module packages.
http://www.alkacon.com
GNU General Public License v3.0
27 stars 38 forks source link

Bug in YUICompressor breaks media query declarations #51

Open paulflakstad opened 9 years ago

paulflakstad commented 9 years ago

A bug in YUICompressor v2.4.2 causes certain media query declarations to break due to incorrect removal of spaces.

For example, compressing this:

@media (min-width: 1px) and (max-width: 799px) {
}

Results in this:

@media(min-width:1px) and(max-width:799px){}

The removal of the required space after and in effect removes from the stylesheet all rules declared within that media query section. (The rules are not literally removed, but browsers will ignore them.)

The bug was fixed shortly after the release of v2.4.2 in September 2010.

Suggest updating to the latest release version of YUICompressor (currently v2.4.8), available at https://github.com/yui/yuicompressor/releases

Note: The 2.4.2 version may or may not also include a bug where the required leading space before the !important modifier is incorrectly removed.

paulflakstad commented 9 years ago

Correction: I'd skip the 2.4.8 release; it breaks calc() expressions.

Building a yuicompressor-2-4-8x.jar directly from the master branch is probably the best option: https://github.com/yui/yuicompressor

It's been more than 2 years since the release of 2.4.8, and the calc() bugfix is probably just one of many fixes and improvements in the master.