Skip to content

Instantly share code, notes, and snippets.

@matthewpennell
Created September 7, 2015 14:27
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 matthewpennell/1a6c39d0b539be2a47d0 to your computer and use it in GitHub Desktop.
Save matthewpennell/1a6c39d0b539be2a47d0 to your computer and use it in GitHub Desktop.
.sprite {
background-image: url('/path/to/sprite.png');
background-repeat: no-repeat;
}
{% for image in images %}
{% if image.pseudo %}
.sprite .sprite-container{{ image.pseudo }} .{{ image.label }},
{% endif %}
.{{ image.label }}{{ image.pseudo }} {
background-position: {{ image.x ~ ('px' if image.x) }} {{ image.y ~ ('px' if image.y) }};
width: {{ image.width }}px;
height: {{ image.height }}px;
}
{% endfor %}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment