Skip to content

Instantly share code, notes, and snippets.

@bavington
Created May 1, 2014 12:16
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bavington/ae30ad5f779a3e93d2d7 to your computer and use it in GitHub Desktop.
Save bavington/ae30ad5f779a3e93d2d7 to your computer and use it in GitHub Desktop.
Retinize SASS Mixin
$is-hidpi:" (-webkit-min-device-pixel-ratio: 1.5),
(min--moz-device-pixel-ratio: 1.5),
(-o-min-device-pixel-ratio: 3/2),
(min-device-pixel-ratio: 1.5),
(min-resolution: 1.5dppx)";
@mixin retinize($file, $type){
background-image: url('images/' + $file + '.' + $type);
@media #{$is-hidpi}{
&{
background-image: url('images/' + $file + '@2x.' + $type);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment