Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug in YUICompressor breaks media query declarations #51

Open
paulflakstad opened this issue Jul 10, 2015 · 1 comment
Open

Bug in YUICompressor breaks media query declarations #51

paulflakstad opened this issue Jul 10, 2015 · 1 comment

Comments

@paulflakstad
Copy link

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
Copy link
Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant