Skip to content

Instantly share code, notes, and snippets.

@damonsk
Forked from almonk/style.css.scss
Created September 12, 2012 10:13
Show Gist options
  • Save damonsk/3705740 to your computer and use it in GitHub Desktop.
Save damonsk/3705740 to your computer and use it in GitHub Desktop.
Less retina background images 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{
.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