Created
January 17, 2014 09:35
-
-
Save KATT/8470648 to your computer and use it in GitHub Desktop.
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
background-x2image($image) { | |
$ext = extname($image); | |
$image2x = pathjoin(dirname($image), basename($image, $ext) + '@2x' + $ext); | |
background-image: url($public-image-path + $image); | |
@media $retina { | |
background-image: url($public-image-path + $image2x); | |
} | |
} |
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
@import 'variables' | |
@import 'background-x2image.styl' | |
#logo { | |
background-size: contain; | |
background-x2image: 'logo.png'; | |
} |
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 = 'all and (-webkit-min-device-pixel-ratio: 1.5)'; | |
$relative-image-path = '../assets/img/'; | |
$public-image-path = '../img/'; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment