Performance: Future CSS features replacing SASS
MEDIUM IMPACT
This affects page load speed by reducing CSS preprocessing time and bundle size, improving rendering speed.
:root {
--primary-color: #3498db;
}
.button {
color: var(--primary-color);
}
.button .icon {
margin-right: 0.5rem;
}$primary-color: #3498db; .button { color: $primary-color; .icon { margin-right: 0.5rem; } }
| Pattern | DOM Operations | Reflows | Paint Cost | Verdict |
|---|---|---|---|---|
| SASS nested selectors | No change | No change | Higher due to larger CSS | [X] Bad |
| Native CSS variables and flat selectors | No change | No change | Lower due to smaller CSS | [OK] Good |