The for loop is created using a @for rule.
Syntaxes
Syntax 1
@for from to {
...
}
Syntax 2
@for from through {
...
}
Both of the syntaxes above counts from one end (first expression) to the other end (second expression) and evaluates the block inside the loop for each single increment or decrement.
We use variable right after starting the for rule and that variable is assigned the number from the loop every time.
If you use @for rule with “to” then the final number is not included but if you use @for rule with “through” then the final number is included.
@for loop example with through
@for loop example with to
examples for loop sass