Skip to content

Commit 3381690

Browse files
committed
refactor(styled button): put transition-all in shared class
1 parent 81b62cf commit 3381690

File tree

2 files changed

+10
-5
lines changed

2 files changed

+10
-5
lines changed

.changeset/ten-actors-explain.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@qwik-ui/styled': patch
3+
---
4+
5+
REFACTOR styled button: place transitions into shared class

packages/kit-styled/src/components/button/button.tsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,18 @@ import { cn } from '@qwik-ui/utils';
33
import { cva, type VariantProps } from 'class-variance-authority';
44

55
export const buttonVariants = cva(
6-
'inline-flex items-center justify-center rounded text-sm font-medium focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50',
6+
'inline-flex items-center justify-center rounded text-sm font-medium transition-all duration-100 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50',
77
{
88
variants: {
99
look: {
1010
primary:
11-
'border-base bg-primary text-primary-foreground shadow-sm transition-all duration-100 hover:bg-primary/90 active:shadow-base active:press',
11+
'border-base bg-primary text-primary-foreground shadow-sm hover:bg-primary/90 active:shadow-base active:press',
1212
secondary:
13-
'border-base bg-secondary text-secondary-foreground shadow-sm transition-all duration-100 hover:bg-secondary/90 active:shadow-base active:press',
13+
'border-base bg-secondary text-secondary-foreground shadow-sm hover:bg-secondary/90 active:shadow-base active:press',
1414
alert:
15-
'border-base bg-alert text-alert-foreground shadow-sm transition-all duration-100 hover:bg-alert/90 active:shadow-base active:press',
15+
'border-base bg-alert text-alert-foreground shadow-sm hover:bg-alert/90 active:shadow-base active:press',
1616
outline:
17-
'border bg-background text-foreground shadow-sm transition-all duration-100 hover:bg-accent active:shadow-base active:press',
17+
'border bg-background text-foreground shadow-sm hover:bg-accent active:shadow-base active:press',
1818
ghost: 'text-accent-foreground hover:bg-accent',
1919
link: 'text-foreground hover:bg-transparent hover:text-foreground/80 hover:underline hover:underline-offset-2',
2020
},

0 commit comments

Comments
 (0)