Performance: Drop shadow on irregular shapes
MEDIUM IMPACT
This affects the browser's paint and composite stages, impacting rendering speed and smoothness.
<svg class="shadow-lg" aria-hidden="true" focusable="false" viewBox="0 0 100 100"><defs><filter id="shadow" x="-20%" y="-20%" width="140%" height="140%"><feDropShadow dx="0" dy="2" stdDeviation="3" flood-color="#000" flood-opacity="0.3"/></filter></defs><path d="M50 0 L100 50 L50 100 L0 50 Z" fill="white" filter="url(#shadow)"/></svg>
<div class="shadow-lg rounded-full" style="clip-path: polygon(50% 0%, 100% 50%, 50% 100%, 0% 50%)"></div>
| Pattern | DOM Operations | Reflows | Paint Cost | Verdict |
|---|---|---|---|---|
| CSS clip-path with drop-shadow | Low (1 element) | Low (no layout change) | High (complex paint) | [X] Bad |
| SVG with feDropShadow filter | Low (1 SVG element) | Low (no layout change) | Medium (GPU accelerated paint) | [OK] Good |