Skip to content

Instantly share code, notes, and snippets.

@slav123
Created October 7, 2013 02:37
Show Gist options
  • Save slav123/6861790 to your computer and use it in GitHub Desktop.
Save slav123/6861790 to your computer and use it in GitHub Desktop.
working loop's in LESS
@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) {}
@artskar
Copy link

artskar commented Oct 7, 2013

any demo ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment