Last active
August 29, 2015 13:57
-
-
Save ralphcrisostomo/9756275 to your computer and use it in GitHub Desktop.
Modernizr test for retina / high resolution / high pixel densitiy
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
### | |
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