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

Making use of prefers-reduced-motion media query #25641

Merged
merged 12 commits into from
Mar 20, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .stylelintrc
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@
"no-descending-specificity": null,
"no-duplicate-selectors": true,
"number-leading-zero": "never",
"media-feature-name-no-unknown": [true, {
"ignoreMediaFeatureNames": ["prefers-reduced-motion"]
}],
"order/properties-order": [
"position",
"top",
Expand Down
4 changes: 4 additions & 0 deletions docs/4.0/getting-started/accessibility.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,10 @@ For visually hidden interactive controls, such as traditional "skip" links, `.sr
<a class="sr-only sr-only-focusable" href="#content">Skip to main content</a>
{% endhighlight %}

### Reduced motion

Bootstrap includes support for the [`prefers-reduced-motion` media feature](https://drafts.csswg.org/mediaqueries-5/#prefers-reduced-motion). In browsers/environments that allow the user to specify their preference for reduced motion, most CSS transition effects in Bootstrap (for instance, when a modal dialog is opened or closed) will be disabled. Currently, support is limited to Safari on macOS and iOS.

## Additional resources

- [Web Content Accessibility Guidelines (WCAG) 2.0](https://www.w3.org/TR/WCAG20/)
Expand Down
4 changes: 4 additions & 0 deletions scss/mixins/_transition.scss
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,8 @@
transition: $transition;
}
}

@media screen and (prefers-reduced-motion: reduce) {
transition: none;
}
}