Performance: Variable interpolation with #{}
LOW IMPACT
This affects CSS generation time and the final CSS file size, impacting page load speed.
$state: active; .button-#{$state} { color: red; } .button-#{$state}:hover { color: blue; }
$state: active; .button-#{$state} { color: red; } .button-#{$state}:hover { color: blue; }
| Pattern | DOM Operations | Reflows | Paint Cost | Verdict |
|---|---|---|---|---|
| Excessive interpolation generating many selectors | No direct DOM impact | No reflows | Higher paint cost due to complex styles | [X] Bad |
| Minimal interpolation with pseudo-classes | No direct DOM impact | No reflows | Lower paint cost with simpler styles | [OK] Good |