0

I'm writing a Less mixin.

I want to be able to pass the mixin several(undefined) parameters and get the params one by one.

.my-mixin-with-property(@property, @value-1, @value-2, ...) {
    @{property}: some-func(@value-1) some-func(@value-2) ...;
}

I am going to use @rest and then pass undefined numbers of parameters but I don't know how to get the elements of @rest one by one, so I can pass the elements to some-func one by one and get the result.

How to do this? Thanks!

cmal
  • 2,062
  • 1
  • 18
  • 35
  • first of all name it, e.g. `.m(@property, @value-1, @value-2, @name-for-the-rest...)`, then the use [corresponding function](http://lesscss.org/functions/#list-functions). – seven-phases-max May 08 '17 at 12:12
  • Assuming *so I can pass the elements to some-func one by one* the most fitting example for your use-case would be http://stackoverflow.com/questions/11013528 - *part 3* I guess (find more by strating with http://stackoverflow.com/questions/20954762) – seven-phases-max May 08 '17 at 12:32
  • Great! Thank you very much. – cmal May 09 '17 at 03:06

0 Answers0