Saturday, 14 September 2013

sass @for directive - how to use steps in loops?

sass @for directive - how to use steps in loops?

in SASSS, this is very cool
@for $i from 1 through 100 {
//stuff
}
This would yield 1, 2, 3, 4....
but how would you make the loop go in intervals of two units?
something like
@for $i from 1 through 100 *step 2*{
//stuff
}
So the result is 1, 3, 5, 7....
I cannot find it in the documentation!
Thanks a lot in advance!

No comments:

Post a Comment