Overview
Native CSS wavy underline via text-decoration-style: wavy with animated text-decoration-thickness and text-underline-offset. No decorative SVG layer and no per-letter spans — just CSS text-decoration properties on the actual text node. Three motion programs: thickness breathe, thickness + offset peak pulse, hue-shift color sweep.
When to use it
Reach for wavy underlines on highlighted phrases, marketing callouts, and editorial emphasis — anywhere <em> needs visual amplification. Skip it on links (the wavy already means “spelling error” to most users) and on dense paragraph copy where the underline crowds adjacent lines.
How it works
Set text-decoration-line: underline + text-decoration-style: wavy on the element. Two animatable properties drive the motion: text-decoration-thickness (e.g. 1px to 3px) and text-underline-offset (e.g. 2px to 6px). A @keyframes rule animates either or both. For color sweeps animate text-decoration-color through a hue range. The wave geometry itself is fixed — you cannot animate the wave amplitude or frequency directly without falling back to an SVG underline overlay.
Production gotchas
Animating thickness past ~4px crowds the line below in dense paragraph copy — clamp the maximum thickness based on line-height. Browsers differ on whether text-decoration-thickness is interpolated smoothly (Chromium yes, Firefox yes as of recent versions, Safari sometimes snaps); accept that the breathe may be slightly less smooth in older Safari. Watch text-underline-offset on emoji or mixed-font lines — the offset is calculated per-glyph metric and can produce uneven underlines under those characters.
Accessibility
Native text-decoration underlines respect user underline-style preferences and forced-colors mode for free — one of the strongest reasons to use this over an SVG fake. Under prefers-reduced-motion: reduce drop the animation so the underline is static at its rest thickness. Wavy underlines on links can confuse users with spelling-check muscle memory — use a different decoration-style (solid, double) for actual links.
References