Skip to content

Instantly share code, notes, and snippets.

@JoostKiens
Last active December 10, 2015 23:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save JoostKiens/4511035 to your computer and use it in GitHub Desktop.
Save JoostKiens/4511035 to your computer and use it in GitHub Desktop.
Cross-browser, slimmed-down Sass media query mixin for high-density images.
/**
* Author: @joostkiens
* Licensed under the MIT license
*/
@mixin hr-image($image, $width, $height) {
@media print,
(-webkit-min-device-pixel-ratio: 1.25),
(-o-min-device-pixel-ratio: 5/4),
(min-resolution: 120dpi) {
background-image: url($image);
background-size: $width $height;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment