Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
retina background images mixxer
// ----
// Sass (v3.4.13)
// Compass (v1.0.3)
// ----
$images-base-path: 'test/';
@mixin retinaBg($path, $width, $height, $type:'png') {
background-image: url($images-base-path + $path + '.' + $type);
@media only screen and (min-device-pixel-ratio: 2),
only screen and (min-resolution: 192dpi) {
background-image: url($images-base-path + $path + '@2x.' + $type);
background-size: $width $height;
}
}
.foo{
@include retinaBg('/icons/options/sms',10px, 20px);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.