Orange-Boosted-Bootstrap icon indicating copy to clipboard operation
Orange-Boosted-Bootstrap copied to clipboard

[OUDS] Deactivate animations for accessibility

Open hannahiss opened this issue 7 months ago • 3 comments

Prerequisites

Proposal

It could be something like:

@media (prefers-reduced-motion) {
  .my-animated-component {
    animation: none;
  }
}

Motivation and context

Some animations can be disturbing or even triggering for some users, and that's why browsers provide ways to turn off animations. To ensure the animations in OUDS respect these settings, we need to make use of the prefers-reduced-motion CSS feature to detect the user settings and carry out appropriate actions.

hannahiss avatar May 06 '25 08:05 hannahiss

Maybe we could have a mixin like for transitions that automatically adds the media query?

MaxLardenois avatar Jun 10 '25 09:06 MaxLardenois

So I investigated a little, we have animations on : OUDS Button, OUDS Switch, Spinners, Progress bars and Carousel. At the moment only spinners and OUDS buttons do not have the media query prefers-reduced-motion optout in place for their animation. We can add it on the Button (and maybe Spinners but I do not know if it will be like the Bootstrap one in OUDS), but I think there is a usability issue as a not animated spinner will be very strange and look like a stuck UI. I think it might come as an exception as stated in Note 4 here: https://www.w3.org/WAI/WCAG21/Understanding/pause-stop-hide.html

MaxLardenois avatar Jun 12 '25 14:06 MaxLardenois

So I investigated a little, we have animations on : OUDS Button, OUDS Switch, Spinners, Progress bars and Carousel. At the moment only spinners and OUDS buttons do not have the media query prefers-reduced-motion optout in place for their animation. We can add it on the Button (and maybe Spinners but I do not know if it will be like the Bootstrap one in OUDS), but I think there is a usability issue as a not animated spinner will be very strange and look like a stuck UI. I think it might come as an exception as stated in Note 4 here: https://www.w3.org/WAI/WCAG21/Understanding/pause-stop-hide.html

@Aniort will look into it, let's circle back in a few weeks

MaxLardenois avatar Jun 13 '25 13:06 MaxLardenois