I have code that creates a grid. To automate this, I use a loop. The problem is that the data in the loop and the data without the loop are different. What could be the matter?
$grid-spacing: 3%; $per: 12, 6, 4, 3, 2.4, 2, 1.714285714285714, 1.5, 1.333333333333333, 1.2, 1.0909090; $i: 11; @while $i > 0 { .col-#{$i}{ float: left; width: ((100% / nth($per,$i)) - ( $grid-spacing * $i / 12 )); } $i: $i - 1; } and that I get
width: 8.08333%; (для первого значения) and if I write for example
.col-1 { width:(100% / 12) - ($grid-spacing * 11 / 12); } then get
width: 5.58333%;