Performance: RGBA and opacity manipulation
MEDIUM IMPACT
This affects the paint and composite stages of rendering, influencing how quickly colors and transparency are drawn on the screen.
$color: rgba(0, 0, 0, 0.5); .container { background-color: $color; }
$color: rgba(0, 0, 0, 0.5); .container { background-color: black; opacity: 0.5; }
| Pattern | DOM Operations | Reflows | Paint Cost | Verdict |
|---|---|---|---|---|
| Opacity on container | None | 0 | High (repaints all children) | [X] Bad |
| RGBA background color | None | 0 | Low (paints only background) | [OK] Good |