Collections SASS-将集合作为参数传递给SASS mixin

Collections SASS-将集合作为参数传递给SASS mixin,collections,sass,mixins,Collections,Sass,Mixins,如何将集合传递给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

如何将集合传递给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...."
=媒体($type1,$size1:null)
@如果($type1)和($size1)
@介质($type1:$size1)
@内容
@elseif($type1)和not($size1)
$collection:$type1
@媒体(第n($collection,1):第n($collection,2))已排序。我必须使用#{map get($collection,$key name)}函数

=media($type1, $size1: null)
  @if ($type1) and ($size1)
    @media ($type1: $size1)
      @content
  @elseif ($type1) and not ($size1)
    $collection: $type1
    @media (#{map-get($collection, "type1")}: #{map-get($collection, "size1")})
      @content
  @else
    @error "Upsss...."
=media($type1, $size1: null)
  @if ($type1) and ($size1)
    @media ($type1: $size1)
      @content
  @elseif ($type1) and not ($size1)
    $collection: $type1
    @media (#{map-get($collection, "type1")}: #{map-get($collection, "size1")})
      @content
  @else
    @error "Upsss...."