Performance: Why backgrounds enhance design
MEDIUM IMPACT
Backgrounds affect page load speed and rendering performance by adding image assets and paint complexity.
<div class="bg-[url('/small-optimized-image.webp')] bg-cover bg-center"></div><div class="bg-[url('/large-unoptimized-image.jpg')] bg-cover bg-center"></div>| Pattern | DOM Operations | Reflows | Paint Cost | Verdict |
|---|---|---|---|---|
| Large unoptimized background image | Minimal | 0 | High (delays paint) | [X] Bad |
| Optimized background image | Minimal | 0 | Medium (faster paint) | [!] OK |
| Complex CSS gradient | Minimal | 0 | Medium-High (multiple paint layers) | [!] OK |
| Simple CSS gradient | Minimal | 0 | Low (fewer paint layers) | [OK] Good |
| Background color only | Minimal | 0 | Very Low (instant paint) | [OK] Good |