-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
/
button.css
60 lines (56 loc) 路 1.21 KB
/
button.css
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
.btn {
@apply inline-flex flex-shrink-0 cursor-pointer select-none flex-wrap items-center justify-center border-transparent text-center transition duration-200 ease-in-out rounded-btn;
@apply h-12 px-4 text-sm min-h-12;
line-height: 1em;
/* disabled */
&-disabled,
&[disabled] {
@apply pointer-events-none;
}
/* shapes */
&-square {
@apply h-12 w-12 p-0;
}
&-circle {
@apply h-12 w-12 rounded-full p-0;
}
/* loading */
&.loading {
&,
&:hover {
@apply pointer-events-none;
}
&:before {
@apply mr-2 h-4 w-4 rounded-full border-2;
animation: spin 2s linear infinite;
content: "";
border-top-color: transparent;
border-left-color: transparent;
border-bottom-color: currentColor;
border-right-color: currentColor;
}
}
}
@media (prefers-reduced-motion: reduce) {
.btn.loading:before {
animation: spin 10s linear infinite;
}
}
@keyframes spin {
from {
transform: rotate(0deg);
}
to {
transform: rotate(360deg);
}
}
/* group */
.btn-group {
@apply flex flex-wrap;
& > input[type="radio"].btn {
@apply appearance-none;
}
& > input[type="radio"].btn:before {
content: attr(data-title);
}
}