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

Slow down spinners when prefers-reduced-motion: reduce #31882

Merged
merged 6 commits into from Oct 19, 2020

Conversation

ffoodd
Copy link
Member

@ffoodd ffoodd commented Oct 13, 2020

Very simple enhancement to slow down spinners when reduced motion are requested.
Somehow relates to #30081 — deeper thinking:

  • pausing the animation could be misunderstood as failing to load content;
  • impossible to know how long the animation would be, no way to determine if we're above some WCAG threshold for animations durations and cycles.

So this PR basically just ensure to slow down animation, thus prevents flashing colors (most probably with growing spinners, but hey, who knows).

As usual, feel free to discard this if it's over-engineered in any way.

Preview: https://deploy-preview-31882--twbs-bootstrap.netlify.app/docs/5.0/components/spinners/

Copy link
Member

@mdo mdo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Love this!

@XhmikosR
Copy link
Member

I'd like to hear @patrickhlauke's take on this :)

@patrickhlauke
Copy link
Member

patrickhlauke commented Oct 14, 2020

my take is: sure, why not :)

(and to expand, there really isn't any hard actual definition of motion that always causes problems - some user groups will feel dizzy/triggered by obvious large parallax-style animations, but it's debatable if a small contained little animation is also bad for them. WCAG itself doesn't define any threshold, and it only counts as a potential failure if it's as a result of interaction - hovering, scrolling, etc https://www.w3.org/TR/WCAG22/#animation-from-interactions )

@XhmikosR
Copy link
Member

I'm all for a11y, but I'm afraid this will cause more issues similar to "My animations are not working".

Just thinking out loud here. :)

@ffoodd
Copy link
Member Author

ffoodd commented Oct 14, 2020

@XhmikosR That's why I only slow it down instead of dropping it :D ← BTW, this is what we currently do for transitions, dropping it all the way instead of slowing them down (which I consider more debatable).

@XhmikosR
Copy link
Member

I'd say we definitely need a callout mentioning this behavior and the reasons behind it then :)

@patrickhlauke
Copy link
Member

yes, callout in the same vein as the ones we already have pointing to the accessibility section about this

@ffoodd
Copy link
Member Author

ffoodd commented Oct 15, 2020

Added our prefers-reduced-motion callout in spinners page, and mentionned slowing down alongside disabling in our accessibility page. Seems the best approach to me, but I may be wrong. @patrickhlauke, may I have your opinion?

v5.0.0-alpha3 automation moved this from Inbox to Review Oct 15, 2020
v5.0.0-alpha3 automation moved this from Review to Approved Oct 18, 2020
@XhmikosR XhmikosR merged commit ece40bc into main Oct 19, 2020
v5.0.0-alpha3 automation moved this from Approved to Shipped Oct 19, 2020
@XhmikosR XhmikosR deleted the main-fod-slower-spinners branch October 19, 2020 08:42
@XhmikosR
Copy link
Member

Crap, forgot we should mention this in the migration page. @ffoodd see if you can tackle this later please :)

@XhmikosR XhmikosR added this to Inbox in v4.6.0 via automation Oct 19, 2020
ffoodd added a commit that referenced this pull request Oct 19, 2020
* feature(spinners): slow down spinners when prefers-reduced-motion

* docs(spinners): add reduced motion callout and mention slowing down in accessibility page

* Update spinners.md

* docs(accessibility): rewording

Co-authored-by: XhmikosR <xhmikosr@gmail.com>
Co-authored-by: Patrick H. Lauke <redux@splintered.co.uk>
@XhmikosR XhmikosR added the v4 label Oct 19, 2020
XhmikosR added a commit that referenced this pull request Oct 20, 2020
* feature(spinners): slow down spinners when prefers-reduced-motion

* docs(spinners): add reduced motion callout and mention slowing down in accessibility page

* Update spinners.md

* docs(accessibility): rewording

Co-authored-by: XhmikosR <xhmikosr@gmail.com>
Co-authored-by: Patrick H. Lauke <redux@splintered.co.uk>
@thany
Copy link

thany commented Oct 20, 2020

If people are really suffering from smallish animations, reducing their speed isn't going to help them. They need animations to stop completely. Instead of a loading animation, a static hourglass is good.

Firefox does this as well instead of the loading icon on a tab:
https://www.mozilla.org/en-US/firefox/80.0/releasenotes/

@patrickhlauke
Copy link
Member

no, it's not necessarily so clear cut and binary - and indeed, it varies for each user. users generally aren't affected by everything that animated, but specific types of animations that can be distracting (for users with cognitive and attention issues) or can trigger users with vestibular disorders (large motion, parallax effects, scroll-bound effects) or epylepsy (fast changes in contrast / flickering / strobing, movements of strong patterns) etc.

long story short, slowing small animations down is a valid approach.

@XhmikosR XhmikosR moved this from Inbox to Cherry-picked/Manually backported in v4.6.0 Oct 22, 2020
XhmikosR added a commit that referenced this pull request Oct 22, 2020
* feature(spinners): slow down spinners when prefers-reduced-motion

* docs(spinners): add reduced motion callout and mention slowing down in accessibility page

* Update spinners.md

* docs(accessibility): rewording

Co-authored-by: XhmikosR <xhmikosr@gmail.com>
Co-authored-by: Patrick H. Lauke <redux@splintered.co.uk>
XhmikosR added a commit that referenced this pull request Oct 27, 2020
* feature(spinners): slow down spinners when prefers-reduced-motion

* docs(spinners): add reduced motion callout and mention slowing down in accessibility page

* Update spinners.md

* docs(accessibility): rewording

Co-authored-by: XhmikosR <xhmikosr@gmail.com>
Co-authored-by: Patrick H. Lauke <redux@splintered.co.uk>
XhmikosR added a commit that referenced this pull request Oct 27, 2020
* feature(spinners): slow down spinners when prefers-reduced-motion

* docs(spinners): add reduced motion callout and mention slowing down in accessibility page

* Update spinners.md

* docs(accessibility): rewording

Co-authored-by: XhmikosR <xhmikosr@gmail.com>
Co-authored-by: Patrick H. Lauke <redux@splintered.co.uk>
@XhmikosR XhmikosR moved this from Cherry-picked/Manually backported to Shipped in v4.6.0 Oct 27, 2020
@thany
Copy link

thany commented Nov 11, 2020

@patrickhlauke If people indicate they suffer from motion, you have to assume the worst condition. That's the only way to alleviate the problem for everyone who suffers from motion on their screens.

The term "prefers-reduced-motion" must not be taken literally.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
No open projects
v4.6.0
Shipped
v5.0.0-alpha3
  
Shipped
Development

Successfully merging this pull request may close these issues.

None yet

5 participants