-
Notifications
You must be signed in to change notification settings - Fork 13
style: prefer reduced motion #717
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
Changes from all commits
31bd909
1f4053b
1ce25c9
c1d788e
e32e178
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 | ||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -6,9 +6,7 @@ | |||||||||||||||||||||||||||||||||||||||
| height: var(--positioner-height); | ||||||||||||||||||||||||||||||||||||||||
| width: var(--positioner-width); | ||||||||||||||||||||||||||||||||||||||||
| max-width: var(--available-width); | ||||||||||||||||||||||||||||||||||||||||
| transition-property: top, left, right, bottom, transform; | ||||||||||||||||||||||||||||||||||||||||
| transition-timing-function: var(--easing); | ||||||||||||||||||||||||||||||||||||||||
| transition-duration: var(--animation-duration); | ||||||||||||||||||||||||||||||||||||||||
| transition: opacity var(--animation-duration) var(--easing); | ||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||
| .popup { | ||||||||||||||||||||||||||||||||||||||||
|
|
@@ -25,9 +23,7 @@ | |||||||||||||||||||||||||||||||||||||||
| width: var(--popup-width, auto); | ||||||||||||||||||||||||||||||||||||||||
| height: var(--popup-height, auto); | ||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||
| transition-property: width, height, opacity, transform; | ||||||||||||||||||||||||||||||||||||||||
| transition-timing-function: var(--easing); | ||||||||||||||||||||||||||||||||||||||||
| transition-duration: var(--animation-duration); | ||||||||||||||||||||||||||||||||||||||||
| transition: opacity var(--animation-duration) var(--easing); | ||||||||||||||||||||||||||||||||||||||||
|
Contributor
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. Fix Stylelint violation in Line 29 is currently flagged by Stylelint ( Suggested fix .popup {
position: relative;
box-sizing: border-box;
padding: var(--rs-space-3);
background-color: var(--rs-color-background-base-primary);
border-radius: var(--rs-radius-2);
border: 0.5px solid var(--rs-color-border-base-primary);
box-shadow:
0 1px 1px 0 rgba(0, 0, 0, 0.07),
0 2px 5px 0 rgba(0, 0, 0, 0.07),
0 3px 8px 0 rgba(0, 0, 0, 0.07);
color: var(--rs-color-foreground-base-primary);
transform-origin: var(--transform-origin);
width: var(--popup-width, auto);
height: var(--popup-height, auto);
-
transition: opacity var(--animation-duration) var(--easing);
}📝 Committable suggestion
Suggested change
🧰 Tools🪛 Stylelint (17.6.0)[error] 29-29: Unexpected empty line before declaration (declaration-empty-line-before) (declaration-empty-line-before) 🤖 Prompt for AI Agents |
||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||
| .popup[data-starting-style], | ||||||||||||||||||||||||||||||||||||||||
|
|
@@ -79,9 +75,7 @@ | |||||||||||||||||||||||||||||||||||||||
| width: var(--popup-width); | ||||||||||||||||||||||||||||||||||||||||
| translate: 0; | ||||||||||||||||||||||||||||||||||||||||
| opacity: 1; | ||||||||||||||||||||||||||||||||||||||||
| transition: | ||||||||||||||||||||||||||||||||||||||||
| translate var(--animation-duration) var(--easing), | ||||||||||||||||||||||||||||||||||||||||
| opacity calc(var(--animation-duration) / 2) var(--easing); | ||||||||||||||||||||||||||||||||||||||||
| transition: opacity calc(var(--animation-duration) / 2) var(--easing); | ||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||
| .viewport[data-activation-direction~="left"] | ||||||||||||||||||||||||||||||||||||||||
|
|
@@ -107,3 +101,30 @@ | |||||||||||||||||||||||||||||||||||||||
| translate: -30% 0; | ||||||||||||||||||||||||||||||||||||||||
| opacity: 0; | ||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||
| @media (prefers-reduced-motion: no-preference) { | ||||||||||||||||||||||||||||||||||||||||
| .positioner { | ||||||||||||||||||||||||||||||||||||||||
| transition: | ||||||||||||||||||||||||||||||||||||||||
| top var(--animation-duration) var(--easing), | ||||||||||||||||||||||||||||||||||||||||
| left var(--animation-duration) var(--easing), | ||||||||||||||||||||||||||||||||||||||||
| right var(--animation-duration) var(--easing), | ||||||||||||||||||||||||||||||||||||||||
| bottom var(--animation-duration) var(--easing), | ||||||||||||||||||||||||||||||||||||||||
| transform var(--animation-duration) var(--easing), | ||||||||||||||||||||||||||||||||||||||||
| opacity var(--animation-duration) var(--easing); | ||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||
| .popup { | ||||||||||||||||||||||||||||||||||||||||
| transition: | ||||||||||||||||||||||||||||||||||||||||
| width var(--animation-duration) var(--easing), | ||||||||||||||||||||||||||||||||||||||||
| height var(--animation-duration) var(--easing), | ||||||||||||||||||||||||||||||||||||||||
| opacity var(--animation-duration) var(--easing), | ||||||||||||||||||||||||||||||||||||||||
| transform var(--animation-duration) var(--easing); | ||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||
| .viewport [data-previous], | ||||||||||||||||||||||||||||||||||||||||
| .viewport [data-current] { | ||||||||||||||||||||||||||||||||||||||||
| transition: | ||||||||||||||||||||||||||||||||||||||||
| translate var(--animation-duration) var(--easing), | ||||||||||||||||||||||||||||||||||||||||
| opacity calc(var(--animation-duration) / 2) var(--easing); | ||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||
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.
Reduced-motion path still allows drawer/backdrop animation.
Nice inversion to
no-preference, but reduced-motion is not fully enforced because close-state duration rules (Line 84, Line 100, Line 116, Line 132) and backdrop transition (Line 8) remain active outside media gating. Inreduce, this can still animate closing/fade.Suggested fix
`@media` (prefers-reduced-motion: no-preference) { + .backdrop { + transition: opacity 450ms cubic-bezier(0.32, 0.72, 0, 1); + } + .drawerPopup-right, .drawerPopup-left, .drawerPopup-top, .drawerPopup-bottom { transition: transform 450ms cubic-bezier(0.32, 0.72, 0, 1); } + + .backdrop[data-ending-style] { + transition-duration: calc(var(--drawer-swipe-strength, 1) * 400ms); + } + + .drawerPopup-right[data-ending-style], + .drawerPopup-left[data-ending-style], + .drawerPopup-top[data-ending-style], + .drawerPopup-bottom[data-ending-style] { + transition-duration: calc(var(--drawer-swipe-strength, 1) * 400ms); + } } + +@media (prefers-reduced-motion: reduce) { + .backdrop, + .drawerPopup-right, + .drawerPopup-left, + .drawerPopup-top, + .drawerPopup-bottom { + transition: none; + } +}🤖 Prompt for AI Agents