Skip to content

Instantly share code, notes, and snippets.

@JoshuaJones
Created November 29, 2012 20:05
Show Gist options
  • Save JoshuaJones/4171535 to your computer and use it in GitHub Desktop.
Save JoshuaJones/4171535 to your computer and use it in GitHub Desktop.
@mixin retina-image($filename, $image-width, $image-height, $extension: ".png") {
background-image: url($filename + $extension);
height: $image-height;
width: $image-width;
@media (min--moz-device-pixel-ratio: 1.3),
(-o-min-device-pixel-ratio: 2.6/2),
(-webkit-min-device-pixel-ratio: 1.3),
(min-device-pixel-ratio: 1.3),
(min-resolution: 1.3dppx) {
background-image: url($filename + "2x" + $extension);
background-size: $image-width $image-height;
}
}​
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment