-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Components: Standardize reduced motion handling using media queries #68421
base: trunk
Are you sure you want to change the base?
Changes from all commits
a45c67a
72773cc
3872568
8d46aed
386c259
2c421b0
7105494
c863a53
f9a5c9b
bdb3f8d
90804a2
147e9bb
7ea0752
fb9f4ee
3ab4762
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -60,8 +60,11 @@ $resize-handler-container-size: $resize-handler-size + ($grid-unit-05 * 2); // M | |||||||||||||||||||
position: absolute; | ||||||||||||||||||||
top: calc(50% - 1px); | ||||||||||||||||||||
right: calc(50% - 1px); | ||||||||||||||||||||
transition: transform 0.1s ease-in; | ||||||||||||||||||||
@include reduce-motion("transition"); | ||||||||||||||||||||
|
||||||||||||||||||||
@media not (prefers-reduced-motion) { | ||||||||||||||||||||
transition: transform 0.1s ease-in; | ||||||||||||||||||||
} | ||||||||||||||||||||
|
||||||||||||||||||||
will-change: transform; | ||||||||||||||||||||
Comment on lines
+64
to
68
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||||||||||||
opacity: 0; | ||||||||||||||||||||
} | ||||||||||||||||||||
|
@@ -102,18 +105,20 @@ $resize-handler-container-size: $resize-handler-size + ($grid-unit-05 * 2); // M | |||||||||||||||||||
.components-resizable-box__side-handle.components-resizable-box__handle-bottom:hover::before, | ||||||||||||||||||||
.components-resizable-box__side-handle.components-resizable-box__handle-top:active::before, | ||||||||||||||||||||
.components-resizable-box__side-handle.components-resizable-box__handle-bottom:active::before { | ||||||||||||||||||||
animation: components-resizable-box__top-bottom-animation 0.1s ease-out 0s; | ||||||||||||||||||||
animation-fill-mode: forwards; | ||||||||||||||||||||
@include reduce-motion("animation"); | ||||||||||||||||||||
@media not (prefers-reduced-motion) { | ||||||||||||||||||||
animation: components-resizable-box__top-bottom-animation 0.1s ease-out 0s; | ||||||||||||||||||||
animation-fill-mode: forwards; | ||||||||||||||||||||
} | ||||||||||||||||||||
} | ||||||||||||||||||||
|
||||||||||||||||||||
.components-resizable-box__side-handle.components-resizable-box__handle-left:hover::before, | ||||||||||||||||||||
.components-resizable-box__side-handle.components-resizable-box__handle-right:hover::before, | ||||||||||||||||||||
.components-resizable-box__side-handle.components-resizable-box__handle-left:active::before, | ||||||||||||||||||||
.components-resizable-box__side-handle.components-resizable-box__handle-right:active::before { | ||||||||||||||||||||
animation: components-resizable-box__left-right-animation 0.1s ease-out 0s; | ||||||||||||||||||||
animation-fill-mode: forwards; | ||||||||||||||||||||
@include reduce-motion("animation"); | ||||||||||||||||||||
@media not (prefers-reduced-motion) { | ||||||||||||||||||||
animation: components-resizable-box__left-right-animation 0.1s ease-out 0s; | ||||||||||||||||||||
animation-fill-mode: forwards; | ||||||||||||||||||||
} | ||||||||||||||||||||
} | ||||||||||||||||||||
|
||||||||||||||||||||
/* This CSS is shown only to Safari, which has a bug with table-caption making it jumpy. | ||||||||||||||||||||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -56,9 +56,10 @@ | |
z-index: -1; | ||
|
||
// Animate in. | ||
animation: components-button__appear-animation 0.1s ease; | ||
animation-fill-mode: forwards; | ||
@include reduce-motion("animation"); | ||
@media not (prefers-reduced-motion) { | ||
animation: components-button__appear-animation 0.1s ease; | ||
animation-fill-mode: forwards; | ||
} | ||
Comment on lines
-59
to
+62
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do you know what this animation is intended to do? As far as I've tested, the outline animation when I focus on a button doesn't work. Maybe we can improve or fix this in a follow-up. |
||
} | ||
|
||
svg { | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we could move the
will-change
inside the media query.