Skip to content

Commit

Permalink
fix chevron
Browse files Browse the repository at this point in the history
  • Loading branch information
talentlessguy committed Nov 29, 2024
1 parent 3c476c5 commit 999d37f
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ const Circle = ({
.otherwise(() => '4')}
/>
)}
transition="all 1s linear, stroke-width 0.2s ease-in-out 1s"
className={styles.circle}
/>
)
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { sprinkles } from '@/src/css/sprinkles.css'
import { style } from '@vanilla-extract/css'
import { recipe } from '@vanilla-extract/recipes'

export const variants = recipe({
Expand All @@ -19,3 +20,7 @@ export const variants = recipe({
},
},
})

export const circle = style({
transition: 'all 1s linear, stroke-width 0.2s ease-in-out 1s',
})
4 changes: 3 additions & 1 deletion components/src/components/molecules/Dropdown/Dropdown.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import { ScrollBox } from '../../atoms/ScrollBox/ScrollBox'
import * as styles from './styles.css'
import { clsx } from 'clsx'
import type { Color } from '@/src/interfaces/withColor'
import { assignInlineVars } from '@vanilla-extract/dynamic'

type Align = 'left' | 'right'
type LabelAlign = 'flex-start' | 'flex-end' | 'center'
Expand Down Expand Up @@ -370,11 +371,12 @@ const Chevron = ({
fill="currentColor"
marginLeft="1"
marginRight="0.5"
transform={rotation($direction, !!$open)}
transitionDuration={200}
transitionProperty="all"
transitionTimingFunction="inOut"
width="3"
className={styles.chevron}
style={assignInlineVars({ [styles.chevronTransform]: rotation($direction, !!$open) })}
/>
)
}
Expand Down
8 changes: 7 additions & 1 deletion components/src/components/molecules/Dropdown/styles.css.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { style } from '@vanilla-extract/css'
import { createVar, style } from '@vanilla-extract/css'

import { commonVars } from '@/src/css/theme.css'
import { recipe } from '@vanilla-extract/recipes'
Expand Down Expand Up @@ -53,3 +53,9 @@ export const actionSheeItem = style({
export const menuButtonIndicator = style({
transform: 'translateY(-50%)',
})

export const chevronTransform = createVar()

export const chevron = style({
transform: chevronTransform,
})

0 comments on commit 999d37f

Please sign in to comment.