Reduce-motion accessibility support for CSS animation library#7968
Reduce-motion accessibility support for CSS animation library#7968KingYes merged 3 commits intoelementor:release/2.6.0from
Conversation
|
For some reason some older commits are showing up here - anyway the commit related to this PR is 2f5193e |
kobizz
left a comment
There was a problem hiding this comment.
Approved to be merged. Mind the redundant empty line at 3.
|
Thanks! |
|
No problem happy to help |
|
Please check this issue for the people started to having issues after this PR: |
|
We need ability to switch this setting on or off. it should not be forced by code. |
|
Hi friends, I found the solution for most of the cases. Go to Edit Plugins, Elementor, CSS, frontend.min.css and then find this: ” @media (prefers-reduced-motion:reduce){.animated{-webkit-animation:none;animation:none}} ” And then just delete that line, cause that is for “users who experience motion sickness / vertigo” So from nowon in every single browser your entrance animations will work. Because I saw people giving the solution to change the settings in Accesibility from Windows in reactivating the “desactivate all the unnecessary animations (when it’s possible)”, and that solution will ONLY work for your computer and no for the rest. Thanks! You can visit my website juliomorri.com |
|
Hello guys, |
|
@juliomorri thanks for the tip, it's working Does anyone knows how to "unset" these settings with css or a hook..... |
PR Checklist
PR Type
What kind of change does this PR introduce?
Summary
This PR can be summarized in the following changelog entry:
Description
An explanation of what is done in this PR
A new media query selector has been introduced to allow users who suffer motion sickness / vertigo to disable UI animations (via System settings). The media query allows website developers to extend this preference into their site design, providing an option to disable excessive or non-critical animation to users who desire it.
Having this option built into Elementor will be a great benefit to accessibility compliance, and give each website visitor greater control over their individual experience.
For Elementor, I have proposed using the media query selector on the CSS provided by the animate.css library. I have targeted the .animated class to cover as many animated elements as possible (eg entrance animations & popup animations). The code disables animation for anyone with "reduce motion" set in their system settings, but will default to normal behaviour for users who don't toggle this option, or explicitly set it to enable animation.
Reduce-motion currently has support on macOS / iOS / Android + Chrome & Safari, however it is expected to be adopted by more platforms and browsers in the future.
More information:
https://css-tricks.com/introduction-reduced-motion-media-query/
https://developers.google.com/web/updates/2019/03/prefers-reduced-motion
https://drafts.csswg.org/mediaqueries-5/#prefers-reduced-motion
Code changes tested against release/v2.5.14 branch
Test instructions
This PR can be tested by following these steps:
Quality assurance
Fixes #