Repository navigation
fix(ui): respect prefers-reduced-motion in Dialog and Toast - #864
Merged
pasqualevitiello merged 1 commit intoOct 15, 2026
Merged
Conversation
With reduced motion on, Dialog and Toast still played their full enter/exit movement. Under prefers-reduced-motion: reduce they now keep their fades and drop the movement. The Toast shake guard moves into the component so it ships with the registry item; previously it lived only in packages/ui globals.css. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01CSAAqwUKTFSvgnbcPTL3Pp
|
The latest updates on your projects. Learn more about Vercel for GitHub. 1 Skipped Deployment
|
|
@westernCasa is attempting to deploy a commit to the cal Team on Vercel. A member of the Team first needs to authorize it. |
This branch was previously deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What happens today
With
prefers-reduced-motion: reduceset, Dialog and Toast play the same enter and exit motion as with it off:bottomStickOnMobileis on by default), over 200 ms.There is a reduced-motion rule in
packages/ui/src/styles/globals.cssthat stops Toast's update shake. It is not part of thetoastregistry item, so projects that install Toast from the registry don't get it.What this changes
Under reduced motion, both components keep their fades and drop their movement. With reduced motion off, nothing changes.
motion-safe.motion-reduce:transition-opacitystops the nested-dialog scale from animating.motion-safe. Undermotion-reducethe transition list dropstransform, and the toast fades in instead of sliding (motion-reduce:data-starting-style:opacity-0). The anchored toast's scale also only applies undermotion-safe.motion-reduce:animate-noneis added inupsertReplayClassName, so the guard ships with the component. The rule inglobals.cssis left in place.I kept the fades rather than turning transitions off. A fade still tells you something appeared or went away; reduced motion is about movement, so movement is what's removed.
Measured
Measured in Chromium at 1280×800 and 390×844, with reduced motion off and on, reading every running transition from
document.getAnimations(). The harness also records where each element sits on every frame while it's visible."Moves while visible" checks whether the element's translate, scale or transform differs from its resting position on any frame where it can be seen. Every other primitive, and both components with reduced motion off, measured identical before and after.
Toast shake, with the
globals.cssreduced-motion block removed (what a registry install has):Harness, if you want to rerun it: https://github.com/westernCasa/coss-motion-audit
Not in this PR
globals.cssis now redundant but left alone.Checks
bun run format:all,registry:validate-deps,registry:build,ui:syncandtypecheck, all fromapps/ui. All pass.🤖 Generated with Claude Code
https://claude.ai/code/session_01CSAAqwUKTFSvgnbcPTL3Pp