Created
October 19, 2016 09:14
-
-
Save ralexandr/a61a5fd8da9932f5e9d3535c15ce262c to your computer and use it in GitHub Desktop.
SASS: Retina images
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
/*-------------------------------- | |
Retina images | |
example: | |
.element { | |
@include retina { | |
background-image: url(../img/background@2x.png); | |
} | |
} | |
*/ | |
@mixin retina { | |
@media only screen and (-webkit-min-device-pixel-ratio: 1.5), | |
only screen and (-moz-min-device-pixel-ratio: 1.5), | |
only screen and (-o-min-device-pixel-ratio: 3 / 2), | |
only screen and (min-device-pixel-ratio: 1.5), | |
only screen and (min-resolution: 1.5dppx) { | |
@content; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment