Skip to content

Instantly share code, notes, and snippets.

@chrisforrette
Created February 12, 2015 00:13
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 chrisforrette/808bcce870837d21494e to your computer and use it in GitHub Desktop.
Save chrisforrette/808bcce870837d21494e to your computer and use it in GitHub Desktop.
Modernizr retina detection
Modernizr.addTest('retina', function() {
// starts with default value for modern browsers
var dpr = window.devicePixelRatio ||
// fallback for IE
(window.screen.deviceXDPI / window.screen.logicalXDPI) ||
// default value
1;
return !!(dpr > 1);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment