Performance: First SASS stylesheet
LOW IMPACT
This affects the CSS bundle size and the browser's style calculation and paint performance.
$primary-color: #3498db; .button { color: $primary-color; border: 1px solid $primary-color; } .link { color: $primary-color; }
$primary-color: #3498db; .button { color: #3498db; border: 1px solid #3498db; } .link { color: #3498db; }
| Pattern | DOM Operations | Reflows | Paint Cost | Verdict |
|---|---|---|---|---|
| Repeated raw colors in CSS | No extra DOM nodes | 0 reflows | Slightly higher paint cost due to larger CSS | [X] Bad |
| Using SASS variables for colors | No extra DOM nodes | 0 reflows | Lower paint cost due to smaller CSS | [OK] Good |