Skip to content

Instantly share code, notes, and snippets.

@jnowland
Created September 5, 2014 06:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jnowland/186d8dc925593a413edd to your computer and use it in GitHub Desktop.
Save jnowland/186d8dc925593a413edd to your computer and use it in GitHub Desktop.
Modernizr.addTest('retina', function(){
if (window.matchMedia) {
var mq = window.matchMedia("only screen and (-moz-min-device-pixel-ratio: 1.3), only screen and (-o-min-device-pixel-ratio: 2.6/2), only screen and (-webkit-min-device-pixel-ratio: 1.3), only screen and (min-device-pixel-ratio: 1.3), only screen and (min-resolution: 1.3dppx)");
if(mq && mq.matches) {
return true;
}
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment