I know that in LESS is possible to generate many CSS classes using loops. I personally used this technique to answer another user\'s question.
Now I\'m facing the fo
(Now when Less v3.x and higher provides native support for custom functions).
Just as in most of other programming language, instead of a list of auto-generated/predefined variables, this programming problem is solved via function
functionality.
I.e. you define a function like:
.transparent-black(@value) {
return: fade(@nero, @value ./ 10);
}
And then instead of @transparent-black-*
variable you simply use .transparent-black(*)[]
function call, e.g.:
div {
color: .transparent-black(50)[];
}
This is obviously a simplified example (in a real project I certainly would make black/white/etc
to be the function parameters too).