Im using LESS to dynamically create a series of classes. I can't seem to combine two variables to match one variable that I have already defined.
@import(for.less);
The pre-defined variables:
@letter-spacing--base: 0;
@letter-spacing--xs: 0.2px;
The for loop loops through this array:
@classSizes: base, xs;
The loop that creates the classes:
.letter-spacing--{
.for(@classSizes); .-each(@value) {
@name: extract(@value, 1);
@valPrefix: ~"letter-spacing--";
@valSuffix: @value;
&@{name}{
letter-spacing: ~"@" @valPrefix @valSuffix;
}
}
}
This currently outputs:
.letter-spacing--base {
letter-spacing: @ letter-spacing-- base;
}
.letter-spacing--xs {
letter-spacing: @ letter-spacing-- xs;
}
It's outputting spaces in between the variables so it doesn't match the variables. Is there any way I can remove the spaces? Or maybe there is a better way of going about this.
Thanks