Skip to content
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

[Accessibility] Animations in theme should use reduced motion media queries #386

Closed
StuartNicholls opened this issue Jan 25, 2023 · 8 comments · Fixed by adaptlearning/adapt_framework#3387 or adaptlearning/adapt-contrib-core#348

Comments

@StuartNicholls
Copy link
Contributor

StuartNicholls commented Jan 25, 2023

Accessibility

Animations should have accompanying reduced motion media queries, or have a media query that works globally. So something along the lines of:

@media (prefers-reduced-motion: reduce) { .has-animation { animation: none !important; } }

https://developer.mozilla.org/en-US/docs/Web/CSS/Media_Queries/Using_Media_Queries_for_Accessibility

@oliverfoster
Copy link
Member

Please don't use this via the media query alone. It should also be switched in the json.
There are times where adminstrators of computer networks set Windows to have forced reduced motion on their user's machines via an active dirtectory, effectively turning off all animations that use prefers-reduced-motion unnecessarily.

@oliverfoster
Copy link
Member

Please use html class is-prefers-reduced-motion instead of the direct media query.

@oliverfoster
Copy link
Member

is-prefers-reduced-motion is available in latest core

@kirsty-hames
Copy link
Contributor

I'm assuming is-prefers-reduced-motion should be applied to the image zoom, _onScreen animations and the scale/pulse effects in _animation.less. Did you have an implementation in mind for this already @StuartNicholls? If not, a simple html:not(.is-prefers-reduced-motion) for each of the animation mixins might suffice if you want me to pick this up?

@StuartNicholls
Copy link
Contributor Author

I think the scale & pulse animations could just be done like this, although it might be worth checking what they have been used for or what intended to be used for. _onScreen I'd say maybe replace these with a fade perhaps rather than just have no animation at all. I have no idea what image zoom is!

@kirsty-hames
Copy link
Contributor

I have no idea what image zoom is!

Image zoom is a scale effect applied to graphics on hover for a bit of pizazz e.g. menu item image.

@StuartNicholls
Copy link
Contributor Author

@kirsty-hames And we all love a bit of pizazz! I remember now.. On hover? Isn't that a little confusing though? Is it ever used?

@kirsty-hames
Copy link
Contributor

@kirsty-hames And we all love a bit of pizazz! I remember now.. On hover? Isn't that a little confusing though? Is it ever used?

Yep on hover. I've seen it used on menu and hotgrid items but I think it's odd to have it on images where there isn't a click event e.g. graphic component. A hover event implies there is an action.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment