feat: implement global prefers-reduced-motion override #1390#1518
Merged
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.
Pull Request Summary
🚀 Overview
This PR implements native accessibility (a11y) handling for easemotion-css by introducing global support for the CSS @media (prefers-reduced-motion: reduce) media query. This ensures that users with vestibular disorders or motion sensitivities can safely browse sites using this library without triggering disorientation or vertigo.
🛠️ Changes Made
Implemented a zero-dependency, bulletproof CSS reset block inside the project's standardized submission tracking directory:
style.css: Added the core @media query block that intercepts system-level motion requests, instantly dropping transitions to 0s and safely fast-forwarding keyframe animations to their end state in 1ms (preserving any JavaScript animationend events).
demo.html: Created a high-intensity animation playground featuring a heavy bouncing/rotating box element to visually test the override.
README.md: Documented instructions on how to simulate and verify the reduced motion parameters via Browser DevTools.
📁 Submission Path
All files have been placed in the exact directory path requested by the automated workflow:
submissions/examples/prefers-reduced-motion/
🎯 Compliance
Aligns easemotion-css with WCAG 2.1 compliance guidelines, making the framework production-ready for corporate and enterprise open-source adoption.
Closes #1390