@shortfuse/materialdesignweb 0.7.0 → 0.7.1-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.
Files changed (141) hide show
  1. package/bin/generate-css.js +1 -2
  2. package/components/Badge.js +40 -3
  3. package/components/Body.js +16 -2
  4. package/components/BottomAppBar.js +25 -2
  5. package/components/Box.js +33 -3
  6. package/components/Button.js +146 -9
  7. package/components/Card.js +111 -3
  8. package/components/Checkbox.js +91 -3
  9. package/components/CheckboxIcon.js +92 -4
  10. package/components/Chip.js +38 -2
  11. package/components/Dialog.js +237 -3
  12. package/components/DialogActions.js +3 -2
  13. package/components/Divider.js +44 -3
  14. package/components/ExtendedFab.js +27 -2
  15. package/components/Fab.js +26 -2
  16. package/components/FilterChip.js +83 -2
  17. package/components/Headline.js +16 -2
  18. package/components/Icon.js +80 -4
  19. package/components/IconButton.js +153 -2
  20. package/components/Label.js +16 -2
  21. package/components/Layout.js +21 -3
  22. package/components/List.js +15 -2
  23. package/components/ListItem.js +229 -3
  24. package/components/ListOption.js +37 -3
  25. package/components/ListSelect.js +12 -2
  26. package/components/Menu.js +173 -3
  27. package/components/MenuItem.js +55 -2
  28. package/components/Nav.js +19 -2
  29. package/components/NavBar.js +37 -2
  30. package/components/NavBarItem.js +44 -2
  31. package/components/NavDrawer.js +34 -2
  32. package/components/NavDrawerItem.js +44 -2
  33. package/components/NavItem.js +183 -3
  34. package/components/NavRail.js +50 -2
  35. package/components/NavRailItem.js +25 -2
  36. package/components/Pane.js +263 -3
  37. package/components/Progress.js +469 -10
  38. package/components/Radio.js +97 -3
  39. package/components/RadioIcon.js +77 -5
  40. package/components/Ripple.js +76 -3
  41. package/components/SegmentedButton.js +97 -2
  42. package/components/SegmentedButtonGroup.js +15 -2
  43. package/components/Select.js +54 -2
  44. package/components/Shape.js +55 -18
  45. package/components/Slider.js +309 -3
  46. package/components/Snackbar.js +82 -2
  47. package/components/Surface.js +13 -4
  48. package/components/Switch.js +67 -4
  49. package/components/SwitchIcon.js +272 -5
  50. package/components/Tab.js +87 -3
  51. package/components/TabContent.js +21 -21
  52. package/components/TabList.js +131 -2
  53. package/components/TextArea.js +97 -3
  54. package/components/Title.js +16 -2
  55. package/components/Tooltip.js +42 -2
  56. package/components/TopAppBar.js +212 -3
  57. package/core/template.js +36 -9
  58. package/index.js +77 -0
  59. package/mixins/ControlMixin.js +65 -2
  60. package/mixins/DensityMixin.js +17 -3
  61. package/mixins/FlexableMixin.js +81 -3
  62. package/mixins/RippleMixin.js +15 -4
  63. package/mixins/ShapeMixin.js +279 -8
  64. package/mixins/StateMixin.js +87 -5
  65. package/mixins/SurfaceMixin.js +152 -3
  66. package/mixins/TextFieldMixin.js +661 -2
  67. package/mixins/ThemableMixin.js +206 -3
  68. package/mixins/TooltipTriggerMixin.js +30 -4
  69. package/mixins/TouchTargetMixin.js +29 -4
  70. package/package.json +3 -1
  71. package/theming/index.js +0 -121
  72. package/theming/loader.js +0 -2
  73. package/utils/svg.js +0 -117
  74. package/components/Badge.css +0 -30
  75. package/components/Body.css +0 -14
  76. package/components/BottomAppBar.css +0 -23
  77. package/components/Box.css +0 -31
  78. package/components/Button.css +0 -146
  79. package/components/Card.css +0 -109
  80. package/components/Checkbox.css +0 -77
  81. package/components/CheckboxIcon.css +0 -89
  82. package/components/Chip.css +0 -35
  83. package/components/Dialog.css +0 -235
  84. package/components/Divider.css +0 -41
  85. package/components/ExtendedFab.css +0 -24
  86. package/components/Fab.css +0 -23
  87. package/components/FilterChip.css +0 -80
  88. package/components/Headline.css +0 -14
  89. package/components/Icon.css +0 -76
  90. package/components/IconButton.css +0 -151
  91. package/components/Label.css +0 -14
  92. package/components/Layout.css +0 -19
  93. package/components/List.css +0 -12
  94. package/components/ListItem.css +0 -224
  95. package/components/ListOption.css +0 -34
  96. package/components/ListSelect.css +0 -9
  97. package/components/Menu.css +0 -171
  98. package/components/MenuItem.css +0 -53
  99. package/components/Nav.css +0 -17
  100. package/components/NavBar.css +0 -34
  101. package/components/NavBarItem.css +0 -41
  102. package/components/NavDrawer.css +0 -31
  103. package/components/NavDrawerItem.css +0 -42
  104. package/components/NavItem.css +0 -181
  105. package/components/NavRail.css +0 -47
  106. package/components/NavRailItem.css +0 -25
  107. package/components/Outline.css +0 -138
  108. package/components/Pane.css +0 -261
  109. package/components/Progress.css +0 -74
  110. package/components/ProgressCircle.css +0 -226
  111. package/components/ProgressLine.css +0 -155
  112. package/components/Radio.css +0 -83
  113. package/components/RadioIcon.css +0 -73
  114. package/components/Ripple.css +0 -74
  115. package/components/SegmentedButton.css +0 -94
  116. package/components/SegmentedButtonGroup.css +0 -12
  117. package/components/Select.css +0 -52
  118. package/components/Shape.css +0 -132
  119. package/components/Slider.css +0 -306
  120. package/components/Snackbar.css +0 -80
  121. package/components/Surface.css +0 -10
  122. package/components/Switch.css +0 -63
  123. package/components/SwitchIcon.css +0 -177
  124. package/components/SwitchIconAnimations.css +0 -89
  125. package/components/Tab.css +0 -85
  126. package/components/TabList.css +0 -129
  127. package/components/TextArea.css +0 -93
  128. package/components/Title.css +0 -14
  129. package/components/Tooltip.css +0 -40
  130. package/components/TopAppBar.css +0 -209
  131. package/mixins/ControlMixin.css +0 -57
  132. package/mixins/DensityMixin.css +0 -40
  133. package/mixins/FlexableMixin.css +0 -79
  134. package/mixins/RippleMixin.css +0 -12
  135. package/mixins/ShapeMixin.css +0 -135
  136. package/mixins/StateMixin.css +0 -82
  137. package/mixins/SurfaceMixin.css +0 -150
  138. package/mixins/TextFieldMixin.css +0 -657
  139. package/mixins/ThemableMixin.css +0 -204
  140. package/mixins/TooltipTriggerMixin.css +0 -27
  141. package/mixins/TouchTargetMixin.css +0 -26
@@ -1,306 +0,0 @@
1
- /* https://m3.material.io/components/sliders/specs */
2
-
3
- :host {
4
- --mdw-ink: var(--mdw-color__on-primary);
5
- --mdw-bg: var(--mdw-color__primary);
6
-
7
- display: block;
8
-
9
- min-block-size: 40px;
10
- min-inline-size: 88px;
11
-
12
- background-color: transparent;
13
- }
14
-
15
- :host,
16
- :host([color]) {
17
- background-color: transparent;
18
- }
19
-
20
- #label {
21
- position: absolute;
22
- inset: 0;
23
-
24
- display: block;
25
-
26
- cursor: pointer;
27
-
28
- z-index: 1;
29
-
30
- /* border-radius: 50%; */
31
- color: rgb(var(--mdw-bg));
32
- }
33
-
34
- #control {
35
- inset:0;
36
-
37
- overflow: visible;
38
-
39
- block-size: 100%;
40
- min-block-size: 0;
41
- inline-size: 100%;
42
- min-inline-size: 0;
43
-
44
- appearance: none;
45
-
46
- cursor: inherit;
47
-
48
- transform: none;
49
-
50
- background-color: transparent;
51
- color: inherit;
52
- }
53
-
54
- #control::-webkit-slider-runnable-track {
55
- /* stylelint-disable-next-line declaration-property-value-disallowed-list */
56
- margin-inline: -10px;
57
-
58
- appearance: none;
59
-
60
- background-color: transparent;
61
- }
62
-
63
- @supports (-moz-appearance:none ){
64
- #control {
65
- inset-inline: -10px;
66
-
67
- inline-size: calc(100% + 20px);
68
- }
69
- }
70
-
71
- #control::-moz-range-track {
72
- inline-size: calc(100% + 20px) !important;
73
-
74
- appearance: none;
75
- }
76
-
77
- #control::-webkit-slider-thumb {
78
- display: block;
79
-
80
- block-size: 20px;
81
- inline-size: 20px;
82
-
83
- -webkit-appearance: none;
84
- cursor: inherit;
85
-
86
- transform: scale(2);
87
-
88
- background-color: transparent; /* Safari */
89
-
90
- border-radius: 50%;
91
- box-shadow: none; /* Safari */
92
- }
93
-
94
- #control::-moz-range-thumb {
95
- display: block;
96
-
97
- box-sizing: content-box;
98
- block-size: 20px;
99
- inline-size: 20px;
100
- border: none;
101
-
102
- appearance: none;
103
- cursor: inherit;
104
-
105
- transform: scale(2);
106
-
107
- background-color: transparent;
108
- border-radius: 50%;
109
- }
110
-
111
- #track {
112
- --value: 0.5;
113
- position: absolute;
114
- inset-block-start: 50%;
115
- inset-inline: 0;
116
-
117
- block-size: 4px;
118
- margin-block-start: -2px;
119
-
120
- pointer-events: none;
121
- user-select: none;
122
-
123
- background-color: rgb(var(--mdw-color__surface-variant));
124
- border-radius: inherit;
125
- }
126
-
127
- #thumb {
128
- position: absolute;
129
- inset-block-start: -18px;
130
- inset-inline-start: -20px;
131
-
132
- display: flex;
133
- align-items: center;
134
- justify-content: center;
135
- overflow: hidden;
136
-
137
- block-size: 40px;
138
- inline-size: 40px;
139
-
140
- pointer-events: none;
141
-
142
- border-radius: 50%;
143
-
144
- color: rgb(var(--mdw-bg));
145
- }
146
-
147
- #thumb::before {
148
- content: '';
149
-
150
- display: block;
151
-
152
- block-size: 20px;
153
- inline-size: 20px;
154
-
155
- background-color: currentColor;
156
- border-radius: 50%;
157
-
158
- transition: background-color 100ms;
159
- }
160
-
161
- /* Inactive ticks */
162
-
163
- #ticks::before,
164
- #ticks::after {
165
- content: '';
166
-
167
- position: absolute;
168
- inset: 0;
169
-
170
- padding-inline: 10px;
171
-
172
- background-clip: content-box;
173
- /* stylelint-disable-next-line plugin/no-unsupported-browser-features */
174
- background-image: radial-gradient(circle at center, var(--tick-color) 0, var(--tick-color) 1px, transparent 0);
175
- background-position: center center;
176
- background-repeat: repeat-x;
177
- background-size: 0 100%;
178
- background-size: calc(100% / var(--ticks, 0)) 2px;
179
- }
180
-
181
- #ticks::before {
182
- --tick-color: rgb(var(--mdw-color__on-surface-variant));
183
- }
184
-
185
- #ticks::after {
186
- --tick-color: rgb(var(--mdw-ink));
187
- /* TODO: Use single-paint implementation */
188
- padding-inline-end: calc(100% - (100% * var(--value)) + 10px);
189
-
190
- z-index: 1;
191
-
192
- will-change: padding-inline-end;
193
- }
194
- /* Active Indicator */
195
- #track-active {
196
- position: absolute;
197
- inset: 0;
198
-
199
- overflow: hidden;
200
-
201
- border-radius: 99px;
202
- }
203
-
204
- #track-active::before {
205
- content: '';
206
-
207
- position: absolute;
208
- inset: 0;
209
-
210
- transform: scaleX(var(--value));
211
- transform-origin: 0 0;
212
-
213
- background-color: rgb(var(--mdw-bg));
214
-
215
- will-change: transform;
216
- }
217
-
218
- #thumb-anchor {
219
- position: absolute;
220
- inset-inline: 0;
221
-
222
- display: flex;
223
- align-items: flex-start;
224
- flex-direction: column;
225
-
226
- inline-size: 1%;
227
-
228
- transform: translateX(calc(var(--value) * 100 * 100%));
229
- transform-origin: 0 0;
230
- z-index: 24;
231
-
232
- will-change: transform;
233
- }
234
-
235
- #thumb-label {
236
- position: absolute;
237
- inset-block-end: 14px;
238
-
239
- display: flex;
240
- align-items: center;
241
- justify-content: center;
242
-
243
- box-sizing: content-box;
244
- margin-block-end: 6px;
245
-
246
- transform: translateX(-50%) scale(1);
247
- transform-origin: 50% 100%;
248
-
249
- font-weight: var(--mdw-typescale__label-medium__font-weight);
250
- line-height: var(--mdw-typescale__label-medium__line-height);
251
- font-family: var(--mdw-typescale__label-medium__font-family);
252
- letter-spacing: var(--mdw-typescale__label-medium__letter-spacing);
253
-
254
- transition: transform 200ms;
255
- will-change: transform;
256
- }
257
-
258
- #thumb-label:is([hidden],[text=""]) {
259
- transform: translateX(-50%) scale(0);
260
- }
261
-
262
- #thumb-label::before {
263
- content: attr(text);
264
-
265
- display: flex;
266
- align-items: center;
267
- justify-content: center;
268
-
269
- min-block-size: 28px;
270
- min-inline-size: 28px;
271
-
272
- z-index: 1;
273
-
274
- background-color: rgb(var(--mdw-bg));
275
- border-radius: 50%;
276
- color: rgb(var(--mdw-ink));
277
- }
278
-
279
- #thumb-label::after {
280
- /* Values from Figma SVG */
281
- --x-start: 14.6446%; /*4.1005px*/
282
- --x-end: 85.3554%;
283
- --y: 70.7106%; /*24.0416px*/
284
-
285
- content: "";
286
-
287
- position: absolute;
288
- inset: 0;
289
- inset-block-end: -6px;
290
-
291
- clip-path: polygon(var(--x-start) var(--y), var(--x-end) var(--y), 50% 100%, var(--x-start) var(--y));
292
-
293
- background-color: rgb(var(--mdw-bg));
294
- }
295
-
296
- #track[disabled] {
297
- background-color: rgb(var(--mdw-color__on-surface), calc(0.12 / 0.38));
298
- }
299
-
300
- #label[disabled],
301
- #track[disabled] {
302
- --mdw-bg: var(--mdw-color__on-surface);
303
- cursor: not-allowed;
304
-
305
- opacity: 0.38;
306
- }
@@ -1,80 +0,0 @@
1
- /* https://m3.material.io/components/snackbar/specs */
2
-
3
- :host {
4
- --mdw-shape__size: var(--mdw-shape__small);
5
- --mdw-surface__shadow: var(--mdw-surface__shadow__3);
6
- --mdw-surface__tint: var(--mdw-surface__tint__3);
7
- --mdw-shape__bg: rgb(var(--mdw-color__inverse-surface));
8
- --mdw-ink: var(--mdw-color__inverse-on-surface);
9
-
10
- --mdw-type__line-height: var(--mdw-typescale__body-medium__line-height);
11
- display: flex;
12
- align-items: center;
13
-
14
- padding-inline: 16px;
15
-
16
- opacity: 0;
17
- transform: translateY(25%) scaleY(0.25);
18
- transform-origin: bottom center;
19
- visibility: hidden; /* Remove from tab order */
20
- z-index: 24;
21
-
22
- font: var(--mdw-typescale__body-medium__font);
23
- letter-spacing: var(--mdw-typescale__body-medium__letter-spacing);
24
-
25
- transition: transform 200ms, opacity 200ms, visibility 200ms;
26
- }
27
-
28
- :host([action]) {
29
- gap: 8px;
30
-
31
- padding-inline-end: 8px;
32
- }
33
-
34
- :host([close-button]) {
35
- gap: 4px;
36
-
37
- padding-inline-end: 4px;
38
- }
39
-
40
- :host([open]) {
41
- opacity: 1;
42
- transform: scale(1);
43
- visibility: visible;
44
- }
45
-
46
- #content {
47
- display: flex;
48
- align-items: center;
49
-
50
- flex: 1;
51
- padding-block: max(2px, calc(14px + (var(--mdw-density) * 2px)));
52
- }
53
-
54
- #slot {
55
- display: block;
56
- overflow-x: hidden;
57
- overflow-y: hidden;
58
-
59
- max-block-size: calc(var(--mdw-type__line-height) * 2);
60
-
61
- text-align: start;
62
- text-overflow: ellipsis;
63
- text-transform: none;
64
- white-space: normal;
65
- word-break: break-word;
66
- }
67
-
68
- @supports(width: 1lh) {
69
- #slot {
70
- max-block-size: 2lh;
71
- }
72
- }
73
-
74
- @supports(-webkit-line-clamp:1) {
75
- #slot {
76
- display: -webkit-box;
77
- -webkit-box-orient: vertical;
78
- -webkit-line-clamp: 2;
79
- }
80
- }
@@ -1,10 +0,0 @@
1
- :host {
2
- --mdw-shape__bg: rgb(var(--mdw-color__surface));
3
- --mdw-ink: var(--mdw-color__on-surface);
4
- position: relative;
5
-
6
- color: rgb(var(--mdw-ink));
7
-
8
- font: var(--mdw-type__font);
9
- letter-spacing: var(--mdw-type__letter-spacing);
10
- }
@@ -1,63 +0,0 @@
1
- /* https://m3.material.io/components/switch/specs */
2
-
3
- :host {
4
- --mdw-ink: var(--mdw-color__on-primary);
5
- --mdw-bg: var(--mdw-color__primary);
6
- position: relative;
7
-
8
- display: inline-flex;
9
- align-items: center;
10
-
11
- gap: 12px;
12
-
13
- }
14
-
15
- #touch-target {
16
- z-index: 0;
17
- }
18
-
19
- #label {
20
- display: contents;
21
-
22
- cursor: pointer;
23
-
24
- /* border-radius: 50%; */
25
- }
26
-
27
- /** Switch **/
28
-
29
- #switch {
30
- --mdw-bg: inherit;
31
- --mdw-ink: inherit;
32
- flex:1;
33
-
34
- pointer-events: none;
35
- }
36
-
37
- /** State **/
38
-
39
- #state {
40
- position: absolute;
41
- inset: 50%;
42
-
43
- block-size: 100%;
44
- min-block-size: 40px;
45
- inline-size: 100%;
46
- min-inline-size: 40px;
47
-
48
- pointer-events: none;
49
-
50
- transform: translateX(-50%) translateY(-50%);
51
-
52
- border-radius: 50%;
53
- }
54
-
55
- /** Disabled **/
56
-
57
- #label[disabled] {
58
- --mdw-ink: var(--mdw-color__on-surface); /* selected icon */
59
- --mdw-bg: var(--mdw-color__surface);
60
- cursor: not-allowed;
61
-
62
- opacity: 0.38;
63
- }
@@ -1,177 +0,0 @@
1
- /* https://m3.material.io/components/switch/specs */
2
-
3
- :host {
4
- --mdw-ink: var(--mdw-color__on-primary);
5
- --mdw-bg: var(--mdw-color__primary);
6
- --mdw-shape__size: var(--mdw-shape__full);
7
- --mdw-switch__value: 0;
8
- container-type: inline-size;
9
- container-name: switch-icon;
10
-
11
- position: relative;
12
-
13
- display: inline-block;
14
-
15
- box-sizing: border-box;
16
- block-size: 32px;
17
- inline-size: 52px;
18
- }
19
-
20
- :host([selected]) {
21
- --mdw-switch__value: 1;
22
- }
23
-
24
- :host([disabled]) {
25
- opacity: 0.38;
26
- }
27
-
28
- #track{
29
- position: absolute;
30
- inset: 0;
31
-
32
- background-color: rgb(var(--mdw-color__surface-variant));
33
- }
34
-
35
- #track[selected] {
36
- background-color: rgb(var(--mdw-bg));
37
- }
38
-
39
- #track[disabled] {
40
- opacity: calc(0.12/0.38);
41
- }
42
-
43
- #track[disabled][selected] {
44
- background-color: rgb(var(--mdw-color__on-surface));
45
- }
46
-
47
- #outline {
48
- filter:
49
- drop-shadow(1px 0px 0px currentColor)
50
- drop-shadow(0px 1px 0px currentColor)
51
- drop-shadow(-1px 0px 0px currentColor)
52
- drop-shadow(0px -1px 0px currentColor);
53
-
54
- color: rgb(var(--mdw-color__outline));
55
- }
56
-
57
- #outline:is([pressed],[focused]) {
58
- color: rgb(var(--mdw-color__outline));
59
- }
60
-
61
- #outline[disabled] {
62
- color: rgb(var(--mdw-color__on-surface));
63
- }
64
-
65
- #outline[selected] {
66
- color: transparent;
67
- }
68
-
69
- /** Thumb (state) **/
70
-
71
- #thumb {
72
- --thumb-color: var(--mdw-ink);
73
- position: absolute;
74
- inset-block: 0;
75
- inset-inline-start: 0;
76
-
77
- display: flex;
78
- align-items: center;
79
- justify-content: center;
80
-
81
- transform: translateX(calc(var(--mdw-dir, 1) * var(--mdw-switch__value) * (52px - 100%)));
82
-
83
- aspect-ratio: 1/1;
84
- }
85
-
86
- :dir(rtl) #thumb {
87
- --mdw-dir: -1;
88
- }
89
-
90
- @supports(width: 1cqw) {
91
- #thumb {
92
- transform: translateX(calc(var(--mdw-dir, 1) * var(--mdw-switch__value) * (100cqw - 100%)));
93
- }
94
- }
95
-
96
- #slot {
97
- color: rgb(var(--mdw-color__on-surface));
98
- }
99
-
100
- #slot[selected] {
101
- color: rgb(var(--mdw-bg));
102
- }
103
-
104
- /** Thumb Shape **/
105
-
106
- #thumb-shape {
107
- --mdw-shape__size: inherit;
108
-
109
- position: absolute;
110
-
111
- inset: 2px;
112
-
113
- transform: scale(calc(16/28));
114
- z-index: 0;
115
- }
116
-
117
- #thumb-shape[icon] {
118
- transform: scale(calc(24/28));
119
- }
120
-
121
- #thumb-shape:not([selected]) {
122
- --mdw-bg: var(--mdw-color__outline);
123
- --mdw-ink: var(--mdw-color__surface-variant);
124
- }
125
-
126
- #thumb-shape[selected] {
127
- transform: scale(calc(24/28));
128
- }
129
-
130
- #thumb-shape[selected]:not([active]) {
131
- --mdw-bg: var(--thumb-color);
132
- }
133
-
134
- #thumb-shape[pressed]:not([disabled]) {
135
- transform: scale(1);
136
- }
137
-
138
- /** Thumb Icons **/
139
-
140
- .icon {
141
- position: absolute;
142
- inset-block-start: 50%;
143
- inset-inline-start: 50%;
144
-
145
- opacity: 0;
146
- transform: translateX(-50%) translateY(-50%);
147
-
148
- font-size: 16px;
149
-
150
- /* border-radius: 50%; */
151
- }
152
-
153
- .icon:not([src]):empty {
154
- display: none;
155
- }
156
-
157
- #icon, #unselected-icon {
158
- opacity: 1;
159
-
160
- font-variation-settings: 'FILL' 0;
161
- }
162
-
163
- #unselected-icon[selected] {
164
- opacity: 0;
165
- }
166
-
167
- #selected-icon[selected] {
168
- opacity: 1;
169
- }
170
-
171
- #icon[selected] {
172
- font-variation-settings: 'FILL' 1;
173
- }
174
-
175
- #thumb[disabled] {
176
- color: rgb(var(--mdw-color__on-surface));
177
- }
@@ -1,89 +0,0 @@
1
- /* https://m3.material.io/components/switch/specs */
2
-
3
- :host {
4
- /*FastOutLinearInInterpolator*/
5
- --mdw-switch__transition-timing__collapse: cubic-bezier(0.4, 0.0, 1, 1);
6
- --mdw-switch__transition-duration__collapse: 375ms;
7
- /*LinearOutSlowInInterpolator*/
8
- --mdw-switch__transition-timing__expand: cubic-bezier(0.0, 0.0, 0.2, 1);
9
- --mdw-switch__transition-duration__expand: 500ms;
10
- --scale-delay: var(--mdw-switch__transition-duration);
11
-
12
- --mdw-switch__transition-duration: var(--mdw-switch__transition-duration__collapse);
13
- --mdw-switch__transition-timing: var(--mdw-switch__transition-timing__collapse);
14
- --mdw-switch__transition-delay__color: calc(var(--mdw-switch__transition-duration) / 2);
15
- --mdw-switch__transition-delay__translate: calc(var(--mdw-switch__transition-duration) / 2);
16
- --mdw-switch__transition-delay__scale: calc(var(--mdw-switch__transition-duration) / 2);
17
-
18
- transition-delay: var(--mdw-switch__transition-delay__color);
19
- transition-duration: calc(var(--mdw-switch__transition-duration) / 2);
20
- /* 2 legged animation */
21
- transition-timing-function: var(--mdw-switch__transition-timing);
22
- }
23
-
24
- #track {
25
- transition-delay: var(--mdw-switch__transition-delay__color);
26
- transition-duration: inherit;
27
- transition-property: background-color;
28
- transition-timing-function: inherit;
29
- }
30
-
31
- #outline {
32
- transition-delay: var(--mdw-switch__transition-delay__color);
33
- transition-duration: inherit;
34
- transition-property: background-color, color;
35
- transition-timing-function: inherit;
36
- }
37
-
38
- #thumb {
39
- transition-delay: var(--mdw-switch__transition-delay__translate);
40
- transition-duration: inherit;
41
- transition-property: transform;
42
- transition-timing-function: inherit;
43
- }
44
-
45
- #thumb-shape, .icon {
46
- /* (selected => unselected): stall color+scale */
47
- transition-delay: var(--mdw-switch__transition-delay__scale), var(--mdw-switch__transition-delay__color), var(--mdw-switch__transition-delay__color);
48
- transition-duration: inherit;
49
- transition-property: transform, background-color, color;
50
- transition-timing-function: inherit;
51
- }
52
-
53
- :host([icon]) {
54
- --mdw-switch__transition-delay__translate: 0s;
55
- }
56
-
57
- .icon {
58
- transition-property: transform, opacity, color;
59
- }
60
-
61
- /* unselected => selected */
62
- :host([selected]) {
63
- --mdw-switch__transition-delay__color: 0s;
64
- --mdw-switch__transition-delay__scale: 0s;
65
- /* --mdw-switch__transition-delay__translate: 0s; */
66
- --mdw-switch__transition-duration: var(--mdw-switch__transition-duration__expand);
67
- --mdw-switch__transition-timing: var(--mdw-switch__transition-timing__expand);
68
- }
69
-
70
- /* active => selected */
71
- :host([selected][pressed]) {
72
- /* --mdw-switch__transition-delay__color: 0s; */
73
- /* --mdw-switch__transition-delay__scale: 0s; */
74
- --mdw-switch__transition-delay__translate: 0s;
75
- }
76
-
77
- /* selected => unselected */
78
- :host(:not([selected])) {
79
- /* --mdw-switch__transition-delay__color: 0s; */
80
- /* --mdw-switch__transition-delay__scale: 0s; */
81
- --mdw-switch__transition-delay__translate: 0s;
82
- }
83
-
84
- /* unselected => active */
85
- :host([pressed]:not([selected])) {
86
- /* --mdw-switch__transition-delay__color: 0s; */
87
- --mdw-switch__transition-delay__scale: 0s;
88
- /* --mdw-switch__transition-delay__translate: 0s; */
89
- }