Skip to content

Instantly share code, notes, and snippets.

@meritt
Created July 23, 2012 11:24
Show Gist options
  • Save meritt/3163156 to your computer and use it in GitHub Desktop.
Save meritt/3163156 to your computer and use it in GitHub Desktop.
Detect retina screens
function isRetina() {
return (('devicePixelRatio' in window && devicePixelRatio > 1) || ('matchMedia' in window && matchMedia("(-moz-device-pixel-ratio:1.0)").matches));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment