-
-
Save manoelneto/7823508 to your computer and use it in GitHub Desktop.
Compass mixin retira display
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 background-image-retina($file, $type) { | |
$fileName : $file + '.' + $type; | |
$retinaFileName : $file + '@2x.' + $type; | |
$width : image-width($fileName); | |
$height : image-height($fileName); | |
width: $width; | |
height: $height; | |
background-image: url($file + '.' + $type); | |
@media (-webkit-min-device-pixel-ratio: 2), (-moz-min-device-pixel-ratio: 2) { | |
& { | |
background-image: url($retinaFileName); | |
-webkit-background-size: $width $height; | |
} | |
} | |
} | |
// Example | |
#foo { | |
@include background-image-retina('foobar', 'png', 10px, 20px); | |
background: repeat; | |
} |
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
#foo { | |
width : $width; | |
height: $height; | |
background-image: url("foobar.png"); | |
background: repeat; } | |
@media (-webkit-min-device-pixel-ratio: 2) { | |
#foo { | |
background-image: url("[email protected]"); | |
-webkit-background-size: 10px 20px; } } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
i tried of compressing a application build with d3js and jquery.using gulp.i got node_modules folder as a result.how to know that build is success.and how to use the compressed gulp file