Overview
Typed gradient interpolation keeps the gradient string stable and animates its numeric internals. CSS custom properties are normally string-like unless the browser knows their syntax. Registering angle, hue, stop, or percentage values with @property lets the browser interpolate the underlying numbers continuously.
When to use it
Use it when the animation needs to teach or expose how gradients change internally: angle turns, hue rotation, stop travel, or a controlled color sweep inside a stable surface. It is a good fit for technical demos, premium cards, and small branded surfaces. For a simple moving stripe, background-position is usually simpler and more predictable.
How it works
@property defines syntax such as <angle>, <number>, or <percentage>, plus inheritance and an initial value. The gradient references those variables, and keyframes change only the registered values so the browser can tween them rather than discrete-step the declaration.
Production gotchas
Always include a static fallback before the registered-property version. Browser support, cascade order, and initial values all matter here; a missing registration can turn a smooth interpolation into a jump. If the inspector exposes hue, angle, or stop controls, every control must visibly change the gradient; unused sliders should not ship.
Accessibility
Animated gradients can pass through low-contrast frames. Test text at the worst frame, not just the starting frame, and keep the animated area bounded so it does not compete with page reading. Reduced motion should freeze the safest readable frame rather than swapping to a different effect.
References
Implementation depth
This pattern is about animating gradient internals, not moving a gradient bitmap. Register angle, hue, and stop-position variables with @property so the browser can interpolate numeric pieces of the gradient continuously.
Unregistered custom properties often step discretely because the browser sees them as strings. Include a static fallback gradient, keep the animated area bounded, and verify the reduced-motion frame has enough contrast without depending on the sweep.
The implementation should make the typed value visible. Angle turns, hue shifts, and stop travel are different examples; changing only endpoint colors does not teach why @property matters.
Be conservative with inspector controls. Every exposed control needs to map to a registered variable or a real animation parameter, otherwise the snippet becomes misleading for users trying to copy the technique.