-
-
Notifications
You must be signed in to change notification settings - Fork 78.5k
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
prefers-reduce-motion globally instead of duplicating it? #29862
Comments
See #27986 (comment):
Another option is to use a PostCSS plugin to combine these rules, but AFAIK such plugin does not exist yet. |
Makes sense, however to me the spinner is the only component whose animation is significant. And it could easily be fixed by displaying visually hidden text when user So if applying this globally is not an option, there's another one I'd want to suggest for the redundancy: could we use a placeholder (extended in the transition mixins) to group transition resets? Something like: // In _reboot.scss, probably
@if $enable-prefers-reduced-motion-media-query {
@media (prefers-reduced-motion: reduce) {
%no-transition {
transition: none !important;
}
}
}
// In scss/mixins/_transition.scss
@mixin transition($transition...) {
@if $enable-transitions {
@if length($transition) == 0 {
transition: $transition-base;
} @else {
transition: $transition;
}
}
@if $enable-prefers-reduced-motion-media-query {
@extend %no-transition;
}
} Do you think it could solve the redundancy thing? |
That could work! Feel free to test this and make a PR if you can get this to work. |
i have no strong opinion here, but mention that having a single high-level animation suppression assumes that users that set also, this general big hammer on animations will "bleed out" to any author-defined extra animations that they may have set up in their additional CSS. |
Since in our test results, the |
…wbs#29862" This reverts commit cd7e5d1. Co-authored-by: Martijn Cuppens <martijn.cuppens@gmail.com>
Af of v4.4.1 — and since #25249 — the
transition()
mixins unsetstransition
when userprefers-reduced-motion
(which is great).However there are at least two caveats with this way of unsetting transitions:
What would you think about reducing motion globally and drastically?
My main resource for this is Andy Bell's "Modern CSS reset" but there're a lot more resources out there.
Coupling with
$enable-prefers-reduced-motion-media-query
, it might look like this:And it should be shorter and more efficient than 16 times of scoped
transition: none
. I guess it could be either in_transitions.scss
or in_reboot.scss
; both of them would make sense to me.I don't know if / on which version it could be done, but I'd be pleased to make a PR if it does interest you.
The text was updated successfully, but these errors were encountered: