Answer the question
In order to leave comments, you need to log in
How to calculate the sum of all values in a loop?
For example:
@for $i from 1 through 10
$number: 121px * $i
.box-#{$i}
-width: $number
Answer the question
In order to leave comments, you need to log in
Arithmetic progression, they should have been talking about it at school.
on scss:
$count: 10;
$baseWidth: 121px;
$sum: ($baseWidth + $baseWidth * $count) / 2 * $count;
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question