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

respond.js + nested media queries (IE8) #817

Closed
kasperoo opened this issue Jan 13, 2015 · 3 comments
Closed

respond.js + nested media queries (IE8) #817

kasperoo opened this issue Jan 13, 2015 · 3 comments

Comments

@kasperoo
Copy link

Hi,

using 'img-retina' mixin, it will create a nested media query for retina devices only.

However, in IE8, respond.js would stop parsing the css file as soon as it meets that nested query, leading to some major issues such as potentially entire page not looking great on desktop (if say, you used retina mixin somewhere in the top of your code).

I had to manually move all my retina css to the bottom of my SCSS file so they will be parsed last and respond.js won't mess things up.

Any advice on how to tackle nested media queries?

@kasperoo kasperoo changed the title respond.js + retina nested media queries (IE8) respond.js + nested media queries (IE8) Jan 13, 2015
@cvrebert
Copy link
Collaborator

Relative Sass newbie here, but based on http://sass-lang.com/documentation/file.SASS_REFERENCE.html#media it sounds like Sass ought to already flatten such nested media queries... How are you compiling your Sass files?

@kasperoo
Copy link
Author

Interesting! I am currently using Visual Studio's Web Essentials. I don't think SASS out of the box can do it, however, after reading your post I've found gulp.js' task for it instead

https://www.npmjs.com/package/gulp-combine-media-queries

That should solve it for me, thanks!

@glebm
Copy link
Member

glebm commented Jan 14, 2015

This is a feature of Sass, appeared at some point in 3.2.x, I've just confirmed and it works with 3.2.19. However, Visual Studio uses libsass, and while the issue is fixed on libsass master the fix has not been released yet.
See sass/libsass#812 for the release timeline, and sass/libsass#185 for the issue itself. Meanwhile, it's best to use Ruby Sass.

@glebm glebm closed this as completed Jan 14, 2015
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

3 participants