Overview
Halo glows that follow an SVG shape’s actual alpha silhouette — not the bounding rectangle — via stacked filter: drop-shadow() chains. box-shadow is rectangular by definition and cannot wrap a non-rectangular shape; drop-shadow runs on the alpha channel and gets the silhouette right.
When to use it
Reach for shape-aware halos on logo glow, icon focus affordances, and any decorative SVG that needs a contoured glow. Skip it on rectangular surfaces — box-shadow is cheaper there. Stack at most three drop-shadow layers; each layer is a separate rasterization pass and the budget compounds quickly on Retina.
How it works
Apply a chained filter: filter: drop-shadow(0 0 8px var(--accent)) drop-shadow(0 0 24px var(--accent)). Each drop-shadow() reads the element’s alpha channel and renders a blurred copy offset by the x/y values with the given blur radius and color — unlike box-shadow, which draws a rectangular shadow regardless of the visual silhouette. For irregular SVG shapes the difference is dramatic: drop-shadow wraps the actual outline; box-shadow draws around the bounding box. Stack two or three layers with progressively wider blur radii to build up a soft halo while keeping the tight inner ring crisp.
Production gotchas
Each drop-shadow layer in the chain is a separate rasterization pass — budget compounds quickly. Cap at three layers and keep the widest blur under ~30px on retina. Drop-shadow does not promote to its own compositor layer like box-shadow does, so animating the element underneath the filter triggers full repaints. If you need to animate the halo color, animate a CSS custom property the filter reads — do not animate the filter string itself, which forces re-parsing every frame. Watch for clipping by overflow: hidden ancestors that strip the halo edges.
Accessibility
The halo is purely decorative — do not rely on its presence to communicate state. Pair with an explicit text label or icon for any meaning. Under prefers-reduced-motion: reduce if the halo breathes or pulses, pin it at rest opacity. Verify the halo color does not reduce contrast of nearby content when the glow extends past the element bounds.
References
Implementation depth
drop-shadow follows the alpha silhouette, which is why it works for moons, leaves, and icons where box-shadow would only draw a rectangle. Stack smaller shadows before larger halos to keep the edge readable.
Every extra drop-shadow is another rasterization pass. Use the fewest layers that communicate focus or glow, and check high-contrast modes where decorative halo color may disappear or need a clearer outline.