Last active
August 29, 2015 14:03
-
-
Save vitto/107eb80a2b8d5c1c04f3 to your computer and use it in GitHub Desktop.
Frontsize - Set sprite position example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div class="block">Pencil</div> | |
<div class="my-sprite pencil"></div> | |
<div class="block top-margin">Ruler</div> | |
<div class="my-sprite ruler"></div> | |
<div class="block top-margin">Eraser</div> | |
<div class="my-sprite eraser"></div> | |
<div class="block top-margin">Bin</div> | |
<div class="my-sprite bin"></div> | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.my-sprite { | |
@width : 32px; | |
@height : @width; | |
@imageWidth : 64px; | |
@imageHeight : @imageWidth; | |
.spriteRetina("standard-sprite.png", "retina-sprite.png", @width, @height, @imageWidth, @imageHeight); | |
&.pencil { | |
.spritePosition(0, 0, @width, @height); | |
} | |
&.ruler { | |
.spritePosition(1, 0, @width, @height); | |
} | |
&.eraser { | |
.spritePosition(0, 1, @width, @height); | |
} | |
&.bin { | |
.spritePosition(1, 1, @width, @height); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
spriteRetina
@defaultImage
@retinaImage
@width
@height
@width
@imageWidth
@imageHeight
@rootPath
@root-path
app.less
spritePosition
@horizontalPosition
0
@verticalPosition
0
@width
0
@height
@width