Skip to content

Make progress animation respect $enable-transitions and prefers-reduced-motion media query#27986

Merged
patrickhlauke merged 5 commits intov4-devfrom
v4-dev-martijncuppens-progress-transition
Jan 15, 2019
Merged

Make progress animation respect $enable-transitions and prefers-reduced-motion media query#27986
patrickhlauke merged 5 commits intov4-devfrom
v4-dev-martijncuppens-progress-transition

Conversation

@MartijnCuppens
Copy link
Copy Markdown
Member

Fixes #25709

Prevent progress animation if transitions are disabled or reduce motion is enabled.
If $enable-transitions is false:

  • @keyframes progress-bar-stripes and .progress-bar-animated are not rendered.

If reduced motion is enabled:

  • The animation is disabled thanks to animation: none;

@MartijnCuppens
Copy link
Copy Markdown
Member Author

The carousel fade was already fixed in a previous change to the carousel. Also, the .fade issue mentioned in #25709 seemed to be ok.

Copy link
Copy Markdown
Collaborator

@andresgalante andresgalante left a comment

Choose a reason for hiding this comment

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

Do you think it's worth making the prefer reduce motion media querie global, somethink like:

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

@MartijnCuppens
Copy link
Copy Markdown
Member Author

Thought about that Andres, but this will override all transitions everywhere and that could lead to unexpected behaviour on custom code or css plugins. The animation is something we can't do because the spinners would freeze.

@MartijnCuppens
Copy link
Copy Markdown
Member Author

@patrickhlauke, can you have a look if this looks fine to you?

@patrickhlauke
Copy link
Copy Markdown
Member

in principle this looks fine. i'd note that reduced motion is primarily about stuff that can cause trouble (read: feelings of nausea etc) to users with vestibular disorders, so mainly animated scrolling effect, accordion-type panels that animate open/close, etc. i'm sure that some folks will argue that progress bar animations are fine and could be left on even when the preference is set...but i'd say let's put a stake in the ground and go with this, we can always selectively reenable it later.

@patrickhlauke patrickhlauke changed the title Prevent progress animation Make progress animation respect $enable-transitions and prefers-reduced-motion media query Jan 15, 2019
@patrickhlauke patrickhlauke merged commit f1f740b into v4-dev Jan 15, 2019
@mdo mdo mentioned this pull request Jan 15, 2019
@MartijnCuppens MartijnCuppens deleted the v4-dev-martijncuppens-progress-transition branch January 15, 2019 07:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants