0

Is there a way to pass an array to a mixin as parameter? Something like this:

.myMixin(@color, @array){
  ...
}

.myMixin('red',['one','two','three']);

The only way I could pass an array was when calling myMixin as following:

@array: one, two, three;
.myMixin('red',@array);

this mixin needs to be called many times - I don't want to set the @array variable for each call, but to pass it straight to the mixin as parameter. Is it possible?

Ira
  • 13
  • 1
  • 7
  • see [docs](http://lesscss.org/features/#mixins-parametric-feature-mixins-with-multiple-parameters) and http://stackoverflow.com/questions/21010520. I.e. `.myMixin(red, one two three);` or `.myMixin(red; one, two, three);` (and yes, don't use quotes, totally redundant in this case). – seven-phases-max Feb 28 '16 at 12:20

1 Answers1

0

Thanks @seven-phases-max, your answer was very helpful:

see docs and stackoverflow.com/questions/21010520. I.e. .myMixin(red, one two three); or .myMixin(red; one, two, three); (and yes, don't use quotes, totally redundant in this case). – seven-phases-max

Ira
  • 13
  • 1
  • 7