Skip to content

Instantly share code, notes, and snippets.

@hjortureh
Last active December 29, 2015 15:48
Show Gist options
  • Save hjortureh/7692792 to your computer and use it in GitHub Desktop.
Save hjortureh/7692792 to your computer and use it in GitHub Desktop.
responsive.io - sass sprites example
$image-url: "http://mydomain.com/sprite@2x.png"
%sprite {
background: url("http://src.responsive.io/w=200/#{$image-url}") no-repeat 0 0;
}
.success {
@extend %sprite;
background-position: 0 0;
}
.infinity {
@extend %sprite;
background-position: -100px 0;
}
.shopping-bag {
@extend %sprite;
background-position: 0 -100px;
}
.map {
@extend %sprite;
background-position: -100px -100px;
}
@include if-min-resolution(1.5) {
.success,
.infinity,
.shopping-bag,
.map {
background-image: url("http://src.responsive.io/w=400/#{$image-url}");
background-size: 200px 200px;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment