全国热线电话:13633878273
发布时间: 2014-11-29 16:39:57
列表函数
length
返回列表中元素的个数。
参数:list - 由逗号或空格分隔的元素列表。 返回值:一个代表元素个数的数字。
案例: length(1px solid #0080ff); 输出:3
案例:
@list: "banana", "tomato", "potato", "peach";
n: length(@list);
输出:
n: 4;
extract
返回列表中指定位置的元素。
参数: list - 逗号或空格分隔的元素列表。 index - 指定列表中元素位置的数字。 返回值:列表中指定位置的元素。
案例: extract(8px dotted red, 2); 输出: dotted
案例:
@list: apple, pear, coconut, orange;
value: extract(@list, 3);
输出:
value: coconut;