Performance: Why output optimization matters
HIGH IMPACT
Output optimization affects how quickly CSS loads and applies styles, impacting page load speed and rendering performance.
$primary-color: #0055ff; .button { color: $primary-color; &--primary { background-color: $primary-color; } } // Output is minimal and focused
$colors: (primary: #0055ff, secondary: #ff5500); .button { color: map-get($colors, primary); @each $name, $color in $colors { &--#{$name} { background-color: $color; } } } // This generates repeated selectors and unused styles
| Pattern | DOM Operations | Reflows | Paint Cost | Verdict |
|---|---|---|---|---|
| Bloated Sass output with redundant selectors | N/A | N/A | High due to large CSS | [X] Bad |
| Optimized Sass output with minimal selectors | N/A | N/A | Low due to small CSS | [OK] Good |