-
-
Save adamstac/1223970 to your computer and use it in GitHub Desktop.
A simple way to include both low-res and hi-res graphics for iOS/Desktop/etc.
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
@mixin hires-graphic($file, $type, $width, $height) | |
$file-name: $file + "." + $type | |
$retina-name: $file + "-retina." + $type | |
@media (-webkit-min-device-pixel-ratio: 2) | |
& | |
background-image: image-url($retina-name) | |
-webkit-background-size: $width $height |
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
display: block | |
width: 20px | |
height: 20px | |
background-repeat: no-repeat | |
@include hires-graphic('icon-facebook', 'png', 20px, 20px) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment