Add same-document view transitions progressively
8 steps · about 2 h 45 min · Intermediate
- Understand the snapshot transition model (guide, MDN Web Docs, 28 min)
Start with how the browser captures old and new states around a DOM update.
- Wrap one interface update (reference, MDN Web Docs, 24 min)
Pass the state-changing callback while keeping the ordinary update available as a fallback.
- Track the transition lifecycle (reference, MDN Web Docs, 18 min)
Use the returned object to observe capture, update and animation phases.
- Wait until snapshots are ready (reference, MDN Web Docs, 15 min)
Apply animation-time work only after the browser has created the transition pseudo-elements.
- Separate rendering completion from animation (reference, MDN Web Docs, 15 min)
Detect an update failure without confusing it with the visual transition finishing.
- Clean up after the animation (reference, MDN Web Docs, 15 min)
Run follow-up behavior only when the entire transition has ended or been skipped.
- Match named elements across states (reference, MDN Web Docs, 20 min)
Give persistent interface regions unique identities for independent snapshot animation.
- Build and test the progressive enhancement (guide, MDN Web Docs, 30 min)
Combine feature detection, custom pseudo-element styles and reduced-motion behavior in a complete example.