-
Notifications
You must be signed in to change notification settings - Fork 28
/
button.scss
114 lines (89 loc) · 2.14 KB
/
button.scss
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
.btn {
--btn-padding: #{unit(3)} #{unit(5)};
--btn-border: 1px solid var(--secondary-color);
--btn-radius: 4px;
position: relative;
padding: var(--btn-padding);
color: var(--btn-color, black);
background: var(--btn-bg, white);
border: var(--btn-border);
border-radius: var(--btn-radius);
white-space: nowrap;
cursor: pointer;
@each $type in $types {
@include btn-color-with-state($type);
}
&-round {
--btn-radius: 30px;
}
&-circle {
--btn-padding: 0;
--btn-radius: 50%;
@include square(unit(11));
}
&.disabled {
cursor: not-allowed;
}
&.loading {
--btn-color: transparent;
@include flex-center;
&::before {
@include circle(18px);
position: absolute;
content: "";
background: none;
border: 4px solid white;
clip-path: inset(0 0 50% 0);
transform: rotate(0);
animation: spin 0.6s linear infinite;
}
}
&-ghost {
--btn-color: var(--btn-bg);
--btn-border: 1px solid var(--btn-bg);
background: transparent;
transition: 0.3s;
&:hover {
--btn-color: white;
background: var(--btn-bg);
}
}
&-dashed {
--btn-color: var(--btn-bg);
--btn-border: 1px dashed var(--btn-bg);
background: transparent;
}
&-link {
--btn-color: var(--btn-bg);
--btn-border: 0;
background: transparent;
}
&-sm {
--btn-padding: 0.25rem 0.5rem;
font-size: 0.75rem;
}
}
.btn-group {
--btn-group-divider-color: var(--secondary-color-lighter);
--btn-group-divider-length: 1px;
display: inline-flex;
.btn {
border: calc(var(--btn-group-divider-length) / 2) solid
var(--btn-group-divider-color);
border-top: none;
border-bottom: none;
&:first-child {
border-left: none;
border-top-right-radius: 0;
border-bottom-right-radius: 0;
}
&:last-child {
border-right: none;
border-top-left-radius: 0;
border-bottom-left-radius: 0;
}
&:not(:first-child):not(:last-child) {
border-radius: 0;
}
}
}