@oruga-ui/theme-oruga 0.4.2 → 0.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/oruga.css +2 -4046
- package/dist/scss/components/_button.scss +34 -38
- package/dist/scss/components/_datepicker.scss +15 -8
- package/dist/scss/components/_datetimepicker.scss +1 -1
- package/dist/scss/components/_dropdown.scss +1 -1
- package/dist/scss/components/_menu.scss +8 -3
- package/dist/scss/components/_pagination.scss +10 -10
- package/dist/scss/components/_slider.scss +4 -4
- package/dist/scss/components/_steps.scss +56 -123
- package/dist/scss/components/_tabs.scss +220 -232
- package/dist/scss/utils/_variables.scss +2 -2
- package/dist/theme.js +1 -8
- package/package.json +30 -37
- package/dist/oruga.min.css +0 -1
- package/src/assets/scss/components/_autocomplete.scss +0 -23
- package/src/assets/scss/components/_button.scss +0 -226
- package/src/assets/scss/components/_carousel.scss +0 -233
- package/src/assets/scss/components/_checkbox.scss +0 -171
- package/src/assets/scss/components/_collapse.scss +0 -15
- package/src/assets/scss/components/_datepicker.scss +0 -494
- package/src/assets/scss/components/_datetimepicker.scss +0 -13
- package/src/assets/scss/components/_dropdown.scss +0 -268
- package/src/assets/scss/components/_field.scss +0 -132
- package/src/assets/scss/components/_icon.scss +0 -53
- package/src/assets/scss/components/_input.scss +0 -149
- package/src/assets/scss/components/_loading.scss +0 -37
- package/src/assets/scss/components/_menu.scss +0 -92
- package/src/assets/scss/components/_modal.scss +0 -94
- package/src/assets/scss/components/_notification.scss +0 -175
- package/src/assets/scss/components/_pagination.scss +0 -213
- package/src/assets/scss/components/_radio.scss +0 -112
- package/src/assets/scss/components/_select.scss +0 -156
- package/src/assets/scss/components/_sidebar.scss +0 -139
- package/src/assets/scss/components/_skeleton.scss +0 -80
- package/src/assets/scss/components/_slider.scss +0 -199
- package/src/assets/scss/components/_steps.scss +0 -427
- package/src/assets/scss/components/_switch.scss +0 -150
- package/src/assets/scss/components/_table.scss +0 -424
- package/src/assets/scss/components/_tabs.scss +0 -348
- package/src/assets/scss/components/_taginput.scss +0 -117
- package/src/assets/scss/components/_timepicker.scss +0 -92
- package/src/assets/scss/components/_tooltip.scss +0 -453
- package/src/assets/scss/components/_upload.scss +0 -69
- package/src/assets/scss/oruga-build.scss +0 -9
- package/src/assets/scss/oruga.scss +0 -41
- package/src/assets/scss/utils/_animations.scss +0 -233
- package/src/assets/scss/utils/_base.scss +0 -31
- package/src/assets/scss/utils/_helpers.scss +0 -113
- package/src/assets/scss/utils/_root.scss +0 -54
- package/src/assets/scss/utils/_variables.scss +0 -103
|
@@ -1,427 +0,0 @@
|
|
|
1
|
-
@use "sass:list";
|
|
2
|
-
|
|
3
|
-
/* @docs */
|
|
4
|
-
$steps-details-background-color: hsl(0, 0%, 100%) !default;
|
|
5
|
-
$steps-details-padding: 0.2em !default;
|
|
6
|
-
$steps-marker-background: var(--#{$prefix}grey-light) !default;
|
|
7
|
-
$steps-marker-color: var(--#{$prefix}primary-invert) !default;
|
|
8
|
-
$steps-marker-border: 0.2em solid #fff !default;
|
|
9
|
-
$steps-marker-font-weight: 700 !default;
|
|
10
|
-
$steps-marker-rounded-border-radius: var(
|
|
11
|
-
--#{$prefix}base-border-radius-rounded
|
|
12
|
-
) !default;
|
|
13
|
-
$steps-color: var(--#{$prefix}grey-lighter) !default;
|
|
14
|
-
$steps-previous-color: var(--#{$prefix}primary) !default;
|
|
15
|
-
$steps-active-color: var(--#{$prefix}primary) !default;
|
|
16
|
-
$steps-divider-height: 0.2em !default;
|
|
17
|
-
$steps-vertical-padding: 1em 0 !default;
|
|
18
|
-
$steps-item-line-height: var(--#{$prefix}base-line-height) !default;
|
|
19
|
-
$steps-link-color: hsl(0, 0%, 29%) !default;
|
|
20
|
-
$steps-content-padding: 1rem !default;
|
|
21
|
-
$steps-font-size: var(--#{$prefix}base-font-size) !default;
|
|
22
|
-
$steps-details-title-font-weight: 600 !default;
|
|
23
|
-
/* @docs */
|
|
24
|
-
|
|
25
|
-
@mixin steps-size($size, $name: null) {
|
|
26
|
-
$sizeVarName: if($name != null, "size-" + #{$name}, "steps-size");
|
|
27
|
-
|
|
28
|
-
font-size: var(--#{$prefix}#{$sizeVarName}, $size);
|
|
29
|
-
min-height: calc(var(--#{$prefix}#{$sizeVarName}, $size) * 2);
|
|
30
|
-
|
|
31
|
-
.o-steps__divider {
|
|
32
|
-
height: var(--#{$prefix}steps-divider-height, $steps-divider-height);
|
|
33
|
-
top: var(--#{$prefix}#{$sizeVarName}, $size);
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
.o-steps__marker {
|
|
37
|
-
height: calc(var(--#{$prefix}#{$sizeVarName}, $size) * 2);
|
|
38
|
-
width: calc(var(--#{$prefix}#{$sizeVarName}, $size) * 2);
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
.o-steps__title {
|
|
42
|
-
text-align: center;
|
|
43
|
-
z-index: 1;
|
|
44
|
-
background-color: var(
|
|
45
|
-
--#{$prefix}steps-details-background-color,
|
|
46
|
-
$steps-details-background-color
|
|
47
|
-
);
|
|
48
|
-
padding: var(--#{$prefix}steps-details-padding, $steps-details-padding);
|
|
49
|
-
font-size: calc(var(--#{$prefix}#{$sizeVarName}, $size) * 1.2);
|
|
50
|
-
height: var(
|
|
51
|
-
--#{$prefix}steps-details-title-font-weight,
|
|
52
|
-
$steps-details-title-font-weight
|
|
53
|
-
);
|
|
54
|
-
line-height: var(--#{$prefix}#{$sizeVarName}, $size);
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
.o-steps__wrapper-vertical {
|
|
58
|
-
.o-steps--label-right {
|
|
59
|
-
.o-steps__divider {
|
|
60
|
-
left: calc(
|
|
61
|
-
(
|
|
62
|
-
var(--#{$prefix}#{$sizeVarName}, $size) - var(
|
|
63
|
-
--#{$prefix}steps-divider-height,
|
|
64
|
-
$steps-divider-height
|
|
65
|
-
)
|
|
66
|
-
) * 0.5
|
|
67
|
-
);
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
.o-steps--label-left {
|
|
72
|
-
.o-steps__divider {
|
|
73
|
-
left: auto;
|
|
74
|
-
right: calc(
|
|
75
|
-
(
|
|
76
|
-
var(--#{$prefix}#{$sizeVarName}, $size) - var(
|
|
77
|
-
--#{$prefix}steps-divider-height,
|
|
78
|
-
$steps-divider-height
|
|
79
|
-
)
|
|
80
|
-
) * 0.5
|
|
81
|
-
);
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
&.o-steps__wrapper-position-right {
|
|
86
|
-
.o-steps--label-right {
|
|
87
|
-
.o-steps__divider {
|
|
88
|
-
left: calc(
|
|
89
|
-
(
|
|
90
|
-
var(--#{$prefix}#{$sizeVarName}, $size) - var(
|
|
91
|
-
--#{$prefix}steps-divider-height,
|
|
92
|
-
$steps-divider-height
|
|
93
|
-
)
|
|
94
|
-
) * 0.5
|
|
95
|
-
);
|
|
96
|
-
}
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
.o-steps--label-left {
|
|
100
|
-
.o-steps__divider {
|
|
101
|
-
left: auto;
|
|
102
|
-
right: calc(
|
|
103
|
-
(
|
|
104
|
-
var(--#{$prefix}#{$sizeVarName}, $size) - var(
|
|
105
|
-
--#{$prefix}steps-divider-height,
|
|
106
|
-
$steps-divider-height
|
|
107
|
-
)
|
|
108
|
-
) * 0.5
|
|
109
|
-
);
|
|
110
|
-
}
|
|
111
|
-
}
|
|
112
|
-
}
|
|
113
|
-
}
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
.o-steps {
|
|
117
|
-
display: flex;
|
|
118
|
-
flex-wrap: wrap;
|
|
119
|
-
margin: 0;
|
|
120
|
-
padding: 0;
|
|
121
|
-
|
|
122
|
-
@include steps-size($steps-font-size);
|
|
123
|
-
|
|
124
|
-
@each $name, $value in $sizes {
|
|
125
|
-
&--#{$name} {
|
|
126
|
-
@include steps-size($value, $name);
|
|
127
|
-
}
|
|
128
|
-
}
|
|
129
|
-
|
|
130
|
-
&__nav-item {
|
|
131
|
-
position: relative;
|
|
132
|
-
display: flex;
|
|
133
|
-
flex-grow: 1;
|
|
134
|
-
flex-basis: 1em;
|
|
135
|
-
justify-content: center;
|
|
136
|
-
list-style: none;
|
|
137
|
-
margin: 0;
|
|
138
|
-
padding: 0;
|
|
139
|
-
margin-top: 0;
|
|
140
|
-
line-height: var(
|
|
141
|
-
--#{$prefix}steps-item-line-height,
|
|
142
|
-
$steps-item-line-height
|
|
143
|
-
);
|
|
144
|
-
|
|
145
|
-
@each $name, $pair in $colors {
|
|
146
|
-
$color: list.nth($pair, 1);
|
|
147
|
-
$color-invert: list.nth($pair, 2);
|
|
148
|
-
$bgVarName: if(
|
|
149
|
-
$name != null,
|
|
150
|
-
"steps-divider-color-bg-" + #{$name},
|
|
151
|
-
"steps-divider-color-bg"
|
|
152
|
-
);
|
|
153
|
-
$colorVarName: if(
|
|
154
|
-
$name != null,
|
|
155
|
-
"steps-divider-color-" + #{$name},
|
|
156
|
-
"steps-divider-color"
|
|
157
|
-
);
|
|
158
|
-
|
|
159
|
-
&--#{$name} {
|
|
160
|
-
&.o-steps__nav-item-active {
|
|
161
|
-
.o-steps__marker {
|
|
162
|
-
background-color: var(
|
|
163
|
-
--#{$prefix}variant-invert-#{$name},
|
|
164
|
-
$color-invert
|
|
165
|
-
);
|
|
166
|
-
border-color: var(--#{$prefix}variant-#{$name}, $color);
|
|
167
|
-
color: var(--#{$prefix}variant-#{$name}, $color);
|
|
168
|
-
}
|
|
169
|
-
|
|
170
|
-
.o-steps__divider {
|
|
171
|
-
background: linear-gradient(
|
|
172
|
-
to left,
|
|
173
|
-
var(--#{$prefix}#{$bgVarName}, $steps-color) 50%,
|
|
174
|
-
var(--#{$prefix}#{$colorVarName}, $color) 50%
|
|
175
|
-
);
|
|
176
|
-
background-size: 200% 100%;
|
|
177
|
-
}
|
|
178
|
-
}
|
|
179
|
-
|
|
180
|
-
&.o-steps__nav-item-previous {
|
|
181
|
-
.o-steps__marker {
|
|
182
|
-
color: var(--#{$prefix}variant-invert-#{$name}, $color-invert);
|
|
183
|
-
background-color: var(--#{$prefix}variant-#{$name}, $color);
|
|
184
|
-
}
|
|
185
|
-
|
|
186
|
-
.o-steps__divider {
|
|
187
|
-
background: linear-gradient(
|
|
188
|
-
to left,
|
|
189
|
-
var(--#{$prefix}#{$bgVarName}, $steps-color) 50%,
|
|
190
|
-
var(--#{$prefix}#{$colorVarName}, $color) 50%
|
|
191
|
-
);
|
|
192
|
-
background-size: 200% 100%;
|
|
193
|
-
}
|
|
194
|
-
}
|
|
195
|
-
}
|
|
196
|
-
}
|
|
197
|
-
}
|
|
198
|
-
|
|
199
|
-
&__divider {
|
|
200
|
-
background: linear-gradient(
|
|
201
|
-
to left,
|
|
202
|
-
var(--#{$prefix}steps-divider-color-bg, $steps-color) 50%,
|
|
203
|
-
var(--#{$prefix}steps-divider-color, var(--#{$prefix}primary)) 50%
|
|
204
|
-
);
|
|
205
|
-
background-size: 200% 100%;
|
|
206
|
-
background-position: right bottom;
|
|
207
|
-
// This will contain the divider
|
|
208
|
-
content: " ";
|
|
209
|
-
display: block;
|
|
210
|
-
position: absolute;
|
|
211
|
-
bottom: 0;
|
|
212
|
-
left: -50%;
|
|
213
|
-
width: 100%;
|
|
214
|
-
}
|
|
215
|
-
|
|
216
|
-
&__content {
|
|
217
|
-
position: relative;
|
|
218
|
-
overflow: visible;
|
|
219
|
-
display: flex;
|
|
220
|
-
flex-direction: column;
|
|
221
|
-
padding: var(--#{$prefix}steps-content-padding, $steps-content-padding);
|
|
222
|
-
|
|
223
|
-
&-transitioning {
|
|
224
|
-
overflow: hidden;
|
|
225
|
-
}
|
|
226
|
-
}
|
|
227
|
-
|
|
228
|
-
&--animated {
|
|
229
|
-
.o-steps__divider {
|
|
230
|
-
transition: background var(--#{$prefix}transition-duration)
|
|
231
|
-
var(--#{$prefix}transition-timing);
|
|
232
|
-
}
|
|
233
|
-
}
|
|
234
|
-
|
|
235
|
-
&__link {
|
|
236
|
-
display: flex;
|
|
237
|
-
align-items: center;
|
|
238
|
-
justify-content: center;
|
|
239
|
-
flex-direction: column;
|
|
240
|
-
background: transparent;
|
|
241
|
-
border: transparent;
|
|
242
|
-
cursor: pointer;
|
|
243
|
-
text-decoration: none;
|
|
244
|
-
color: var(--#{$prefix}steps-link-color, $steps-link-color);
|
|
245
|
-
|
|
246
|
-
&-label-right {
|
|
247
|
-
flex-direction: row;
|
|
248
|
-
}
|
|
249
|
-
|
|
250
|
-
&-label-left {
|
|
251
|
-
flex-direction: row-reverse;
|
|
252
|
-
}
|
|
253
|
-
|
|
254
|
-
&:hover {
|
|
255
|
-
text-decoration: none;
|
|
256
|
-
}
|
|
257
|
-
|
|
258
|
-
&:not(&-clickable) {
|
|
259
|
-
cursor: not-allowed;
|
|
260
|
-
}
|
|
261
|
-
}
|
|
262
|
-
|
|
263
|
-
&__marker {
|
|
264
|
-
align-items: center;
|
|
265
|
-
display: flex;
|
|
266
|
-
justify-content: center;
|
|
267
|
-
overflow: hidden;
|
|
268
|
-
z-index: 1;
|
|
269
|
-
font-weight: var(
|
|
270
|
-
--#{$prefix}steps-marker-font-weight,
|
|
271
|
-
$steps-marker-font-weight
|
|
272
|
-
);
|
|
273
|
-
background: var(
|
|
274
|
-
--#{$prefix}steps-marker-background,
|
|
275
|
-
$steps-marker-background
|
|
276
|
-
);
|
|
277
|
-
color: var(--#{$prefix}steps-marker-color, $steps-marker-color);
|
|
278
|
-
border: var(--#{$prefix}steps-marker-border, $steps-marker-border);
|
|
279
|
-
|
|
280
|
-
&--rounded {
|
|
281
|
-
border-radius: var(
|
|
282
|
-
--#{$prefix}steps-marker-rounded-border-radius,
|
|
283
|
-
$steps-marker-rounded-border-radius
|
|
284
|
-
);
|
|
285
|
-
}
|
|
286
|
-
}
|
|
287
|
-
|
|
288
|
-
&__details {
|
|
289
|
-
text-align: center;
|
|
290
|
-
z-index: 1;
|
|
291
|
-
padding: var(--#{$prefix}steps-details-padding, $steps-details-padding);
|
|
292
|
-
background-color: var(
|
|
293
|
-
--#{$prefix}steps-details-background-color,
|
|
294
|
-
$steps-details-background-color
|
|
295
|
-
);
|
|
296
|
-
}
|
|
297
|
-
|
|
298
|
-
&__nav-item-active {
|
|
299
|
-
.o-steps__link {
|
|
300
|
-
cursor: default;
|
|
301
|
-
}
|
|
302
|
-
|
|
303
|
-
.o-steps__marker {
|
|
304
|
-
background-color: var(
|
|
305
|
-
--#{$prefix}steps-marker-color,
|
|
306
|
-
$steps-marker-color
|
|
307
|
-
);
|
|
308
|
-
border-color: var(--#{$prefix}steps-active-color, $steps-active-color);
|
|
309
|
-
color: var(--#{$prefix}steps-active-color, $steps-active-color);
|
|
310
|
-
}
|
|
311
|
-
|
|
312
|
-
.o-steps__divider {
|
|
313
|
-
background-position: left bottom;
|
|
314
|
-
}
|
|
315
|
-
}
|
|
316
|
-
|
|
317
|
-
&__nav-item-previous {
|
|
318
|
-
.o-steps__marker {
|
|
319
|
-
color: var(--#{$prefix}steps-marker-color, $steps-marker-color);
|
|
320
|
-
background-color: var(
|
|
321
|
-
--#{$prefix}steps-previous-color,
|
|
322
|
-
$steps-previous-color
|
|
323
|
-
);
|
|
324
|
-
}
|
|
325
|
-
|
|
326
|
-
.o-steps__divider {
|
|
327
|
-
background-position: left bottom;
|
|
328
|
-
}
|
|
329
|
-
}
|
|
330
|
-
|
|
331
|
-
&__item {
|
|
332
|
-
flex-shrink: 0;
|
|
333
|
-
flex-basis: auto;
|
|
334
|
-
}
|
|
335
|
-
|
|
336
|
-
&__wrapper-vertical {
|
|
337
|
-
display: flex;
|
|
338
|
-
flex-direction: row;
|
|
339
|
-
flex-wrap: wrap;
|
|
340
|
-
|
|
341
|
-
.o-steps {
|
|
342
|
-
height: 100%;
|
|
343
|
-
flex-direction: column;
|
|
344
|
-
}
|
|
345
|
-
|
|
346
|
-
.o-steps__divider {
|
|
347
|
-
height: 100%;
|
|
348
|
-
width: var(--#{$prefix}steps-divider-height, $steps-divider-height);
|
|
349
|
-
top: -50%;
|
|
350
|
-
left: calc(50% - #{$steps-divider-height * 0.5});
|
|
351
|
-
}
|
|
352
|
-
|
|
353
|
-
.o-steps__item-active,
|
|
354
|
-
.o-steps__item-previous {
|
|
355
|
-
.o-steps__divider {
|
|
356
|
-
background-position: right top;
|
|
357
|
-
}
|
|
358
|
-
}
|
|
359
|
-
|
|
360
|
-
.o-steps__nav-item {
|
|
361
|
-
width: 100%;
|
|
362
|
-
display: flex;
|
|
363
|
-
align-items: center;
|
|
364
|
-
justify-content: center;
|
|
365
|
-
|
|
366
|
-
padding: var(--#{$prefix}steps-vertical-padding, $steps-vertical-padding);
|
|
367
|
-
|
|
368
|
-
// Override marker connector color per step
|
|
369
|
-
@each $name, $pair in $colors {
|
|
370
|
-
$color: list.nth($pair, 1);
|
|
371
|
-
$bgVarName: if(
|
|
372
|
-
$name != null,
|
|
373
|
-
"steps-divider-color-bg-" + #{$name},
|
|
374
|
-
"steps-divider-color-bg"
|
|
375
|
-
);
|
|
376
|
-
$colorVarName: if(
|
|
377
|
-
$name != null,
|
|
378
|
-
"steps-divider-color-" + #{$name},
|
|
379
|
-
"steps-divider-color"
|
|
380
|
-
);
|
|
381
|
-
|
|
382
|
-
&--#{$name} {
|
|
383
|
-
.o-steps__divider {
|
|
384
|
-
background: linear-gradient(
|
|
385
|
-
to left,
|
|
386
|
-
var(--#{$prefix}#{$bgVarName}, $steps-color) 50%,
|
|
387
|
-
var(--#{$prefix}#{$colorVarName}, $color) 50%
|
|
388
|
-
);
|
|
389
|
-
background-size: 100% 200%;
|
|
390
|
-
background-position: left bottom;
|
|
391
|
-
}
|
|
392
|
-
}
|
|
393
|
-
}
|
|
394
|
-
}
|
|
395
|
-
|
|
396
|
-
.o-steps__content {
|
|
397
|
-
flex-grow: 1;
|
|
398
|
-
flex-basis: 70%;
|
|
399
|
-
}
|
|
400
|
-
|
|
401
|
-
.o-steps__navigation {
|
|
402
|
-
flex-basis: 100%;
|
|
403
|
-
}
|
|
404
|
-
|
|
405
|
-
&.o-steps__wrapper-position-right {
|
|
406
|
-
flex-direction: row-reverse;
|
|
407
|
-
}
|
|
408
|
-
}
|
|
409
|
-
|
|
410
|
-
&--mobile {
|
|
411
|
-
.o-steps__title {
|
|
412
|
-
display: none;
|
|
413
|
-
padding: 0;
|
|
414
|
-
}
|
|
415
|
-
|
|
416
|
-
.o-steps__divider {
|
|
417
|
-
height: var(--#{$prefix}steps-divider-height, $steps-divider-height);
|
|
418
|
-
top: var(--#{$prefix}steps-divider-top, $steps-font-size);
|
|
419
|
-
|
|
420
|
-
@each $name, $value in $sizes {
|
|
421
|
-
.o-steps--#{$name} {
|
|
422
|
-
top: var(--#{$prefix}size-#{$name}, $value);
|
|
423
|
-
}
|
|
424
|
-
}
|
|
425
|
-
}
|
|
426
|
-
}
|
|
427
|
-
}
|
|
@@ -1,150 +0,0 @@
|
|
|
1
|
-
@use "sass:list";
|
|
2
|
-
|
|
3
|
-
/* @docs */
|
|
4
|
-
$switch-active-background-color: var(--#{$prefix}primary) !default;
|
|
5
|
-
$switch-action-background: #f5f5f5 !default;
|
|
6
|
-
$switch-background: var(--#{$prefix}grey-light) !default;
|
|
7
|
-
$switch-border-radius: var(--#{$prefix}base-border-radius) !default;
|
|
8
|
-
$switch-box-shadow:
|
|
9
|
-
0 3px 1px 0 rgba(0, 0, 0, 0.05),
|
|
10
|
-
0 2px 2px 0 rgba(0, 0, 0, 0.1),
|
|
11
|
-
0 3px 3px 0 rgba(0, 0, 0, 0.05) !default;
|
|
12
|
-
$switch-disabled-opacity: var(--#{$prefix}base-disabled-opacity) !default;
|
|
13
|
-
$switch-margin-label: 0.5em !default;
|
|
14
|
-
$switch-padding: 0.2em !default;
|
|
15
|
-
$switch-rounded-border-radius: var(
|
|
16
|
-
--#{$prefix}base-border-radius-rounded
|
|
17
|
-
) !default;
|
|
18
|
-
$switch-width: 2.75 * 1em !default;
|
|
19
|
-
/* @docs */
|
|
20
|
-
|
|
21
|
-
.o-switch {
|
|
22
|
-
@include unselectable;
|
|
23
|
-
cursor: pointer;
|
|
24
|
-
display: inline-flex;
|
|
25
|
-
align-items: center;
|
|
26
|
-
position: relative;
|
|
27
|
-
border-radius: 50rem;
|
|
28
|
-
|
|
29
|
-
// size variants
|
|
30
|
-
@each $name, $value in $sizes {
|
|
31
|
-
&--#{$name} {
|
|
32
|
-
font-size: var(--#{$prefix}font-size-#{name}, $value);
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
// color variants
|
|
37
|
-
@each $name, $pair in $colors {
|
|
38
|
-
$color: list.nth($pair, 1);
|
|
39
|
-
|
|
40
|
-
&--#{$name} {
|
|
41
|
-
--#{$prefix}focus: #{createFocus($color)};
|
|
42
|
-
|
|
43
|
-
.o-switch__check--checked {
|
|
44
|
-
background: var(--#{$prefix}variant-#{$name}, $color);
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
&--#{$name}-passive {
|
|
48
|
-
--#{$prefix}focus: #{createFocus($color)};
|
|
49
|
-
|
|
50
|
-
.o-switch__check:not(.o-switch__check--checked) {
|
|
51
|
-
background: var(--#{$prefix}variant-#{$name}, $color);
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
&__label {
|
|
57
|
-
margin-left: var(--#{$prefix}switch-margin-label, $switch-margin-label);
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
&--left {
|
|
61
|
-
flex-direction: row-reverse;
|
|
62
|
-
|
|
63
|
-
.o-switch__label {
|
|
64
|
-
margin-left: 0;
|
|
65
|
-
margin-right: var(--#{$prefix}switch-margin-label, $switch-margin-label);
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
&__check-switch {
|
|
70
|
-
content: "";
|
|
71
|
-
display: block;
|
|
72
|
-
height: calc(
|
|
73
|
-
(
|
|
74
|
-
var(--#{$prefix}switch-width, $switch-width) - var(
|
|
75
|
-
--#{$prefix}switch-padding,
|
|
76
|
-
$switch-padding
|
|
77
|
-
) * 2
|
|
78
|
-
) * 0.5
|
|
79
|
-
);
|
|
80
|
-
width: calc(
|
|
81
|
-
(
|
|
82
|
-
var(--#{$prefix}switch-width, $switch-width) - var(
|
|
83
|
-
--#{$prefix}switch-padding,
|
|
84
|
-
$switch-padding
|
|
85
|
-
) * 2
|
|
86
|
-
) * 0.5
|
|
87
|
-
);
|
|
88
|
-
background: var(
|
|
89
|
-
--#{$prefix}switch-action-background,
|
|
90
|
-
$switch-action-background
|
|
91
|
-
);
|
|
92
|
-
box-shadow: var(--#{$prefix}switch-box-shadow, $switch-box-shadow);
|
|
93
|
-
transition: transform var(--#{$prefix}transition-duration)
|
|
94
|
-
var(--#{$prefix}transition-timing);
|
|
95
|
-
will-change: transform;
|
|
96
|
-
transform-origin: left;
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
&__check {
|
|
100
|
-
display: flex;
|
|
101
|
-
align-items: center;
|
|
102
|
-
flex-shrink: 0;
|
|
103
|
-
width: var(--#{$prefix}switch-width, $switch-width);
|
|
104
|
-
height: calc(
|
|
105
|
-
var(--#{$prefix}switch-width, $switch-width) * 0.5 +
|
|
106
|
-
var(--#{$prefix}switch-padding, $switch-padding)
|
|
107
|
-
);
|
|
108
|
-
|
|
109
|
-
padding: var(--#{$prefix}switch-padding, $switch-padding);
|
|
110
|
-
background: var(--#{$prefix}switch-background, $switch-background);
|
|
111
|
-
border-radius: var(--#{$prefix}switch-border-radius, $switch-border-radius);
|
|
112
|
-
transition: background var(--#{$prefix}transition-duration)
|
|
113
|
-
var(--#{$prefix}transition-timing);
|
|
114
|
-
|
|
115
|
-
&--checked {
|
|
116
|
-
background: var(
|
|
117
|
-
--#{$prefix}switch-active-background-color,
|
|
118
|
-
$switch-active-background-color
|
|
119
|
-
);
|
|
120
|
-
|
|
121
|
-
.o-switch__check-switch {
|
|
122
|
-
transform: translate3d(100%, 0, 0);
|
|
123
|
-
}
|
|
124
|
-
}
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
&__input {
|
|
128
|
-
position: absolute;
|
|
129
|
-
left: 0;
|
|
130
|
-
opacity: 0;
|
|
131
|
-
z-index: -1;
|
|
132
|
-
}
|
|
133
|
-
|
|
134
|
-
&--rounded {
|
|
135
|
-
border-radius: var(
|
|
136
|
-
--#{$prefix}switch-rounded-border-radius,
|
|
137
|
-
$switch-rounded-border-radius
|
|
138
|
-
);
|
|
139
|
-
}
|
|
140
|
-
|
|
141
|
-
&--disabled {
|
|
142
|
-
opacity: var(--#{$prefix}switch-disabled-opacity, $switch-disabled-opacity);
|
|
143
|
-
}
|
|
144
|
-
|
|
145
|
-
// focus effect
|
|
146
|
-
&:focus &__check,
|
|
147
|
-
&:focus-within &__check {
|
|
148
|
-
box-shadow: 0 0 0 0.25rem var(--#{$prefix}focus);
|
|
149
|
-
}
|
|
150
|
-
}
|