Skip to content
This repository has been archived by the owner on Apr 21, 2023. It is now read-only.

rewrite_css filter incompatible with CSS3 media queries #50

Closed
GoogleCodeExporter opened this issue Apr 6, 2015 · 6 comments
Closed

Comments

@GoogleCodeExporter
Copy link

CSS3 media queries get destroyed with the rewrite_css filter using 0.9.0.0-128.

For instance, this CSS:

@media screen and (max-width: 290px), screen and (max-device-width: 290px) {
    .selector {
        display: none;
    }
    .otherselector {
        display: block;
    }
}


turns into this after passing through the rewrite_css filter:

@media screen,and,screen,and{.selector{display:none}}@media 
screen,and,screen,and{.otherselector{display:block}}


Instead, it should be written like this I believe:

@media screen and (max-width:290px),screen and 
(max-device-width:290px){.selector{display:none};.otherselector{display:block}}


These media queries are very important for developing pages that render nicely 
on a wide range of devices (e.g. phones), so I hope that this gets fixed soon! 
In the meantime, I have disabled the rewrite_css filter.

Original issue reported on code.google.com by joe.lencioni on 8 Nov 2010 at 8:35

@GoogleCodeExporter
Copy link
Author

Thanks for the bug report & you hit on the right workaround.  We'll get this 
assigned and fixed as soon as possible.

Original comment by jmara...@google.com on 8 Nov 2010 at 8:38

@GoogleCodeExporter
Copy link
Author

Thanks for the fast response!

Original comment by joe.lencioni on 8 Nov 2010 at 8:39

@GoogleCodeExporter
Copy link
Author

Thanks for the bug report, our parser does not support all of CSS3 right now. 
However, our goal is to not break good content, so we're working on noticing 
this situation and not breaking it.

Original comment by sligocki@google.com on 8 Nov 2010 at 11:38

@GoogleCodeExporter
Copy link
Author

That makes a lot of sense. Thanks!

Original comment by joe.lencioni on 9 Nov 2010 at 1:55

@GoogleCodeExporter
Copy link
Author

These should be fixed by 
http://code.google.com/p/modpagespeed/source/detail?r=175 which also adds 
checks for this situation.

If you build from source, please let me know if this fixes you. If you install 
from binary, we'll send an announcement to the list when the next binary is 
released.

Thanks for the fix, Yi-An!

Original comment by sligocki@google.com on 9 Nov 2010 at 11:17

  • Changed state: Fixed

@GoogleCodeExporter
Copy link
Author

If you build from source, be sure to build from the trunk, not the branch that 
was cut on Nov 8.

E.g.

gclient config http://modpagespeed.googlecode.com/svn/trunk/src

Original comment by jmara...@google.com on 9 Nov 2010 at 11:31

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

No branches or pull requests

1 participant