【发布时间】:2023-03-20 02:40:02
【问题描述】:
如何将集合传递给 sass mixin ?
=media($type1, $size1: null)
@if ($type1) and ($size1)
@media ($type1: $size1)
@content
@elseif ($type1) and not ($size1)
$collection: $type1
@media (nth($collection, 1): nth($collection, 2)) <-- ERROR
@content
@else
@error "Upsss...."
用例
$m: "36em"
$minw: "min-width
$tablet: ("type1": $minw, "size1": $m)
+media($tablet) <-- ERROR
p
font-size: 2em
【问题讨论】:
标签: collections sass mixins