Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save nicohq/5952130 to your computer and use it in GitHub Desktop.
Save nicohq/5952130 to your computer and use it in GitHub Desktop.
@mixin all-retina-sprites($map, $dimensions: false){
$base-class: sprite-map-name($map);
.#{$base-class}-retina-sprite{
background: sprite-url($map) no-repeat;
@include background-size(ceil(image-width(sprite-path($map)) / 2) auto);
}
@each $sprite in sprite-names($map){
.#{$base-class}-#{$sprite}{
@extend .#{$base-class}-retina-sprite;
@if $dimensions{
width: ceil(image-width(sprite-file($map, $sprite)) / 2);
height: ceil(image-height(sprite-file($map, $sprite)) / 2);
}
$pos: sprite-position($map, $sprite);
background-position: ceil(nth($pos, 1) / 2) ceil(nth($pos, 2) / 2);
}
}
}
// Sprite set: General
// ----------------------------------------
//$general-layout: smart;
$general-retina-spacing: 1px;
@import "general-retina/*.png";
//@include all-general-retina-sprites;
@include all-retina-sprites($general-retina-sprites, $dimensions: true);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment