Compositor First
Animates opacity and individual transforms.
Compositor-friendly animations, discrete top-layer transitions, view transitions, scroll-driven animations, and accessible reduced-motion controls.
allow-discrete & @starting-style)
Animate top-layer elements ([popover] and
<dialog>) on and off screen using
transition-behavior: allow-discrete,
@starting-style, overlay, and
clip-path.
This popover animates opacity, translate,
clip-path, display, and
overlay.
Switch between grid and list layouts using
document.startViewTransition() and individual transform
properties.
Animates opacity and individual transforms.
Smoothly enters and exits the top layer.
Dampens heavy spin and movement when requested.
mask-image Fade
Scroll the container below to drive the progress bar on the compositor
thread via animation-timeline: scroll().
1. Scroll-Driven Animations: Bind animation
progress directly to a scroll container using
scroll-timeline-name and
animation-timeline without JavaScript scroll
listeners.
2. Compositor Performance: Animating
scale on the progress bar ensures the scroll
indicator runs entirely on the compositor thread.
3. Soft Edge Masking: Using
mask-image with a linear gradient softens the top and
bottom edges as content scrolls underneath.
4. Timeline Scope: Lifting the timeline with
timeline-scope: --box-scroll on the wrapper lets a
sibling element track the scroller's progress.
5. Discrete Transitions: Combine
transition-behavior: allow-discrete and
@starting-style to animate elements to and from
display: none.
6. Top Layer Overlay: Include
overlay in the transition list so
<dialog> and [popover] elements
remain in the top layer until their exit transition completes.
7. End of Scroll Area: The progress indicator above reaches 100% when you reach this final item.
Persistent animations provide an explicit pause control and nest
@media (prefers-reduced-motion: reduce) rules on a
case-by-case basis instead of a global 0.01ms duration
hack.