Created
October 7, 2013 02:37
-
-
Save slav123/6861790 to your computer and use it in GitHub Desktop.
working loop's in LESS
This file contains hidden or 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
@iterations: 30; | |
.loopingClass (@iterations); | |
// helper class, will never show up in resulting css | |
// will be called as long the index is above 0 | |
.loopingClass (@index) when (@index > 0) { | |
~.ico@{index} { | |
// your resulting css | |
background: url("../img/ico@{index}.png"); | |
} | |
// next iteration | |
.loopingClass(@index - 1); | |
} | |
// end the loop when index is 0 | |
.loopingClass (0) {} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
any demo ?