Skip to content

Instantly share code, notes, and snippets.

@jorjun
Created December 13, 2012 10:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jorjun/4275621 to your computer and use it in GitHub Desktop.
Save jorjun/4275621 to your computer and use it in GitHub Desktop.
Using Zwoptex to generate your CSS sprite sheets
.icon {
display:block;
background-image:url("SPRITE_SHEET.png");
background-repeat:no-repeat;
}
{% for sprite in spritesAndAliases %}
.sprt_{{ sprite.nameWithoutExtension }} {
   background-position: -{{ sprite.textureRectX }}px -{{ sprite.textureRectY }}px;
   height: {{ sprite.textureRectHeight }}px;
   width:{{ sprite.textureRectWidth }}px;
}
{% /for %}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment