Skip to content

Commit

Permalink
Change out animation duration to 200ms
Browse files Browse the repository at this point in the history
  • Loading branch information
ciampo committed Sep 2, 2024
1 parent a6f93b3 commit c26c72e
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions packages/components/src/dropdown-menu-v2/styles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,10 @@ import type { DropdownMenuContext } from './types';
const ANIMATION_PARAMS = {
SCALE_AMOUNT_OUTER: 0.82,
SCALE_AMOUNT_CONTENT: 0.9,
DURATION: '400ms',
DURATION: {
IN: '400ms',
OUT: '200ms',
},
EASING: 'cubic-bezier(0.33, 0, 0, 1)',
};

Expand Down Expand Up @@ -58,7 +61,7 @@ export const MenuPopoverOuterWrapper = styled.div<
@media not ( prefers-reduced-motion ) {
transition-property: transform, opacity;
transition-timing-function: ${ ANIMATION_PARAMS.EASING };
transition-duration: ${ ANIMATION_PARAMS.DURATION };
transition-duration: ${ ANIMATION_PARAMS.DURATION.IN };
will-change: transform, opacity;
/* Regardless of the side, fade in and out. */
Expand All @@ -67,6 +70,10 @@ export const MenuPopoverOuterWrapper = styled.div<
opacity: 1;
}
&:has( [data-leave] ) {
transition-duration: ${ ANIMATION_PARAMS.DURATION.OUT };
}
/* For menus opening on top and bottom side, animate the scale Y too. */
&:has( [data-side='bottom'] ),
&:has( [data-side='top'] ) {
Expand Down

0 comments on commit c26c72e

Please sign in to comment.