Skip to content

Instantly share code, notes, and snippets.

@alexdahl
Created October 29, 2013 00:43
Show Gist options
  • Save alexdahl/7207361 to your computer and use it in GitHub Desktop.
Save alexdahl/7207361 to your computer and use it in GitHub Desktop.
A simple LESS approach for a reusable high-DPI media query.
@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