Created
March 11, 2015 13:15
-
-
Save corysimmons/69d3c6642e035fefbe98 to your computer and use it in GitHub Desktop.
Stylus Retina Mixin
This file contains hidden or 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(file, ext) | |
| background-image: url(file'.'ext) | |
| @media (-webkit-min-device-pixel-ratio: 2), | |
| ( min--moz-device-pixel-ratio: 2), | |
| ( -o-min-device-pixel-ratio: 2/1), | |
| ( min-device-pixel-ratio: 2), | |
| ( min-resolution: 192dpi), | |
| ( min-resolution: 2dppx) | |
| background-image: url(file'@2x.'ext) | |
| background-size: cover |
Hello Mate! I love that you think the same way as I do with stylus.
That's the right mixin I was looking for.
In order to use it it would something like
.item retina(mybackground, jpg)
Sorry for the dumb question!
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
background-size: covermight not always work for what you need, might want to add width/height params