-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbutton.css
More file actions
189 lines (165 loc) · 4.26 KB
/
Copy pathbutton.css
File metadata and controls
189 lines (165 loc) · 4.26 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
/* These styles mirror the internal design system's button component, converted to plain CSS. */
/* Base button styles */
.btn {
position: relative;
display: inline-flex;
gap: 0.5rem;
align-items: center;
justify-content: center;
flex-shrink: 0;
min-width: 5rem;
height: 2.25rem;
padding: 0.5rem 1rem;
white-space: nowrap;
font-family: Styrene;
font-weight: 600;
border-radius: 0.5rem;
&:active {
transform: scale(0.985);
}
/* Size variants */
&.size-xs {
height: 1.75rem;
min-width: 3.5rem;
padding: 0 0.5rem;
border-radius: 0.25rem;
font-size: 0.75rem;
gap: 0.25rem;
}
&.size-sm {
height: 2rem;
min-width: 4rem;
padding: 0 0.75rem;
border-radius: 0.375rem;
font-size: 0.75rem;
}
&.size-lg {
height: 2.75rem;
min-width: 6rem;
padding: 0 1.25rem;
border-radius: 0.6rem;
}
&:disabled {
pointer-events: none;
opacity: 0.5;
box-shadow: none;
}
&:focus-visible {
outline: none;
--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);
--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color);
box-shadow: var(--tw-ring-offset-shadow), var(--tw-ring-shadow);
}
/* Primary variant */
&.primary {
font-weight: 600;
color: hsl(var(--oncolor-100));
background-color: hsl(var(--accent-main-100));
background-image: linear-gradient(
to right,
hsl(var(--accent-main-100)) 0%,
hsl(var(--accent-main-200) / 0.5) 50%,
hsl(var(--accent-main-200)) 100%
);
background-size: 200% 100%;
background-position: 0% 0%;
border: 0.5px solid hsl(var(--border-300) / 0.25);
box-shadow:
inset 0 0.5px 0px rgba(255, 255, 0, 0.15),
0 1px 1px rgba(0, 0, 0, 0.05);
text-shadow: 0 1px 2px rgb(0 0 0 / 10%);
transition: all 150ms cubic-bezier(0.4, 0, 0.2, 1);
&:hover {
background-position: 100% 0%;
background-image: linear-gradient(
to right,
hsl(var(--accent-main-200)) 0%,
hsl(var(--accent-main-200)) 100%
);
}
&:active {
background-color: hsl(var(--accent-main-000));
box-shadow: inset 0 1px 6px rgba(0, 0, 0, 0.2);
transform: scale(0.985);
}
}
/* Flat variant */
&.flat {
font-weight: 500;
color: hsl(var(--oncolor-100));
background-color: hsl(var(--accent-main-100));
transition: background-color 150ms;
&:hover {
background-color: hsl(var(--accent-main-200));
}
}
/* Secondary variant */
&.secondary {
font-weight: 600;
color: hsl(var(--text-100) / 0.9);
background-image: radial-gradient(
ellipse at center,
hsl(var(--bg-500) / 0.1) 50%,
hsl(var(--bg-500) / 0.3) 100%
);
border: 0.5px solid hsl(var(--border-400));
transition: color 150ms, background-color 150ms;
&:hover {
color: hsl(var(--text-000));
background-color: hsl(var(--bg-500) / 0.6);
}
&:active {
background-color: hsl(var(--bg-500) / 0.5);
}
}
/* Outline variant */
&.outline {
font-weight: 600;
color: hsl(var(--text-200));
background-color: transparent;
border: 1.5px solid currentColor;
transition: color 150ms, background-color 150ms;
&:hover {
color: hsl(var(--text-100));
background-color: hsl(var(--bg-400));
border-color: hsl(var(--bg-400));
}
}
/* Ghost variant */
&.ghost {
color: hsl(var(--text-200));
border-color: transparent;
transition: color 150ms, background-color 150ms;
&:hover {
color: hsl(var(--text-100));
background-color: hsl(var(--bg-500) / 0.4);
}
&:active {
background-color: hsl(var(--bg-400));
}
}
/* Underline variant */
&.underline {
opacity: 0.8;
text-decoration-line: none;
text-underline-offset: 3px;
transition: all 150ms;
&:hover {
opacity: 1;
text-decoration-line: underline;
}
&:active {
transform: scale(0.985);
}
}
/* Danger variant */
&.danger {
font-weight: 600;
color: hsl(var(--oncolor-100));
background-color: hsl(var(--danger-100));
transition: background-color 150ms;
&:hover {
background-color: hsl(var(--danger-200));
}
}
}