Skip to content

Instantly share code, notes, and snippets.

@jgatjens
Last active December 13, 2015 18:18
Show Gist options
  • Save jgatjens/4954129 to your computer and use it in GitHub Desktop.
Save jgatjens/4954129 to your computer and use it in GitHub Desktop.
Compass - Custom sprite
@import "compass/utilities/sprites/base";
$icons: sprite-map("images/icons/*.png", $layout: smart);
[class^="icon-"] {
display: inline-block;
background: $icons;
}
@each $i in sprite_names($icons) {
.icon-#{$i} {
background-position: sprite-position($icons, $i);
@include sprite-dimensions($icons, $i);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment