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

Support IE9/10 media hack? #26

Open
davatron5000 opened this issue Apr 24, 2015 · 3 comments
Open

Support IE9/10 media hack? #26

davatron5000 opened this issue Apr 24, 2015 · 3 comments

Comments

@davatron5000
Copy link

Trying to use an IE9/10 specific @media screen and (min-width:0\0) hack (see "Moving IE specific hacks into media blocks") but StripMQ (what we use for IE8 support) is exiting with an error:

{ [Error: Stripping media queries failed.] origError: [TypeError: Cannot read property '1' of null] }

Would it be possible to support this weird hack? As a result, we'll have to degrade IE9/10 so that StripMQ can still work, but ideally StripMQ would maybe just ignore media queries it doesn't understand?

I think I lifted this hack from http://wtfforms.com: https://github.com/mdo/wtf-forms/blob/master/wtf-forms.css#L186-L212

Thanks!

@jvennix-rmn
Copy link

+1

@jvennix-rmn
Copy link

Actually, 0\0 seems to work, the problem is when I pass this through sass I end up with 0 \0, which fails:

TypeError: Cannot read property '1' of null
    at /Users/jvennix/Projects/grunt-stripmq/node_modules/css-mediaquery/index.js:105:36
    at Array.map (native)
    at /Users/jvennix/Projects/grunt-stripmq/node_modules/css-mediaquery/index.js:103:42
    at Array.map (native)
    at parseQuery (/Users/jvennix/Projects/grunt-stripmq/node_modules/css-mediaquery/index.js:88:34)
    at Object.matchQuery [as match] (/Users/jvennix/Projects/grunt-stripmq/node_modules/css-mediaquery/index.js:21:12)
    at /Users/jvennix/Projects/grunt-stripmq/tasks/lib/stripmq.js:11:28
    at Array.reduce (native)
    at stripMediaQueries (/Users/jvennix/Projects/grunt-stripmq/tasks/lib/stripmq.js:9:48)
    at StripMQ (/Users/jvennix/Projects/grunt-stripmq/tasks/lib/stripmq.js:43:12)

I will investigate to see if there's a way to prevent this behavior in sass. I don't see the point of supporting a malformed hack for IE here.

@oller
Copy link
Contributor

oller commented Oct 26, 2015

+1 for this issue with sass compiling causing stripmq to error.

In the meantime, I found a workaround using a slightly different IE Media Query hack which stripmq doesn't have such a problem with:

@media screen\0 {
  ....
}

Props to : http://keithclark.co.uk/articles/moving-ie-specific-css-into-media-blocks/media-tests/ for the media query hacks.

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