@newlogic-digital/ui 3.0.4 → 3.1.0
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/README.md +6 -10
- package/gulpfile.js +17 -168
- package/package.json +13 -8
- package/src/emails/email.css +3 -3
- package/src/emails/email.twig +1 -1
- package/src/icons.svg +32 -0
- package/src/main.json +12 -10
- package/src/scripts/Components/+.js +2 -2
- package/src/scripts/Components/CookieConsent.js +66 -64
- package/src/scripts/Components/Form.js +28 -21
- package/src/scripts/Layout/+.js +2 -1
- package/src/scripts/Layout/Header.js +18 -0
- package/src/scripts/Layout/Main.js +49 -45
- package/src/scripts/Libraries/+.js +12 -10
- package/src/scripts/Libraries/Anchor.js +18 -43
- package/src/scripts/Libraries/CookieConsent.js +37 -58
- package/src/scripts/Libraries/Dialog.js +56 -55
- package/src/scripts/Libraries/Drawer.js +23 -23
- package/src/scripts/Libraries/NativeSlider.js +86 -86
- package/src/scripts/Libraries/ReCaptcha.js +20 -18
- package/src/scripts/Libraries/Ripple.js +16 -32
- package/src/scripts/Libraries/Stimulus.js +30 -34
- package/src/scripts/Libraries/Swup.js +47 -50
- package/src/scripts/Libraries/Tabs.js +12 -18
- package/src/scripts/Libraries/Tippy.js +118 -0
- package/src/scripts/Ui/+.js +5 -3
- package/src/scripts/Ui/Checkbox.js +19 -0
- package/src/scripts/Ui/Input.js +188 -161
- package/src/scripts/Ui/Radio.js +23 -0
- package/src/scripts/Ui/Select.js +64 -37
- package/src/scripts/Ui/Text.js +25 -0
- package/src/scripts/Utils/Functions/+.js +6 -6
- package/src/scripts/Utils/Functions/dataValue.js +28 -25
- package/src/scripts/Utils/Functions/importScript.js +9 -11
- package/src/scripts/Utils/Functions/importStyle.js +18 -5
- package/src/scripts/Utils/Functions/inView.js +19 -21
- package/src/scripts/Utils/Functions/loadStimulus.js +22 -20
- package/src/scripts/Utils/cdn.js +6 -4
- package/src/scripts/Utils/global.js +10 -33
- package/src/scripts/main.js +6 -6
- package/src/styles/Components/CookieConsent.css +40 -179
- package/src/styles/Components/Dialog/Default.css +12 -15
- package/src/styles/Components/Form/CookieConsent.css +7 -12
- package/src/styles/Layout/+.css +2 -0
- package/src/{templates/Sections/.gitkeep → styles/Layout/Header.css} +0 -0
- package/src/styles/Layout/Main.css +28 -63
- package/src/styles/Layout/Nav.css +43 -0
- package/src/styles/Libraries/+.css +1 -1
- package/src/styles/Libraries/Datepicker.css +85 -39
- package/src/styles/Libraries/Dialog.css +6 -5
- package/src/styles/Libraries/Drawer.css +15 -14
- package/src/styles/Libraries/Hint.css +29 -23
- package/src/styles/Libraries/Lazysizes.css +2 -1
- package/src/styles/Libraries/NativeSlider.css +18 -17
- package/src/styles/Libraries/Ripple.css +8 -5
- package/src/styles/Libraries/Tabs.css +4 -4
- package/src/styles/Libraries/Tippy.css +87 -0
- package/src/styles/Ui/+.css +5 -1
- package/src/styles/Ui/Badge.css +33 -19
- package/src/styles/Ui/Btn.css +80 -53
- package/src/styles/Ui/Checkbox.css +80 -41
- package/src/styles/Ui/Dropdown.css +5 -0
- package/src/styles/Ui/Heading.css +12 -12
- package/src/styles/Ui/Icon.css +27 -8
- package/src/styles/Ui/Image.css +23 -0
- package/src/styles/Ui/Input.css +295 -220
- package/src/styles/Ui/Label.css +14 -0
- package/src/styles/Ui/Link.css +3 -3
- package/src/styles/Ui/Notice.css +14 -16
- package/src/styles/Ui/Progress.css +10 -21
- package/src/styles/Ui/Radio.css +3 -8
- package/src/styles/Ui/Select.css +63 -112
- package/src/styles/Ui/Switch.css +70 -0
- package/src/styles/Ui/{Wsw.css → Text.css} +61 -80
- package/src/styles/Ui/Title.css +8 -4
- package/src/styles/Utils/default.css +75 -67
- package/src/styles/Utils/icons.css +9 -0
- package/src/styles/Utils/keyframes.css +182 -0
- package/src/styles/Utils/normalize.css +223 -0
- package/src/styles/Utils/print.css +1 -1
- package/src/styles/Utils/tailwind/base.css +15 -0
- package/src/styles/Utils/tailwind/gutters.css +264 -263
- package/src/styles/Utils/theme/main.css +24 -21
- package/src/styles/Utils/vars.css +58 -35
- package/src/styles/Utils/vendor.css +1 -2
- package/src/styles/main.css +6 -3
- package/src/styles/tailwind.css +1 -4
- package/src/templates/Components/CookieConsent.twig +30 -0
- package/src/templates/Components/Dialogs/Basic.twig +7 -3
- package/src/templates/Layout/Header.twig +42 -0
- package/src/templates/Layout/Main.twig +52 -67
- package/src/templates/Sections/Gdpr.twig +64 -0
- package/src/templates/Sections/Ui.twig +2104 -0
- package/src/templates/dialog-basic.twig +2 -2
- package/src/templates/gdpr.json +11 -0
- package/src/templates/index.json +8 -2
- package/src/templates/json-tippy.twig +16 -0
- package/src/templates/ui.json +11 -0
- package/CHANGELOG +0 -231
- package/src/icons/iconfont.css +0 -171
- package/src/icons/selection.json +0 -1
- package/src/icons/variables.css +0 -31
- package/src/scripts/Ui/Wsw.js +0 -25
- package/src/scripts/Utils/Functions/bodyLoaded.js +0 -12
- package/src/styles/Libraries/Animate.css +0 -184
- package/src/styles/Utils/reference.css +0 -2
- package/src/styles/Utils/tailwind/content.css +0 -24
- package/src/styles/Utils/theme/vars.css +0 -19
- package/src/styles/preload.css +0 -29
package/src/styles/Ui/Notice.css
CHANGED
|
@@ -1,15 +1,20 @@
|
|
|
1
1
|
.ui-notice {
|
|
2
|
+
--color-current: var(--color-accent);
|
|
3
|
+
--ui-notice-bg: rgb(var(--color-accent));
|
|
4
|
+
--ui-notice-outline-opacity: 0.1;
|
|
2
5
|
--ui-notice-size: 0.875rem;
|
|
3
6
|
--ui-notice-py: 1.25rem;
|
|
4
7
|
--ui-notice-px: 1.5rem;
|
|
8
|
+
|
|
5
9
|
position: relative;
|
|
6
10
|
z-index: 1;
|
|
7
11
|
padding: var(--ui-notice-py) var(--ui-notice-px);
|
|
8
12
|
font-size: var(--ui-notice-size);
|
|
9
13
|
border-radius: var(--radius);
|
|
14
|
+
color: rgb(var(--color-current));
|
|
10
15
|
|
|
11
16
|
&:not([class*="bg-"]) {
|
|
12
|
-
|
|
17
|
+
&::before, &::after {
|
|
13
18
|
position: absolute;
|
|
14
19
|
inset: 0;
|
|
15
20
|
width: 100%;
|
|
@@ -19,31 +24,24 @@
|
|
|
19
24
|
content: "";
|
|
20
25
|
}
|
|
21
26
|
|
|
22
|
-
|
|
23
|
-
background-color:
|
|
24
|
-
opacity:
|
|
27
|
+
&::before {
|
|
28
|
+
background-color: var(--ui-notice-bg);
|
|
29
|
+
opacity: var(--ui-notice-outline-opacity);
|
|
25
30
|
}
|
|
26
31
|
|
|
27
|
-
|
|
28
|
-
box-shadow: inset 0 0 0 1px
|
|
29
|
-
opacity:
|
|
32
|
+
&::after {
|
|
33
|
+
box-shadow: inset 0 0 0 1px var(--ui-notice-bg);
|
|
34
|
+
opacity: var(--ui-notice-outline-opacity);
|
|
30
35
|
}
|
|
31
36
|
}
|
|
32
37
|
|
|
33
|
-
& hr {
|
|
34
|
-
opacity: 0.1;
|
|
35
|
-
}
|
|
36
|
-
|
|
37
38
|
& a {
|
|
38
39
|
text-decoration: underline;
|
|
39
40
|
transition: var(--transition-opacity);
|
|
40
|
-
|
|
41
|
-
&:not([class*="text-"]) {
|
|
42
|
-
color: currentColor !important;
|
|
43
|
-
}
|
|
41
|
+
color: currentColor !important;
|
|
44
42
|
|
|
45
43
|
@nest .no-touch &[href]:hover {
|
|
46
44
|
opacity: 0.8;
|
|
47
45
|
}
|
|
48
46
|
}
|
|
49
|
-
}
|
|
47
|
+
}
|
|
@@ -3,29 +3,27 @@
|
|
|
3
3
|
--ui-progress-radius: 9999px;
|
|
4
4
|
--ui-progress-bg: var(--color-background-200);
|
|
5
5
|
--ui-progress-bg-opacity: 1;
|
|
6
|
-
|
|
6
|
+
|
|
7
7
|
appearance: none;
|
|
8
8
|
box-shadow: none;
|
|
9
9
|
border: 0;
|
|
10
10
|
height: var(--ui-progress-height);
|
|
11
11
|
border-radius: var(--ui-progress-radius);
|
|
12
|
-
background-color:
|
|
13
|
-
color:
|
|
12
|
+
background-color: rgb(var(--ui-progress-bg) / var(--ui-progress-bg-opacity));
|
|
13
|
+
color: rgb(var(--color-accent));
|
|
14
14
|
width: 100%;
|
|
15
15
|
|
|
16
16
|
@nest .bg-dark & {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
&::-webkit-progress-bar {
|
|
20
|
-
background-color: rgba(var(--color-light), 0.1);
|
|
17
|
+
&, &::-webkit-progress-bar {
|
|
18
|
+
background-color: rgb(var(--color-light) / 0.1);
|
|
21
19
|
}
|
|
22
20
|
}
|
|
23
21
|
|
|
24
|
-
|
|
22
|
+
&:--size-sm {
|
|
25
23
|
--ui-progress-height: 0.5rem;
|
|
26
24
|
}
|
|
27
25
|
|
|
28
|
-
|
|
26
|
+
&:--size-lg {
|
|
29
27
|
--ui-progress-height: 1.5rem;
|
|
30
28
|
}
|
|
31
29
|
|
|
@@ -44,24 +42,15 @@
|
|
|
44
42
|
}
|
|
45
43
|
|
|
46
44
|
&:indeterminate {
|
|
47
|
-
animation: 1.5s
|
|
48
|
-
background-image: linear-gradient(to right, currentColor 30%,
|
|
45
|
+
animation: 1.5s linear 0s forwards infinite move-indeterminate;
|
|
46
|
+
background-image: linear-gradient(to right, currentColor 30%, rgb(var(--ui-progress-bg) / var(--ui-progress-bg-opacity)) 30%);
|
|
49
47
|
background-position: top left;
|
|
50
48
|
background-repeat: no-repeat;
|
|
51
49
|
background-size: 150% 150%;
|
|
52
|
-
border-radius:
|
|
50
|
+
border-radius: var(--ui-progress-radius);
|
|
53
51
|
|
|
54
52
|
&::-moz-progress-bar {
|
|
55
53
|
background-color: transparent;
|
|
56
54
|
}
|
|
57
55
|
}
|
|
58
56
|
}
|
|
59
|
-
|
|
60
|
-
@keyframes moveIndeterminate {
|
|
61
|
-
from {
|
|
62
|
-
background-position: 200% 0
|
|
63
|
-
}
|
|
64
|
-
to {
|
|
65
|
-
background-position: -200% 0
|
|
66
|
-
}
|
|
67
|
-
}
|
package/src/styles/Ui/Radio.css
CHANGED
package/src/styles/Ui/Select.css
CHANGED
|
@@ -1,54 +1,37 @@
|
|
|
1
1
|
.ui-select {
|
|
2
|
-
--ui-select-height: 3rem;
|
|
3
|
-
--ui-select-py: 0.25rem;
|
|
4
|
-
--ui-select-px: 1rem;
|
|
5
|
-
--ui-select-size: 0.875rem;
|
|
6
|
-
--ui-select-weight: var(--font-medium);
|
|
7
|
-
--ui-select-border-color: var(--color-default);
|
|
8
|
-
--ui-select-border-opacity: 0.15;
|
|
9
|
-
|
|
10
|
-
position: relative;
|
|
11
|
-
display: block;
|
|
12
|
-
font-size: var(--ui-select-size);
|
|
13
2
|
cursor: pointer;
|
|
3
|
+
user-select: none;
|
|
14
4
|
|
|
15
|
-
|
|
16
|
-
|
|
5
|
+
&:--state-active {
|
|
6
|
+
& label {
|
|
7
|
+
transform: translateY(calc(var(--ui-input-size) / 1.4 * -1)) scale(0.8);
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
&::after {
|
|
12
|
+
width: 1em;
|
|
13
|
+
height: 1em;
|
|
14
|
+
background-color: currentColor;
|
|
15
|
+
content: "";
|
|
17
16
|
position: absolute;
|
|
18
17
|
z-index: 1;
|
|
19
18
|
font-size: 1.5rem;
|
|
20
|
-
right:
|
|
21
|
-
top:
|
|
19
|
+
right: calc(var(--ui-input-height) / 4);
|
|
20
|
+
top: calc(var(--ui-input-height) / 2);
|
|
22
21
|
margin-top: -0.75rem;
|
|
23
22
|
will-change: transform;
|
|
24
23
|
transition: transform 200ms;
|
|
25
|
-
|
|
24
|
+
mask: var(--icon-angle-down);
|
|
26
25
|
pointer-events: none;
|
|
27
26
|
|
|
28
|
-
@nest
|
|
29
|
-
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
@nest [data-state*="focus"]& {
|
|
33
|
-
@nest .no-touch & {
|
|
27
|
+
@nest :--state-focus& {
|
|
28
|
+
@nest .no-touch:not(.macintel) & {
|
|
34
29
|
transform: rotate(180deg);
|
|
35
30
|
}
|
|
36
31
|
}
|
|
37
32
|
}
|
|
38
33
|
|
|
39
34
|
& select {
|
|
40
|
-
width: 100%;
|
|
41
|
-
transition: var(--transition-border);
|
|
42
|
-
box-shadow: none;
|
|
43
|
-
line-height: normal;
|
|
44
|
-
background-color: transparent;
|
|
45
|
-
font-size: inherit;
|
|
46
|
-
height: var(--ui-select-height);
|
|
47
|
-
font-weight: var(--ui-select-weight);
|
|
48
|
-
border-radius: var(--radius);
|
|
49
|
-
padding: calc(var(--ui-select-height) / 2.5) var(--ui-select-px) var(--ui-select-py);
|
|
50
|
-
color: inherit;
|
|
51
|
-
border: 1px solid rgba(var(--ui-select-border-color), var(--ui-select-border-opacity));
|
|
52
35
|
position: relative;
|
|
53
36
|
z-index: 1;
|
|
54
37
|
text-overflow: ellipsis;
|
|
@@ -56,30 +39,31 @@
|
|
|
56
39
|
-webkit-appearance: none;
|
|
57
40
|
-moz-appearance: none;
|
|
58
41
|
|
|
59
|
-
@nest :not([data-state*="placeholder"])& {
|
|
60
|
-
&[data-placeholder] {
|
|
61
|
-
padding-top: var(--ui-select-py);
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
&[disabled] {
|
|
66
|
-
cursor: default;
|
|
67
|
-
background-color: rgb(var(--color-background-100));
|
|
68
|
-
}
|
|
69
|
-
|
|
70
42
|
@nest [tabindex]& {
|
|
71
43
|
pointer-events: none;
|
|
72
44
|
}
|
|
73
45
|
|
|
74
|
-
@nest [
|
|
75
|
-
|
|
76
|
-
border-
|
|
77
|
-
|
|
78
|
-
|
|
46
|
+
@nest [tabindex]:--state-focus& {
|
|
47
|
+
--ui-input-border-opacity: 1;
|
|
48
|
+
--ui-input-border-color: var(--color-accent);
|
|
49
|
+
|
|
50
|
+
box-shadow:
|
|
51
|
+
0 0 0 0 rgb(var(--color-current)),
|
|
52
|
+
0 0 0 3px rgb(var(--color-accent) / 0.15),
|
|
53
|
+
0 1px 2px 0 rgb(var(--color-current) / 0.05);
|
|
54
|
+
|
|
55
|
+
@nest .dark & {
|
|
56
|
+
box-shadow:
|
|
57
|
+
0 0 0 0 rgb(var(--color-current)),
|
|
58
|
+
0 0 0 3px rgb(var(--color-accent) / 0.3),
|
|
59
|
+
0 1px 2px 0 rgb(var(--color-current) / 0.05);
|
|
60
|
+
}
|
|
79
61
|
}
|
|
80
62
|
|
|
81
|
-
@nest
|
|
82
|
-
|
|
63
|
+
@nest :not(:--state-active)& {
|
|
64
|
+
&:not([data-placeholder]) {
|
|
65
|
+
font-size: 0;
|
|
66
|
+
}
|
|
83
67
|
}
|
|
84
68
|
|
|
85
69
|
&:focus {
|
|
@@ -87,76 +71,53 @@
|
|
|
87
71
|
}
|
|
88
72
|
|
|
89
73
|
&:-moz-focusring {
|
|
90
|
-
color:
|
|
74
|
+
color: inherit;
|
|
91
75
|
text-shadow: 0 0 0 #000;
|
|
92
76
|
}
|
|
93
|
-
|
|
94
|
-
&:not([data-placeholder]) {
|
|
95
|
-
@nest :not([data-state*="active"])& {
|
|
96
|
-
font-size: 0;
|
|
97
|
-
}
|
|
98
|
-
}
|
|
99
77
|
}
|
|
100
78
|
|
|
101
79
|
& option {
|
|
102
|
-
font-size: var(--ui-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
color: inherit;
|
|
106
|
-
}
|
|
80
|
+
font-size: var(--ui-input-size);
|
|
81
|
+
color: rgb(var(--color-default));
|
|
82
|
+
background-color: rgb(var(--color-background));
|
|
107
83
|
|
|
108
84
|
&[disabled] {
|
|
109
85
|
opacity: 0.5;
|
|
110
86
|
}
|
|
111
87
|
}
|
|
112
88
|
|
|
113
|
-
&[
|
|
114
|
-
|
|
115
|
-
|
|
89
|
+
& > [class^="icon-"] {
|
|
90
|
+
&.icon-r {
|
|
91
|
+
right: calc(var(--ui-input-px) + var(--ui-input-icon-size) + var(--ui-input-icon-spacing));
|
|
116
92
|
}
|
|
117
93
|
}
|
|
118
94
|
|
|
119
|
-
&
|
|
120
|
-
|
|
121
|
-
position: absolute;
|
|
122
|
-
z-index: 1;
|
|
123
|
-
pointer-events: none;
|
|
124
|
-
transition: transform .4s cubic-bezier(.25, .8, .25, 1), var(--transition-color);
|
|
125
|
-
transform-origin: 0 50%;
|
|
126
|
-
white-space: nowrap;
|
|
127
|
-
text-overflow: ellipsis;
|
|
128
|
-
overflow: hidden;
|
|
129
|
-
transform: perspective(100px);
|
|
130
|
-
will-change: transform;
|
|
131
|
-
font-weight: var(--ui-select-weight);
|
|
132
|
-
left: var(--ui-select-px);
|
|
133
|
-
right: var(--ui-select-px);
|
|
134
|
-
top: calc(var(--ui-select-height) / 2);
|
|
135
|
-
line-height: var(--ui-select-size);
|
|
136
|
-
margin-top: calc(var(--ui-select-size) / 2 * -1);
|
|
137
|
-
|
|
138
|
-
@nest html.ie & {
|
|
139
|
-
display: none;
|
|
140
|
-
}
|
|
141
|
-
}
|
|
95
|
+
& > div[aria-hidden] {
|
|
96
|
+
--color-current: var(--color-default);
|
|
142
97
|
|
|
143
|
-
|
|
144
|
-
border-radius: var(--radius);
|
|
98
|
+
will-change: transform;
|
|
99
|
+
border-radius: var(--ui-input-radius);
|
|
145
100
|
position: absolute;
|
|
146
101
|
background-color: rgb(var(--color-background));
|
|
147
|
-
z-index:
|
|
102
|
+
z-index: 100;
|
|
148
103
|
left: 0;
|
|
149
104
|
right: 0;
|
|
150
105
|
top: 100%;
|
|
151
|
-
|
|
152
|
-
border
|
|
106
|
+
margin-top: 0.5rem;
|
|
107
|
+
border: 1px solid rgb(var(--color-current) / 0.075);
|
|
153
108
|
transform: scaleY(0);
|
|
154
109
|
opacity: 0;
|
|
155
110
|
transition: var(--transition-opacity), var(--transition-transform);
|
|
111
|
+
transition-timing-function: cubic-bezier(0.54, 1.5, 0.38, 1.11);
|
|
112
|
+
transition-duration: 200ms;
|
|
113
|
+
backface-visibility: hidden;
|
|
156
114
|
transform-origin: center top;
|
|
157
115
|
user-select: none;
|
|
158
|
-
|
|
159
|
-
|
|
116
|
+
max-height: 12rem;
|
|
117
|
+
overflow-y: auto;
|
|
118
|
+
box-shadow: 0 0.15em 1.5em 0 rgb(var(--color-dark) / 0.05), 0 0 1em 0 rgb(var(--color-dark) / 0.05);
|
|
119
|
+
padding: 0.375rem;
|
|
120
|
+
color: rgb(var(--color-current));
|
|
160
121
|
|
|
161
122
|
@nest [data-state*="focus"]& {
|
|
162
123
|
opacity: 1;
|
|
@@ -164,25 +125,15 @@
|
|
|
164
125
|
}
|
|
165
126
|
|
|
166
127
|
& [data-option] {
|
|
167
|
-
padding: var(--ui-
|
|
128
|
+
padding: calc(var(--ui-input-px) / 1.5) var(--ui-input-px);
|
|
168
129
|
cursor: pointer;
|
|
169
130
|
transition: var(--transition-background);
|
|
170
|
-
font-size: var(--ui-
|
|
131
|
+
font-size: var(--ui-input-size);
|
|
132
|
+
border-radius: var(--radius);
|
|
171
133
|
|
|
172
|
-
@nest .no-touch &:hover,
|
|
173
|
-
background-color:
|
|
134
|
+
@nest .no-touch &:is(:hover, :focus) {
|
|
135
|
+
background-color: rgb(var(--color-accent) / 0.1);
|
|
174
136
|
}
|
|
175
137
|
}
|
|
176
138
|
}
|
|
177
139
|
}
|
|
178
|
-
|
|
179
|
-
@media screen and (min-width: 0 \0) and (min-resolution: +72dpi) {
|
|
180
|
-
.ui-select:after {
|
|
181
|
-
content: "";
|
|
182
|
-
}
|
|
183
|
-
|
|
184
|
-
select {
|
|
185
|
-
padding: 0.5rem !important;
|
|
186
|
-
min-width: 4rem;
|
|
187
|
-
}
|
|
188
|
-
}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
.ui-switch {
|
|
2
|
+
--ui-switch-width: 3rem;
|
|
3
|
+
--ui-switch-height: 1.5rem;
|
|
4
|
+
--ui-switch-padding: 0.375rem;
|
|
5
|
+
--ui-swtich-bg: var(--color-dark);
|
|
6
|
+
--ui-swtich-bg-opacity: 0.2;
|
|
7
|
+
--ui-swtich-fg: var(--color-accent);
|
|
8
|
+
--ui-switch-radius: 999px;
|
|
9
|
+
|
|
10
|
+
@nest .dark & {
|
|
11
|
+
--ui-swtich-bg: var(--color-background-300);
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
display: inline-flex;
|
|
15
|
+
color: rgb(var(--ui-swtich-fg));
|
|
16
|
+
position: relative;
|
|
17
|
+
|
|
18
|
+
&:--size-sm {
|
|
19
|
+
--ui-switch-width: 2.5rem;
|
|
20
|
+
--ui-switch-height: 1.25rem;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
&:--size-lg {
|
|
24
|
+
--ui-switch-width: 4rem;
|
|
25
|
+
--ui-switch-height: 2rem;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
& input {
|
|
29
|
+
width: var(--ui-switch-width);
|
|
30
|
+
height: var(--ui-switch-height);
|
|
31
|
+
display: block;
|
|
32
|
+
position: relative;
|
|
33
|
+
border-radius: var(--ui-switch-radius);
|
|
34
|
+
background-color: rgb(var(--ui-swtich-bg));
|
|
35
|
+
transition: var(--transition-background);
|
|
36
|
+
cursor: pointer;
|
|
37
|
+
appearance: none;
|
|
38
|
+
outline: none;
|
|
39
|
+
color: inherit;
|
|
40
|
+
|
|
41
|
+
&[disabled] {
|
|
42
|
+
opacity: 0.8;
|
|
43
|
+
pointer-events: none;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
&::before {
|
|
47
|
+
width: calc(var(--ui-switch-height) - var(--ui-switch-padding));
|
|
48
|
+
height: calc(var(--ui-switch-height) - var(--ui-switch-padding));
|
|
49
|
+
background-color: rgb(var(--color-light));
|
|
50
|
+
border-radius: var(--ui-switch-radius);
|
|
51
|
+
position: absolute;
|
|
52
|
+
left: var(--ui-switch-height);
|
|
53
|
+
top: 50%;
|
|
54
|
+
content: "";
|
|
55
|
+
display: block;
|
|
56
|
+
margin-left: calc((var(--ui-switch-height) - var(--ui-switch-padding) + var(--ui-switch-padding) / 2) * -1);
|
|
57
|
+
transition: left var(--transition), var(--transition-background);
|
|
58
|
+
transform: translateY(-50%);
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
&:checked {
|
|
62
|
+
background-color: currentColor;
|
|
63
|
+
|
|
64
|
+
&::before {
|
|
65
|
+
background-color: rgb(var(--color-light));
|
|
66
|
+
left: 100%;
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
}
|