I need to declare a LESS mixin with a variable number of arguments, and pass it to the mixin, like this:
.linear-gradient(@color1, @color2) {
background: -webkit-linear-gradient(@color1, @color2);
background: -o-linear-gradient(@color1, @color2);
background: -moz-linear-gradient(@color1, @color2);
background: linear-gradient(@color1, @color2);
}
.linear-gradient(@color1, @color2, @color3) { ...
.linear-gradient(@color1, @color2, @color3, @color4) { ...
... // usage with a variable number of arguments:
body > header {
.linear-gradient(red, yellow, blue);
As described in the documentation I can use @arguments
and @rest
keywords, but is not very clear for me how exactly should it be used in my case...
Here is my PEN for testing