Skip to content

Instantly share code, notes, and snippets.

@vitto
Last active August 29, 2015 14:01
Show Gist options
  • Save vitto/ca08bf48389fb5618874 to your computer and use it in GitHub Desktop.
Save vitto/ca08bf48389fb5618874 to your computer and use it in GitHub Desktop.
Frontsize - How to create a retina ready bitmap sprite
This is how to create a sprite which is retina ready
<div class="sprite-retina-ready foo"></div>
<div class="sprite-retina-ready bar"></div>
.sprite-retina-ready {
@spriteWidth: 32px;
@spriteHeight: @spriteWidth;
@imageWidth: 64px;
@imageHeight: 32px;
.spriteRetina("sprite-1x.png", "sprite-2x.png", @spriteWidth, @spriteHeight, @imageWidth, @imageHeight);
.setSprite(foo, 0, 0, @spriteWidth);
.setSprite(bar, 1, 0, @spriteWidth);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment