This
.a {
@a: 1;
@b: 2;
@concat: @a;
@concat: ~"@{concat}@{b}";
margin: @concat;
}
gives an error.
Syntax error: too much recursion
However, this
.a {
@a: 1;
@b: 2;
@concat: e(`(function (a, b) {
var concat = "" + a;
concat += b;
return concat;
})(@{a}, @{b})`);
margin: @concat;
}
would work.
Is there a trick to concatenate a string with itself with LESS only (without concat1
, concat2
, etc variables)?
Note that the code above isn't a subject for simplification because it will use conditionals. The code has to generate
.optional-conditional-class1, .optional-conditional-class2, .optional-conditional-class3 {
....
}
in a similar loop fashion. That's why I want to form concatenated string with the list of classes.