Created
November 9, 2016 23:24
-
-
Save jaimeeee/22ddcb3cef3ed401f56b6137f4f39aca to your computer and use it in GitHub Desktop.
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
@mixin retina-image($filename, $background-size, $extension: png, $retina-suffix: _2x, $superretina-suffix: _3x) { | |
background-image: url("#{$filename}.#{$extension}"); | |
@media (min--moz-device-pixel-ratio: 1.3), | |
(-o-min-device-pixel-ratio: 1.3/1), | |
(-webkit-min-device-pixel-ratio: 1.3), | |
(min-device-pixel-ratio: 1.3), | |
(min-resolution: 1.3dppx) { | |
background-image: url("#{$filename}#{$retina-suffix}.#{$extension}"); | |
} | |
@media (min--moz-device-pixel-ratio: 2.6), | |
(-o-min-device-pixel-ratio: 2.6/1), | |
(-webkit-min-device-pixel-ratio: 2.6), | |
(min-device-pixel-ratio: 2.6), | |
(min-resolution: 2.6dppx) { | |
background-image: url("#{$filename}#{$superretina-suffix}.#{$extension}"); | |
} | |
background-size: $background-size; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment