-
Notifications
You must be signed in to change notification settings - Fork 356
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[FEAT] Add support for prefers-reduced-motion in components to enhance accessibility #17
Comments
Good idea, will look into adding it to all the components very soon |
Hi David! Have you already started? |
@PedroMarianoAlmeida no, haven't had time for this, but it's going to be tricky since no two components are the same, each component will require a unique solution unfortunately |
Ok then! I will choose one and try it... maybe this can be done one component at a time, in different MR... but we need to keep track of where it is concluded. Can we use this Issue for that? (a checkbox with the name of the components) |
What do you think about this solution? (asking before implementing in other components and creating the MR): Why did I decide not to use the Media query CSS? The I believe that the methodology will be easier replicated to other components because I didn't touch the original component... I created a wrapper to check if it is animated (but each "static component" will be different) |
@PedroMarianoAlmeida Sorry, no, this is not a good solution, we definitely don't want to add another layer over the components or complexity like that in the code. Stopping animations should be an individual solution per component, and it should be done through a prop on the component and set to the prefers-reduced-motion media query by default. Don't worry about it, I will handle it. Thanks! |
Description
The
prefers-reduced-motion
CSS media feature detects if a user has enabled a device setting to minimize non-essential motion. This setting signals the browser that the user prefers an interface that reduces, removes, or replaces motion-based animations.Motion-heavy animations, such as scaling or panning large objects, can cause discomfort for individuals with vestibular motion disorders, making this an important accessibility feature.
Proposal
In client components, detect if the user prefers reduced motion using CSS or JavaScript with a Media Query.
For example:
Whenever animations are used, they should be disabled or replaced when the
prefers-reduced-motion
setting is detected.Acceptance Criteria
The text was updated successfully, but these errors were encountered: