Sass 的@for 循环中有两种方式:
@for $i from <start> through<end>
@for $i from <start> to <end>
$i 表示变量、start 表示初始值、end 表示结束值
through 表示包含end 这个数,而to 则不包含end 这个数
![](https://i-blog.csdnimg.cn/blog_migrate/8d163eb4cabbaa9e9332242226905640.png)
@while 指令类似@for,只要@while 后面的条件为true 就会执行
![](https://i-blog.csdnimg.cn/blog_migrate/4df4abf22e9e6a01f7c9914895671459.png)
@each 循环
@each 循环就是遍历一个列表,然后从列表中取出对应的值。
@each $var in <list>
![](https://i-blog.csdnimg.cn/blog_migrate/589100b79929d9cb47ac1bfc82b79a94.png)