Answer the question
In order to leave comments, you need to log in
Operations inside a LESS loop?
Good night all! Faced a problem. Organized a cycle in which for col blocks, depending on their suffixes, the width in percent will be calculated.
@gridColNumber: 12;
.grid-loop(@i) when (@i > 0) {
[email protected]{i} {
width: ~"((100 * @{i}) / 12)%";
}
.grid-loop(@i - 1);
}
.grid-loop(@gridColNumber);
width: ~"((100 * @{i}) / 12)%";
does not give anything, if you write simply width: ~"@{i}%";
, then it will calculate this simple expression. And when writing:<section class="row-fluid">
<div class="col-4"></div>
<div class="col-4"></div>
<div class="col-4"></div>
</section>
((100 * @{i}) / 12)%
, and this is 33.33333% 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