Defining vendors' mixins is common task under LESS, ie:
.box-shadow() {
-moz-box-shadow:@arguments;
-webkit-box-shadow:@arguments;
-o-box-shadow:@arguments;
-ms-box-shadow:@arguments;
box-shadow:@arguments;
}
.border-radius() {
-moz-border-radius:@arguments;
-webkit-border-radius:@arguments;
-o-border-radius:@arguments;
-ms-border-radius:@arguments;
border-radius:@arguments;
}
...
But it seems a bit repeating...
What I would like is a generic vendor
mixin which do this for me, ie:
.vendors(@prop, @val) {
-moz-@prop:@val;
-webkit-@prop:@val;
-o-@prop:@val;
-ms-@prop:@val;
@prop:@val;
}
Then defining box-shadow
mixin would as simple as:
.box-shadow() {
.vendors(box-shadow, @arguments);
}
The problem is my .vendors
mixin does not compile...
I tried:
.vendors(@prop, @val) {
-moz-@prop: @val; /* Error */
~"-moz-@{prop}": @val; /* Error */
~`"-moz-@{prop}": @val; /* Error */
}
Do you have an idea on how to do this?
Cheers