Reduced motion fix 2 - #288
Open
ameerf-wix wants to merge 13 commits into
Open
Conversation
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.
Description
Reduced motion: detect and enforce prefers-reduced-motion by default
Interact.forceReducedMotion was a plain boolean = false that nothing ever set from the OS preference — and even when set to true,
it was bypassed for any effect whose CSS had been pre-generated, which is the setup the docs recommend. So on a machine with
"reduce motion" on, every animation played at full strength, and five documentation sites said otherwise.
Runtime
Single source of truth; all seven add.ts call sites read it. false under SSR/JSDOM.
motion on, false forces motion on.
@media (prefers-reduced-motion: reduce)rules alongside the base ones, soit holds with JS disabled, under SSR, and across a mid-session preference change with no JS at all.
and drop the tween; viewProgress and pointerMove are cancelled. Nothing is suppressed by name, so a collapsed entrance still
completes its data-interact-enter handshake and can never be stranded behind its own FOUC hiding rule.
its neighbours on the same target.
alternative is expressed.
Previously conditions: ['desktop'] on an entrance left the element permanently hidden on mobile. Pre-existing, not
reduced-motion-specific.
byte-identical to master.
Validation
(prefers-reduced-motion: reduce) can never run. A no-preference gate is not reported: redundant, not dead.
Docs
rules/viewprogress.md and rules/pointermove.md; ## Static Properties in docs/api/interact-class.md.
recommended global !important animation reset.
with per-location edits under §3.13, §3.14, M8, §5.6 and §11.
Notes for reviewers
with Interact.forceReducedMotion = false before Interact.create().
false changes meaning. Zero internal readers.