Skip to content

Instantly share code, notes, and snippets.

@rcaracaus
Created August 28, 2013 06:29
Show Gist options
  • Save rcaracaus/6362725 to your computer and use it in GitHub Desktop.
Save rcaracaus/6362725 to your computer and use it in GitHub Desktop.
hdpi mixin
@mixin hdpi-sprite($sprite-folder, $sprite) {
$sprite-map: sprite-map("sprites/" + $sprite-folder + "/1x/*.png", $layout: smart);
$sprite-map-2x: sprite-map("sprites/" + $sprite-folder + "/2x/*.png", $layout: smart);
background: sprite($sprite-map, $sprite) no-repeat;
@include breakpoint($hr-display) {
background-image:sprite-url($sprite-map-2x);
background-size:image-width(sprite-path($sprite-map)) auto;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment