user2882335 user2882335 - 4 months ago 46
Sass (Sass) Question

Pass a mixin a list and a variable

Is it possible to pass a list of parameters as well as another separate parameter.

Something like

@mixin cols($width...,$gutter) {

@include cols((4,4,4),2%);


I think yes we can do that.non list parameters should be before list/array parameters

check this snippet

@mixin box-shadow($color,$shadows...) {
  -moz-box-shadow: $shadows;
  -webkit-box-shadow: $shadows;
  box-shadow: $shadows;

.shadows {
  @include box-shadow('red',0px 4px 5px #666, 2px 6px 10px #999);

Hope this helps