Performance: @while loop usage
MEDIUM IMPACT
This affects CSS generation time and final CSS file size, impacting page load speed and render time.
.item { @for $i from 1 through 100 { &-#{$i} { width: 10px * $i; } } }
$i: 1; @while $i <= 100 { .item-#{$i} { width: 10px * $i; } $i: $i + 1; }
| Pattern | DOM Operations | Reflows | Paint Cost | Verdict |
|---|---|---|---|---|
| @while loop generating many classes | None (CSS only) | None | High due to large CSS size | [X] Bad |
| @for loop with grouped selectors | None (CSS only) | None | Lower due to smaller CSS size | [OK] Good |