Skip to content

Instantly share code, notes, and snippets.

@matthewpennell
Created September 7, 2015 14:27
Show Gist options
  • 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