Skip to content


media queries #49

mattwiebe opened this Issue · 7 comments

3 participants


adding support for CSS media queries might be cool.

Modernizr member

would this basically be .. which media queries are currently accepted in the given view?

here's a good start

we also have a few more over here

matt, if you have more details on how this would work, i'd love to hear 'em


Gee, that was the most uninformative request evar.

My main use-case for this were the becoming-much-more-relevant screen queries being used for mobile browsers, like device-width, max-device-width and especially orientation. Exactly the stuff you're using in your frontend-pro-template.

I think the main one is orientation though - especially if the iPhone continues not to support it:

Modernizr member

Scott Jehl has an implementation that requires document.body


Here's an updated version of the function that no longer needs document.body

Modernizr member

And looks like Opera did this a bit ago:

and Chrome supports .. e.g.:
alert('(device-width: 1680px)'));

Maybe it makes sense to adapt Scott's to be a fallback solution for ..
Right now I prefer its offsetWidth check vs having to use getComputedStyle (in Operas)

Modernizr member

Okay so I went ahead and did it: fallback

Oddly Chrome 5 supports matchMedium but Chrome 6 doesnt.

Modernizr member

closing this ticket for now.. we're linking it up on the wiki:

thanks everyone. this'll go into the Modernizr 2.0 ecosystem of tests... somehow. :)

@paulirish paulirish reopened this
@paulirish paulirish closed this in f1ea262
@phistuck phistuck pushed a commit that referenced this issue
PhistucK media queries test. EZ PZ. fixes #49 2d670aa
@patrickkettner patrickkettner pushed a commit to patrickkettner/Modernizr that referenced this issue
@paulirish paulirish media queries test. EZ PZ. fixes #49 ffabc4f
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.