nex3/sass — Issue #297: Add an implicit $arguments variable for mixins and functions
Author: richthegeek
Created: 2012-02-29 18:38:37+00:00
State: open

Similar to the Javascript "arguments" variable, it is occasionally useful to have a variable-length number of arguments in a function/mixin.

The only solution that I can think of for this is setting an $arguments variable of type List (if you'll excuse the Java notation) which can then be accessed in at least two ways:
- @each $arg in $arguments
- nth($arguments, 4)

A sample use case might be linear gradients:
```@mixin linear-gradient() {
$value: '';
@each $arg in $arguments {
$value: $value + $arg;
}
@include prefix($value);
}```

I'm sure there are other times it could be useful as well, but that's the one that interests me for now!