Answer the question
In order to leave comments, you need to log in
Is it possible to count the number of elements in less??
My task is to count the number of elements in a row and position the elements using less. Let's say I have 12 elements. I need to find out the number and write it down in (@count). I had a couple of ideas. For example, use attributes (let's say data). But also did not find how to pass the attribute.
Code for positioning:
.position(@index, @count) {
@size: 100px;
@distance: 0.3;
@min: 10deg;
@max: 180deg - @min;
@step: (180deg - @min * 2)/(@count - 1);
@i: @count - @index;
left: @size * cos(@step*@[email protected]) * @distance;
top: @size * sin(@step*@[email protected]) * @distance;
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question