Skip to content

Instantly share code, notes, and snippets.

@Simounet
Created May 22, 2014 10:08
Show Gist options
  • Save Simounet/a331356a7d25c6de6c70 to your computer and use it in GitHub Desktop.
Save Simounet/a331356a7d25c6de6c70 to your computer and use it in GitHub Desktop.
Compass sprite generator with before pseudo class
$files: sprite-map("file/*.png");
%file-sprite {
display: inline-block;
margin-right: 8px;
@include sprite-dimensions($files, 'doc');
background: sprite-url($files) no-repeat;
content: '';
vertical-align: middle;
}
@each $i in sprite_names($files) {
.file--#{$i}:before {
@extend %file-sprite;
background-position: sprite-position($files, $i);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment