user2882335 user2882335 - 1 year ago 142
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%);

Answer Source

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

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download