Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在尝试编写一个 sass @function function_name($prefix, $list_of_values) ,它将返回一个值列表,其中每个值$list_of_values都将以逗号为前缀$prefix和后缀,最后一个除外。可能它已经存在于 sass 或 compass 中,我只是不知道。
@function function_name($prefix, $list_of_values)
$list_of_values
$prefix
这是一种写法:
@function prefixer($prefix, $list) { $new-list: (); @for $i from 1 to length($list) { $new-list: append($new-list, $prefix + nth($list, $i), comma); } $new-list: append($new-list, nth($list, length($list), comma)); }