在less中遍历数组元素

在Less中并没有对数组遍历的原生支持,我们可以通过mixin递归的方式来实现遍历。

1、定义数组元素

1
@colors: red, green, blue, black;

2、获取数组元素长度

1
@length: length(@color);
Your browser is out-of-date!

Update your browser to view this website correctly. Update my browser now

×