Performance: CSS calc usage
MEDIUM IMPACT
CSS calc affects the browser's style calculation and layout stages, impacting rendering speed especially when used extensively or in complex expressions.
width: calc(100% - 80px); /* combined fixed values */
width: calc(100% - 50px - 20px - 10px);
| Pattern | DOM Operations | Reflows | Paint Cost | Verdict |
|---|---|---|---|---|
| Complex nested calc expressions | No extra DOM nodes | Multiple reflows if recalculated often | Moderate paint cost | [X] Bad |
| Simple single calc expression | No extra DOM nodes | Single reflow | Low paint cost | [OK] Good |