Performance: Variable declaration with $
LOW IMPACT
This affects CSS compilation speed and final CSS file size, impacting page load speed.
$primary-color: #3498db; .button { background-color: $primary-color; border: 1px solid $primary-color; }
$primary-color: #3498db; .button { background-color: #3498db; border: 1px solid #3498db; }
| Pattern | DOM Operations | Reflows | Paint Cost | Verdict |
|---|---|---|---|---|
| Using repeated color literals | 0 | 0 | Slightly higher due to larger CSS | [X] Bad |
| Using $ variables for colors | 0 | 0 | Smaller CSS size, no runtime cost | [OK] Good |