Modify reduce-motion mixin so that it works for transitions too. #15850
This PR is a blunt instrument in its current state — I've added a
Any thoughts are greatly appreciated!
requested review from
May 27, 2019
Oh yeah, I meant to get back to this. Glad you remembered
This makes sense but including both in a single mixin keeps things simple.
This is a cool and efficient idea!
This is kinda what I was thinking.
More and more, I think we'll start seeing that as a staple for most websites. Similar to how we see the "global"
I agree that it feels careless to use a global like that but I honestly can't think of one situation where it would cause a problem. It might actually be less problematic since it blankets everything rather than needing to be meticulously added to individual rules.
Totally agree. I'm mostly scared of the possibility that this breaks something important, and it isn't reported and fixed quickly because people aren't frequently testing with this setting turned on.
For instance, the
I guess for now, I'll look into breaking these out into two separate
Good point. Change one of the examples at the top of this page to
So yeah, individual mixins would probably be best.
The idea of two separate mixins seemed a little confusing to me, so I tried out a slightly different idea. Let me know if this is too obscure of a method:
We'd keep one mixin, that'd accept two different values, depending on the type of motion property:
If someone were to leave the property variable empty, we'd fall back to including both. This seems pretty flexible to me, and keeps these overrides together in one place. Here's how it's done:
jasmussen left a comment
Thanks, for this.
Code looks good, and feedback from Marty seems to be mostly addressed. What unknowns that may still be present can surely be addressed in subsequent PRs if need be.
The documentation is also already in place: https://developer.wordpress.org/block-editor/designers/animation/#accessibility-considerations
Nothing comes to mind as to what we can do, more than this, to advise third parties for how to best design with this in mind.
I also took a quick spin to verify the behavior: