Last active
August 29, 2015 14:06
-
-
Save rileyjshaw/07bb827c0739c92cab43 to your computer and use it in GitHub Desktop.
Retina sprites compass mixin
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
=retina-sprites($spritesheet) | |
@each $sprite in sprite_names($spritesheet) | |
&.#{$sprite} | |
$positions: '' | |
@each $j in sprite-position($spritesheet, $sprite) | |
$positions: append($positions, $j / 2, space) | |
height: image-height(sprite-file($spritesheet, $sprite)) / 2 | |
width: image-width(sprite-file($spritesheet, $sprite)) / 2 | |
background-position: $positions | |
background-image: $spritesheet | |
background-size: image-width($spritesheet)/2 image-height($spritesheet)/2 | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment