Skip to content

Instantly share code, notes, and snippets.

@manoelneto
Forked from twe4ked/input.scss
Last active December 30, 2015 11:39
Show Gist options
  • Save manoelneto/7823508 to your computer and use it in GitHub Desktop.
Save manoelneto/7823508 to your computer and use it in GitHub Desktop.
Compass mixin retira display
@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;
}
#foo {
width : $width;
height: $height;
background-image: url("foobar.png");
background: repeat; }
@media (-webkit-min-device-pixel-ratio: 2) {
#foo {
background-image: url("foobar@2x.png");
-webkit-background-size: 10px 20px; } }
@Amara-Balakrishna1
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment