Allow design tokens to turn off motion durations when prefers-reduced-motion is set
Categories
(Toolkit :: Themes, enhancement)
Tracking
()
People
(Reporter: nsharpley, Unassigned)
References
Details
Motion duration tokens such as --toolbarbutton-motion-duration-press, --panel-motion-duration-enter and --sidebar-motion-duration-enter have the same value whatever the user's motion preference. Each consumer has to wrap its transitions in @media (prefers-reduced-motion: no-preference) itself, so the preference is easy to miss and is handled differently from one surface to the next.
The token JSON has keys for the color scheme, the native theme, Nova, prefersContrast and forcedColors, but none for reduced motion. Adding one (e.g. prefersReducedMotion) and a matching layer in the generated sheets would let a motion token set its duration to 0s under prefers-reduced-motion: reduce, so consumers could drop their own media query wrappers.
Things to decide:
- whether every motion duration should drop to
0s, or only those for movement and scaling, since a color fade such as a hover background transition is not usually treated as motion; - where the new layer sits in the token cascade.
This came up in the review of bug 2084655, where the toolbar button press scale is gated with a media query in the consumer sheets.
Comment 1•6 days ago
|
||
(In reply to Nikki Sharpley (:nikkis) (she/her) from comment #0)
Things to decide:
- whether every motion duration should drop to
0s, or only those for movement and scaling, since a color fade such as a hover background transition is not usually treated as motion;
See bug 1971509. We probably do want to cover fading transitions at least on Windows.
Description
•