Skip to content

Instantly share code, notes, and snippets.

@shanemcd
Created August 19, 2013 21:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save shanemcd/6274218 to your computer and use it in GitHub Desktop.
Save shanemcd/6274218 to your computer and use it in GitHub Desktop.
@mixin background-image-retina($file, $type, $width, $background-repeat: no-repeat) {
background-image: image-url($file + '.' + $type);
width: $width;
background-repeat: $background-repeat;
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 144dpi) {
& {
background-image: image-url($file + '@2x.' + $type);
background-size: $width;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment