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