Performance: @for loop (through vs to)
MEDIUM IMPACT
This affects CSS preprocessing time and the size of the generated CSS file, impacting page load speed.
@for $i from 1 to 10 { .item-#{$i} { width: 10px * $i; } }
@for $i from 1 through 10 { .item-#{$i} { width: 10px * $i; } }
| Pattern | DOM Operations | Reflows | Paint Cost | Verdict |
|---|---|---|---|---|
| @for ... through (1 through 10) | 0 (CSS only) | 0 | Low | [!] OK |
| @for ... to (1 to 10) | 0 (CSS only) | 0 | Lower | [OK] Good |