Skip to content

Commit 50f10ed

Browse files
author
Aaron Iker
committed
feat: button transition
1 parent 9a526d9 commit 50f10ed

2 files changed

Lines changed: 13 additions & 18 deletions

File tree

packages/ui/src/components/button.css

Lines changed: 12 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,13 @@
88
text-decoration: none;
99
user-select: none;
1010
cursor: default;
11-
outline: none;
11+
padding: 4px 8px;
1212
white-space: nowrap;
13+
transition-property: background-color, border-color, color, box-shadow, opacity;
14+
transition-duration: var(--transition-duration);
15+
transition-timing-function: var(--transition-easing);
16+
outline: none;
17+
line-height: 20px;
1318

1419
&[data-variant="primary"] {
1520
background-color: var(--button-primary-base);
@@ -87,7 +92,6 @@
8792
&:active:not(:disabled) {
8893
background-color: var(--button-secondary-base);
8994
scale: 0.99;
90-
transition: all 150ms ease-out;
9195
}
9296
&:disabled {
9397
border-color: var(--border-disabled);
@@ -102,34 +106,27 @@
102106
}
103107

104108
&[data-size="small"] {
105-
height: 22px;
106-
padding: 0 8px;
109+
padding: 2px 8px;
107110
&[data-icon] {
108-
padding: 0 12px 0 4px;
111+
padding: 2px 12px 2px 4px;
109112
}
110113

111-
font-size: var(--font-size-small);
112-
line-height: var(--line-height-large);
113114
gap: 4px;
114115

115116
/* text-12-medium */
116117
font-family: var(--font-family-sans);
117-
font-size: var(--font-size-small);
118+
font-size: var(--font-size-base);
118119
font-style: normal;
119120
font-weight: var(--font-weight-medium);
120-
line-height: var(--line-height-large); /* 166.667% */
121121
letter-spacing: var(--letter-spacing-normal);
122122
}
123123

124124
&[data-size="normal"] {
125-
height: 24px;
126-
line-height: 24px;
127-
padding: 0 6px;
125+
padding: 4px 6px;
128126
&[data-icon] {
129-
padding: 0 12px 0 4px;
127+
padding: 4px 12px 4px 4px;
130128
}
131129

132-
font-size: var(--font-size-small);
133130
gap: 6px;
134131

135132
/* text-12-medium */
@@ -141,11 +138,10 @@
141138
}
142139

143140
&[data-size="large"] {
144-
height: 32px;
145141
padding: 6px 12px;
146142

147143
&[data-icon] {
148-
padding: 0 12px 0 8px;
144+
padding: 6px 12px 6px 8px;
149145
}
150146

151147
gap: 8px;
@@ -155,7 +151,6 @@
155151
font-size: 14px;
156152
font-style: normal;
157153
font-weight: var(--font-weight-medium);
158-
line-height: var(--line-height-large); /* 142.857% */
159154
letter-spacing: var(--letter-spacing-normal);
160155
}
161156

packages/ui/src/components/button.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { Icon, IconProps } from "./icon"
44

55
export interface ButtonProps
66
extends ComponentProps<typeof Kobalte>,
7-
Pick<ComponentProps<"button">, "class" | "classList" | "children"> {
7+
Pick<ComponentProps<"button">, "class" | "classList" | "children" | "style"> {
88
size?: "small" | "normal" | "large"
99
variant?: "primary" | "secondary" | "ghost"
1010
icon?: IconProps["name"]

0 commit comments

Comments
 (0)