Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@ralphcrisostomo
Last active August 29, 2015 13:57
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 ralphcrisostomo/9756275 to your computer and use it in GitHub Desktop.
Save ralphcrisostomo/9756275 to your computer and use it in GitHub Desktop.
Modernizr test for retina / high resolution / high pixel densitiy
###
Modernizr test for retina / high resolution / high pixel density
@ref https://gist.github.com/joaocunha/7675924
@author Joao Cunha
@license MIT
###
Modernizr.addTest 'hires', ->
# starts with default value for modern browsers
dpr = window.devicePixelRatio ||
# fallback for IE
(window.screen.deviceXDPI / window.screen.logicalXDPI) ||
# default value
1
!!(dpr > 1)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment