/
calcite-action.scss
executable file
·229 lines (199 loc) · 4.35 KB
/
calcite-action.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
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
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
:host {
@extend %component-host;
@apply flex bg-transparent;
}
:host([disabled]) {
@apply pointer-events-none;
}
.button {
@apply bg-foreground-1
border-none
cursor-pointer
fill-color-3
flex
focus-base
items-center
justify-start
m-0
relative
text-n2h
font-medium
text-color-3
w-auto;
font-family: inherit;
text-align: unset;
&:hover {
@apply bg-foreground-2 text-color-1 fill-color-1;
}
&:focus {
@apply bg-foreground-2 text-color-1 fill-color-1 focus-inset;
}
&:active {
@apply bg-foreground-3;
}
.icon-container {
@apply flex
items-center
justify-center
m-0
pointer-events-none;
min-width: theme("spacing.4");
min-height: theme("spacing.4");
}
.text-container {
@apply leading-4
truncate
m-0
w-0
opacity-0
ease-in-out
duration-150
transition-opacity;
transition-property: margin;
transition-property: width;
}
.text-container--visible {
@apply flex-auto opacity-100 w-auto;
}
}
:host([scale="s"]) {
.button {
@apply font-normal p-2 text-n2h;
}
.button--text-visible .icon-container {
margin-inline-end: theme("spacing.2");
}
}
:host([scale="m"]) {
.button {
@apply font-normal p-4 text-n1h;
}
.button--text-visible .icon-container {
margin-inline-end: theme("spacing.3");
}
}
:host([scale="l"]) {
.button {
@apply font-normal p-5 text-0h;
}
.button--text-visible .icon-container {
margin-inline-end: theme("spacing.4");
}
}
:host([alignment="center"]) .button {
@apply justify-center;
}
:host([alignment="end"]) .button {
@apply justify-end;
}
:host([alignment="center"]),
:host([alignment="end"]) {
.button .text-container--visible {
@apply flex-initial;
}
}
// Compact
:host([scale="s"][compact]) .button,
:host([scale="m"][compact]) .button,
:host([scale="l"][compact]) .button {
@apply px-0;
}
.slot-container {
@apply flex;
}
.slot-container--hidden {
@apply hidden;
}
.button--text-visible {
@apply w-full;
}
:host([active]) .button,
:host([active]) .button:hover,
:host([active]) .button:focus,
:host([active][loading]) .button {
@apply text-color-1 fill-color-1 bg-foreground-3;
}
:host([active]) .button:active {
@apply bg-foreground-1;
}
:host([appearance="clear"]) .button {
@apply bg-transparent
transition-shadow
duration-150
ease-in-out;
}
:host([appearance="clear"]) .button:hover,
:host([appearance="clear"]) .button:focus {
@apply bg-transparent;
box-shadow: 0 0 0 2px theme("borderColor.color.1") inset;
}
:host([active][appearance="clear"]) .button,
:host([active][appearance="clear"]) .button:hover,
:host([active][appearance="clear"]) .button:focus {
@apply text-color-1 fill-color-1 bg-foreground-3;
}
:host([appearance="clear"][loading]) .button,
:host([appearance="clear"][disabled]) .button {
@apply bg-transparent;
}
:host([loading]) .button,
:host([loading]) .button:hover,
:host([loading]) .button:focus {
@apply bg-foreground-1;
.text-container {
@apply opacity-disabled;
}
}
:host([loading]) calcite-loader[inline] {
@apply mr-0 text-color-3;
}
:host([disabled]) .button,
:host([disabled]) .button:hover,
:host([disabled]) .button:focus {
@apply cursor-default opacity-disabled bg-foreground-1;
}
:host([disabled][active]) .button,
:host([disabled][active]) .button:hover,
:host([disabled][active]) .button:focus {
@apply opacity-disabled bg-foreground-3;
}
:host([indicator]) {
.button::after {
content: "";
@apply absolute
border-2
bg-brand
rounded-full
h-2
w-2
z-10;
border-color: theme("colors.background.foreground.1");
inset-block-end: theme("spacing.3");
inset-inline-end: theme("spacing.3");
}
.button--text-visible {
&::after {
inset-block-end: auto;
}
.text-container--visible {
margin-inline-end: theme("spacing.4");
}
}
.button:hover::after,
.button:focus::after {
border-color: theme("colors.background.foreground.1");
}
}
:host([indicator][scale="s"]) {
.button::after {
inset-block-end: theme("spacing.1");
inset-inline-end: theme("spacing.1");
}
.button--text-visible::after {
inset-block-end: auto;
inset-inline-end: theme("spacing.2");
}
}
:host([indicator][active]) .button::after {
border-color: theme("colors.background.foreground.3");
}