M
M
monnarxx2014-09-01 11:36:18
Less
monnarxx, 2014-09-01 11:36:18

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; 
}

p.s. I've been using less recently.

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question