Performance: Saturate and desaturate
LOW IMPACT
This affects the CSS paint time and rendering speed by changing color saturation dynamically.
$base-color: #3498db; $desat-color: desaturate($base-color, 50%); $sat-color: saturate($base-color, 30%); .element { background-color: $desat-color; color: $sat-color; }
$color: #3498db; .element { background-color: desaturate($color, 50%); color: saturate($color, 30%); }
| Pattern | DOM Operations | Reflows | Paint Cost | Verdict |
|---|---|---|---|---|
| Dynamic saturate/desaturate on many elements | Low | 0 | High (multiple paints) | [X] Bad |
| Precomputed saturate/desaturate colors in variables | Low | 0 | Low (single paint) | [OK] Good |