Performance: Min and max functions
MEDIUM IMPACT
Min and max functions affect layout calculation and can impact rendering speed when used extensively or with complex expressions.
width: min(100vw, 600px); /* width never exceeds 600px */
width: 100vw; /* always full viewport width, no limits */
| Pattern | DOM Operations | Reflows | Paint Cost | Verdict |
|---|---|---|---|---|
| Fixed width without min/max | Low | Multiple on resize | Medium | [X] Bad |
| Simple min() or max() usage | Low | Single on resize | Low | [OK] Good |
| Nested complex min/max | Medium | Multiple | Medium | [!] OK |