Skip to content

Instantly share code, notes, and snippets.

@almonk
Created September 12, 2012 09:57
Show Gist options
  • Save almonk/3705665 to your computer and use it in GitHub Desktop.
Save almonk/3705665 to your computer and use it in GitHub Desktop.
@mixin background-image-retina($file, $type, $width, $height) {
background-image: url($file + '.' + $type);
@media (-webkit-min-device-pixel-ratio: 2), (-moz-min-device-pixel-ratio: 2) {
& {
background-image: url($file + '@2x.' + $type);
-webkit-background-size: $width $height;
}
}
}
.logo{
@include background-image-retina('../images/logo', 'png', 80px, 79px);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment