Created
May 1, 2014 12:16
-
-
Save bavington/ae30ad5f779a3e93d2d7 to your computer and use it in GitHub Desktop.
Retinize SASS Mixin
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$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