Created
October 29, 2013 00:43
-
-
Save alexdahl/7207361 to your computer and use it in GitHub Desktop.
A simple LESS approach for a reusable high-DPI media query.
This file contains 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
@highDPI: ~"only screen and (-webkit-min-device-pixel-ratio: 1.5), only screen and (min-resolution: 1.5dppx)"; | |
div { | |
background-image: url('1x.png'); | |
@media @highDPI { | |
background-image: url('2x.png'); | |
background-size: 100px 100px; /* The original 1x dimensions. */ | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment