GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
Already on GitHub? Sign in to your account
The styles in an @media block don't get applied if the string '@media' appears in a comment within the @media block (not sure about if it appears between blocks). I know it's an edge case, but I usually include @media in a comment this to mark the closing } of the MQ! The experimental parser didn't experience this issue.
Ran into the same issue. This can probably be avoided if comments are stripped before translate() is called
@necolas, @joelwan added a pull for stripping comments out. What's your take on whether Respond should do that? I think it's a pretty good idea, but trying to consider where it might trip someone up...
Sounds like a good idea if it can be done reliably.
I encountered this issue recently as well. As a workaround I added a space between @ and media so that the commented MQ wouldn't be parsed.
I ran into this error a few minutes ago, but just in Internet Explorer 8 and 7. Had a comment with @media [...] in it and my first media-query after this comment was ignored. In Firefox, Chrome, IE9, Safari and Opera there were no problems.
@paulchrablass I don't think my pull request that contains the patch that strips comments out has been merged accepted/merged yet. But you can try that as a temporary solution
We have decided to keep the parser dumb for speed purposes for the time being. Will potentially revisit this issue in the future. Thank you.
Reopening this for discussion.
We could take a very similar approach to what I did for the @Viewport fix: strip the comments out with a regex.
Stripping via regex is in line with what i submitted as a pull request a while back. (looking at the timestamp - it was 2 years ago.)
@joelwan if you want to cook up another PR for it, I'll include it for the 1.5 release.
Marking as 1.5 milestone.