-
Notifications
You must be signed in to change notification settings - Fork 361
feat(animations): tasteful motion refresh with reduced-motion support #3375
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
Open
orrgottlieb
wants to merge
4
commits into
master
Choose a base branch
from
feat/animations-tier1
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 1 commit
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
3bafe61
feat(animations): refresh popovers, Toast, Modal, Skeleton with motio…
orrgottlieb 8e58e40
feat(menu): animate submenu open/close with expand variant
orrgottlieb ab961eb
fix(menu): use CSS animations for submenu open transition
orrgottlieb 97ae8b0
test(docs): await submenu exit animation in Menu interactions
orrgottlieb File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,5 @@ | ||
| @import "~@vibe/style/dist/mixins"; | ||
| @import "~@vibe/style/dist/mixins/motion"; | ||
|
|
||
| .contentWrapper { | ||
| outline: 0; | ||
|
|
@@ -53,121 +54,147 @@ | |
| } | ||
|
|
||
| // Animations | ||
| // | ||
| // Two flavors driven by Dialog's `animationType` prop: | ||
| // - opacity-and-slide: fade + 16px translate from origin (default for popovers) | ||
| // - expand: scale-from-origin + fade (used by Tooltip, Menu submenus) | ||
| // | ||
| // Both are gated on `prefers-reduced-motion: no-preference`. Reduced-motion | ||
| // users get the popover at rest immediately with no transition. | ||
|
|
||
| $translate-minus-px: calc(var(--space-16) * -1); | ||
|
|
||
| .opacitySlideAppear { | ||
| opacity: 0; | ||
| @include motion-safe { | ||
| opacity: 0; | ||
|
|
||
| &.top { | ||
| transform: translateY(var(--space-16)); | ||
| } | ||
| &.top { | ||
| transform: translateY(var(--space-16)); | ||
| } | ||
|
|
||
| &.right { | ||
| transform: translateX($translate-minus-px); | ||
| } | ||
| &.right { | ||
| transform: translateX($translate-minus-px); | ||
| } | ||
|
|
||
| &.bottom { | ||
| transform: translateY($translate-minus-px); | ||
| } | ||
| &.bottom { | ||
| transform: translateY($translate-minus-px); | ||
| } | ||
|
|
||
| &.left { | ||
| transform: translateX(var(--space-16)); | ||
| &.left { | ||
| transform: translateX(var(--space-16)); | ||
| } | ||
| } | ||
| } | ||
|
|
||
| .opacitySlideAppearActive { | ||
| transition: opacity 0.2s ease, transform 0.2s ease-out; | ||
| opacity: 1; | ||
| pointer-events: none; | ||
|
|
||
| &.top, | ||
| &.bottom { | ||
| transform: translateY(0); | ||
| } | ||
| @include motion-safe { | ||
| transition: opacity var(--motion-productive-long) var(--motion-timing-enter), | ||
| transform var(--motion-productive-long) var(--motion-timing-enter); | ||
| opacity: 1; | ||
|
|
||
| &.right, | ||
| &.left { | ||
| transform: translateX(0); | ||
| &.top, | ||
| &.bottom { | ||
| transform: translateY(0); | ||
| } | ||
|
|
||
| &.right, | ||
| &.left { | ||
| transform: translateX(0); | ||
| } | ||
| } | ||
| } | ||
|
|
||
| .expandAppear, | ||
| .expandExit { | ||
| transition: transform 0.1s $expand-animation-timing; | ||
| &.top, | ||
| &.topStart, | ||
| &.topEnd { | ||
| transform-origin: bottom center; | ||
| transform: scale(0.8); | ||
| &.edgeBottom { | ||
| transform-origin: bottom left; | ||
| } | ||
| &.edgeTop { | ||
| transform-origin: bottom right; | ||
| @include motion-safe { | ||
| transition: transform var(--motion-productive-long) var(--motion-timing-enter), | ||
| opacity var(--motion-productive-long) var(--motion-timing-enter); | ||
| opacity: 0; | ||
|
Comment on lines
+111
to
+114
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. 2. Dialogcontent timeout mismatch DialogContent’s CSS now uses --motion-productive-long (150ms) for expand transitions, but
DialogContent.tsx still ends the transition after timeout={showDelay} (default 100ms). This
removes the active transition classes early, truncating the animation and making the new token
timing not actually take effect.
Agent Prompt
|
||
|
|
||
| &.top, | ||
| &.topStart, | ||
| &.topEnd { | ||
| transform-origin: bottom center; | ||
| transform: scale(0.92); | ||
| &.edgeBottom { | ||
| transform-origin: bottom left; | ||
| } | ||
| &.edgeTop { | ||
| transform-origin: bottom right; | ||
| } | ||
| } | ||
| } | ||
|
|
||
| &.right, | ||
| &.rightStart, | ||
| &.rightEnd { | ||
| transform-origin: left; | ||
| transform: scale(0.8); | ||
| &.edgeBottom { | ||
| transform-origin: top left; | ||
| } | ||
| &.edgeTop { | ||
| transform-origin: bottom left; | ||
| &.right, | ||
| &.rightStart, | ||
| &.rightEnd { | ||
| transform-origin: left; | ||
| transform: scale(0.92); | ||
| &.edgeBottom { | ||
| transform-origin: top left; | ||
| } | ||
| &.edgeTop { | ||
| transform-origin: bottom left; | ||
| } | ||
| } | ||
| } | ||
|
|
||
| &.bottom, | ||
| &.bottomStart, | ||
| &.bottomEnd { | ||
| transform-origin: top; | ||
| transform: scale(0.8); | ||
| &.edgeBottom { | ||
| transform-origin: top left; | ||
| &.bottom, | ||
| &.bottomStart, | ||
| &.bottomEnd { | ||
| transform-origin: top; | ||
| transform: scale(0.92); | ||
| &.edgeBottom { | ||
| transform-origin: top left; | ||
| } | ||
| &.edgeTop { | ||
| transform-origin: top right; | ||
| } | ||
| } | ||
| &.edgeTop { | ||
| transform-origin: top right; | ||
| } | ||
| } | ||
|
|
||
| &.left, | ||
| &.leftStart, | ||
| &.leftEnd { | ||
| transform-origin: right; | ||
| transform: scale(0.8); | ||
| &.edgeBottom { | ||
| transform-origin: top right; | ||
| } | ||
| &.edgeTop { | ||
| transform-origin: bottom right; | ||
| &.left, | ||
| &.leftStart, | ||
| &.leftEnd { | ||
| transform-origin: right; | ||
| transform: scale(0.92); | ||
| &.edgeBottom { | ||
| transform-origin: top right; | ||
| } | ||
| &.edgeTop { | ||
| transform-origin: bottom right; | ||
| } | ||
| } | ||
| } | ||
| } | ||
|
|
||
| .expandExit { | ||
| transition: transform 0.1s $expand-animation-timing; | ||
| @include motion-safe { | ||
| transition: transform var(--motion-productive-medium) var(--motion-timing-exit), | ||
| opacity var(--motion-productive-medium) var(--motion-timing-exit); | ||
| } | ||
| } | ||
|
|
||
| .expandAppearActive { | ||
| transition: transform 0.1s $expand-animation-timing; | ||
| pointer-events: none; | ||
|
|
||
| &.top, | ||
| &.topStart, | ||
| &.topEnd, | ||
| &.bottom, | ||
| &.bottomStart, | ||
| &.bottomEnd, | ||
| &.right, | ||
| &.rightStart, | ||
| &.rightEnd, | ||
| &.left, | ||
| &.leftStart, | ||
| &.leftEnd { | ||
| transform: scale(1); | ||
| @include motion-safe { | ||
| transition: transform var(--motion-productive-long) var(--motion-timing-enter), | ||
| opacity var(--motion-productive-long) var(--motion-timing-enter); | ||
| opacity: 1; | ||
|
|
||
| &.top, | ||
| &.topStart, | ||
| &.topEnd, | ||
| &.bottom, | ||
| &.bottomStart, | ||
| &.bottomEnd, | ||
| &.right, | ||
| &.rightStart, | ||
| &.rightEnd, | ||
| &.left, | ||
| &.leftStart, | ||
| &.leftEnd { | ||
| transform: scale(1); | ||
| } | ||
| } | ||
| } | ||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
1. Reduced-motion blocks clicks
🐞 Bug≡ CorrectnessAgent Prompt
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools