Skip to content

Instantly share code, notes, and snippets.

@maxbeatty
Created May 22, 2012 17:58
Show Gist options
  • Save maxbeatty/2770602 to your computer and use it in GitHub Desktop.
Save maxbeatty/2770602 to your computer and use it in GitHub Desktop.
// original
@import "mgmt/sprites/icons/*.png";
$icons: sprite-map("mgmt/sprites/icons/*.png");
.test {
background: transparent $icons no-repeat 0 0;
}
// my test
$cc: sprite-map("sprites/icons/credit-cards/*.png")
[class^=credit-cards]
background: $cc
// my output
[class^=credit-cards] {
background: url('/assets/img/sprites/icons/credit-cards-sd348035735.png');
// updated
@import "mgmt/sprites/icons/*.png";
$icon-new-spacing: 20px;
$icon-sprite: sprite-map("mgmt/sprites/icons/*.png",
$new-position: 100%, $new-spacing: 15px, $new-repeat: no-repeat);
.test {
background: transparent $icon-sprite no-repeat 0 0;
}
// updated test
$cc: sprite-map("sprites/icons/credit-cards/*.png", $position: 0%, $spacing: 20px, $repeat: no-repeat)
[class^=credit-cards]
background: $cc
// updated test generated
[class^=credit-cards] {
background: url('/assets/img/sprites/icons/credit-cards-s008fbac68a.png');
// note: sprite has icons spaced by 20px as intended from the sprite-map declaration
// what you should need
$icon-sprite: sprite-map("mgmt/sprites/icons/*.png", $position: 0%, $spacing: 15px, $repeat: no-repeat);
.test {
background: transparent $icon-sprite no-repeat 0 0;
}
// expect sprite to have each image with 15px of space between them
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment