Skip to content

Instantly share code, notes, and snippets.

@pfulton
Forked from robtarr/mixins.scss
Created August 20, 2012 18:33
Show Gist options
  • Save pfulton/3406494 to your computer and use it in GitHub Desktop.
Save pfulton/3406494 to your computer and use it in GitHub Desktop.
Retina SASS mix-in
@mixin retina($defaultPath, $retinaPath, $minSize) {
@media (min-width: $minSize) {
background-image: url($defaultPath);
@media (-webkit-min-device-pixel-ratio: 1.5),
(-o-min-device-pixel-ratio: 3/2),
(min-device-pixel-ratio: 1.5) {
background-image: url($retinaPath);
background-size: image-width($defaultPath) image-height($defaultPath);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment