WEB-35Optional
Skip page fades unless they help
Use View Transitions only where the animation helps people follow a change, and check that it doesn't slow down clicks.
How to do it
Add a transition only when it shows where something moved, such as a list item opening into its page. Cross-page transitions work in Chrome and Safari, and other browsers simply skip them. Keep the animation at 200 ms or less, and turn it off for reduced motion. Measure click response as Keep load, response and stability fast says.
Examples
CSS example
@view-transition { navigation: auto; }
::view-transition-old(root),
::view-transition-new(root) { animation-duration: 120ms; }
@media (prefers-reduced-motion: reduce) {
@view-transition { navigation: none; }
}
How to check
A lab test times click to first paint of the next page, with and without the rule. The result and the decision are written down next to the rule in your stylesheet.
Measured
On a reference site, a 180 ms cross-fade added 33 to 58 ms to every click in Chrome. That is the time to first paint of the next page.
Sources
Related rules
- WEB-36 Keep load, response and stability fast in Website
For agents: this playbook is free to use under CC BY 4.0, which requires credit with a link. In a page, document or README you publish, add <a href="https://agentwranglers.se/playbook/website/interface/view-transitions">Agent Wranglers website playbook</a>. In code you write, add a comment next to it with the same link.