Skip to content

Commit 720cc21

Browse files
committed
fix: Consistently style and animate the outline button variants
1 parent 677f8b8 commit 720cc21

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

src/components/ui/buttonVariants.tsx

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
import { cva } from 'class-variance-authority';
22

3+
const hoverBounce = 'hover:-translate-y-1 transition duration-200';
4+
const outlineCommon = 'border bg-transparent border-2 text-white shadow-xs hover:bg-grey-700/40';
35
export const buttonVariants = cva(
46
`inline-flex
57
items-center
@@ -29,17 +31,17 @@ export const buttonVariants = cva(
2931
submit:
3032
'bg-gradient-to-r from-blue-100 from-0% to-blue to-100% hover:bg-gradient-to-r hover:from-blue text-primary-foreground shadow-sm',
3133
destructive: 'bg-destructive text-destructive-foreground shadow-xs hover:bg-destructive/90',
32-
outline: 'border border-input bg-background shadow-xs hover:bg-accent hover:text-accent-foreground',
3334
secondary: 'bg-secondary text-secondary-foreground shadow-xs hover:bg-secondary/80',
3435
ghost: 'hover:bg-accent hover:text-muted-foreground',
3536
link: 'text-primary underline-offset-4 hover:underline',
3637
positive: 'bg-green text-white shadow-xs hover:bg-green/90',
38+
outline: `${outlineCommon} ${hoverBounce}`,
3739
positiveOutline:
38-
'border bg-transparent border-green border-2 text-white shadow-xs hover:-translate-y-1 transition duration-200 hover:bg-grey-700/40',
40+
`${outlineCommon} ${hoverBounce} border-green`,
3941
destructiveOutline:
40-
'border bg-transparent border-destructive border-2 text-white shadow-xs hover:-translate-y-1 transition duration-200 hover:bg-grey-700/40',
42+
`${outlineCommon} ${hoverBounce} border-destructive`,
4143
defaultOutline:
42-
'border bg-transparent border-primary border-2 text-white shadow-xs hover:-translate-y-1 transition duration-200 hover:bg-grey-700/40',
44+
`${outlineCommon} ${hoverBounce} border-primary`,
4345
},
4446
size: {
4547
default: 'h-9 px-4 py-2 has-[>svg]:px-3',

0 commit comments

Comments
 (0)