See my comment above:
Help from this Answer: Less js: Mixin property as an argument of another mixin?
I was able to get it to work
the clue was to add the "+" property+: value;
Final Code (covers all tests from above)
.transition-property(@values) {
@vendorPrefixes: -webkit-, -moz-, -o-, ~'';
// http://caniuse.com/#search=transition
// http://caniuse.com/#search=transform
.for(@vendorPrefixes);.-each(@i) {
@vendorPrefix: extract(@vendorPrefixes, @i);
.prop(@values);.-prop(@in) {
@value: e(extract(@values, @in));
.-true() {@{vendorPrefix}transition-property+: ~'@{vendorPrefix}@{value}';}
.-false() {@{vendorPrefix}transition-property+: @value;}
.-call(transform) {.-true;}
.-call(box-shadow){.-true;}
.-call(...) when (default()){.-false;}
.-call(@value);
}
}
}
UPDATE:
(exported mixin)// for-loop
// works with two integers or a list
.for(@i;@n) when (@i <= @n) {.-each(@i);}
.for(@n) when not (isnumber(@n)) {.for(1;length(@n));}
.for(@i;@n) when not (@i = @n) {.for(@i + 1;@n);}
// prop-loop
// loop through values for vendor-prefixing
.prop(@p;@in;@n) when (@in <= @n) {.-vendor(@p;@in);}
.prop(@p;@n) when not (isnumber(@n)) {.prop(@p;1;length(@n));}
.prop(@p;@in;@n) when not (@in = @n) {.prop(@p;@in + 1;@n);}
// prefix properties
.-vendor(@prop;@in) {
@value: e(extract(@values, @in));
.-true() {@{vendorPrefix}@{prop}+: ~'@{vendorPrefix}@{value}';}
.-false() {@{vendorPrefix}@{prop}+: @value;}
.-call(transform) {.-true;}
.-call(box-shadow){.-true;}
.-call(...) when (default()){.-false;}
.-call(@value);
}
.transition-property(@values) {
@vendorPrefixes: -webkit-, -moz-, -o-, ~'';
// http://caniuse.com/#search=transition
// http://caniuse.com/#search=transform
.for(@vendorPrefixes);.-each(@i) {
@vendorPrefix: extract(@vendorPrefixes, @i);
.prop(transition-property;@values);
}
}
Update
Here's another example (a little more advanced) using the method suggested by @seven-phases-max (concatenating variables).
content: '@{a} @{b}'
LESS:
https://github.com/pixelass/more-or-less/blob/master/examples/less/animaless/animaless.less
Demo:
http://pixelass.github.io/more-or-less/examples/animaless.html