[ACCEPTED]-Dynamic Variable Names in LESS CSS-less
Accepted answer
You can use Variable Names. And I've tested the code at 1 http://lesstester.com/, it works.
@horizontal-default-color: #fff;
@horizontal-inverse-color: #000;
.horizontal-variant(@variant) {
@color: "horizontal-@{variant}-color";
color: @@color;
}
.horizontal-default{
.horizontal-variant(default);
}
.horizontal-inverse{
.horizontal-variant(inverse);
}
Source:
stackoverflow.com
More Related questions
Cookie Warning
We use cookies to improve the performance of the site. By staying on our site, you agree to the terms of use of cookies.