I am not familiar with Less
. In my understanding, I think Less
can transform the less
format file to standard css
file(if
It is impossible to do within given methods.
But possible like this:
.loopingClass (@index) when (@index > 0){
.span_@{index}{
width: @index px;
}
.loopingClass(@index - 1);
}
.loopingClass(5);
Resilt will be like this:
.span_100 {
width: 100 px;
}
.span_99 {
width: 99 px;
}
.span_98 {
width: 98 px;
}
.span_97 {
width: 97 px;
}
.span_96 {
width: 96 px;
}
.span_95 {
width: 95 px;
}
and e.t.c.