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
1 つの書き方を次に示します。
@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)); }