for循环 (@for var from <start> to||through <end>)
- in 关键字 不包过 <end>
- through 关键字 包括 <end>
// for ... from ... to ...
@for $i from 1 to 3{
.item-#{$i}{
color:red
}
}
// 效果
.item-1{color:red}
.item-2{color:red}
// for ... from ... through
@for $i from 1 through 3{
.item-#{$i}{
color:red
}
}
// 效果
.item-1{color:red}
.item-2{color:red}
.item-3{color:red}