@@ -17,6 +17,8 @@ governing permissions and limitations under the License.
17
17
--spectrum-switch-label-color-focus : var (--spectrum-neutral-content-color-key-focus );
18
18
--spectrum-switch-label-color-disabled : var (--spectrum-disabled-content-color );
19
19
20
+ --spectrum-switch-border-width : var (--spectrum-switch-border-width );
21
+
20
22
--spectrum-switch-border-color-default : var (--spectrum-neutral-content-color-default );
21
23
--spectrum-switch-border-color-hover : var (--spectrum-neutral-content-color-hover );
22
24
--spectrum-switch-border-color-down : var (--spectrum-neutral-content-color-down );
@@ -37,8 +39,9 @@ governing permissions and limitations under the License.
37
39
--spectrum-switch-background-color-selected-focus : var (--spectrum-neutral-background-color-key-focus );
38
40
--spectrum-switch-background-color-selected-disabled : var (--spectrum-disabled-content-color );
39
41
40
- --spectrum-switch-focus-indicator-thickness : var (--mod-focus-indicator-thickness , var ( -- spectrum-focus-indicator-thickness) );
42
+ --spectrum-switch-focus-indicator-thickness : var (--spectrum-focus-indicator-thickness );
41
43
--spectrum-switch-focus-indicator-color : var (--spectrum-focus-indicator-color );
44
+ --spectrum-switch-focus-indicator-gap : var (--spectrum-focus-indicator-gap );
42
45
43
46
--spectrum-switch-handle-background-color : var (--spectrum-neutral-content-color-default );
44
47
--spectrum-switch-handle-background-color-disabled : var (--spectrum-disabled-content-color );
@@ -48,6 +51,9 @@ governing permissions and limitations under the License.
48
51
--spectrum-switch-handle-size : var (--spectrum-switch-handle-size-medium );
49
52
--spectrum-switch-handle-selected-size : var (--spectrum-switch-handle-selected-size-medium );
50
53
54
+ --spectrum-switch-animation-duration-100 : var (--spectrum-animation-duration-100 );
55
+ --spectrum-switch-animation-duration-200 : var (--spectrum-animation-duration-200 );
56
+
51
57
/* Default size - medium */
52
58
--spectrum-switch-min-height : var (--spectrum-component-height-100 );
53
59
--spectrum-switch-control-width : var (--spectrum-switch-control-width-medium );
@@ -58,6 +64,8 @@ governing permissions and limitations under the License.
58
64
--spectrum-switch-spacing-bottom-to-label : var (--spectrum-component-bottom-to-text-100 );
59
65
60
66
--spectrum-switch-font-size : var (--spectrum-font-size-100 );
67
+ --spectrum-switch-line-height : var (--spectrum-line-height-100 );
68
+ --spectrum-switch-cjk-line-height : var (--spectrum-cjk-line-height-100 );
61
69
62
70
--spectrum-switch-border-radius : var (--spectrum-corner-radius-full );
63
71
}
@@ -159,13 +167,13 @@ governing permissions and limitations under the License.
159
167
margin-block-start : var (--mod-switch-spacing-top-to-label , var (--spectrum-switch-spacing-top-to-label ));
160
168
margin-block-end : var (--mod-switch-spacing-bottom-to-label , var (--spectrum-switch-spacing-bottom-to-label ));;
161
169
font- size: var(- - mod- switch- font- size, var(- - spectrum- switch- font- size));
162
- line-height: var(- - mod- line-height-100 , var(- - spectrum- line-height-100 ));
163
- transition: color var(- - mod- animation- duration-200, var(- - spectrum- animation- duration-200)) ease- in- out;
170
+ line-height: var(- - mod- switch - line-height, var(- - spectrum- switch - line-height));
171
+ transition: color var(- - mod- switch - animation- duration-200, var(- - spectrum- switch - animation- duration-200)) ease- in- out;
164
172
165
173
& : lang (ja ),
166
174
& : lang (zh ),
167
175
& : lang (ko ) {
168
- line-height : var (--mod-cjk-line-height-100 , var (--spectrum-cjk-line-height-100 ));
176
+ line-height : var (--mod-switch- cjk-line-height , var (--spectrum-switch- cjk-line-height ));
169
177
}
170
178
171
179
.spectrum-Switch : hover ~ & {
@@ -197,8 +205,8 @@ governing permissions and limitations under the License.
197
205
198
206
vertical-align : middle;
199
207
200
- transition : background var (--mod-animation-duration-100 , var (--spectrum-animation-duration-100 )) ease-in-out,
201
- border var (--mod-animation-duration-100 , var (--spectrum-animation-duration-100 )) ease-in-out;
208
+ transition : background var (--mod-switch- animation-duration-100 , var (--spectrum-switch -animation-duration-100 )) ease-in-out,
209
+ border var (--mod-switch- animation-duration-100 , var (--spectrum-switch -animation-duration-100 )) ease-in-out;
202
210
203
211
block-size : var (--mod-switch-control-height , var (--spectrum-switch-control-height ));
204
212
@@ -207,7 +215,7 @@ governing permissions and limitations under the License.
207
215
208
216
background-color : var (--highcontrast-switch-background-color , var (--mod-switch-background-color , var (--spectrum-switch-background-color )));
209
217
border-radius : var (--mod-switch-border-radius , var (--spectrum-switch-border-radius ));
210
- border-width : var (--mod-border-width-200 , var (--spectrum-border-width-200 ));
218
+ border-width : var (--mod-switch- border-width , var (--spectrum-switch- border-width ));
211
219
border-color : var (--highcontrast-switch-border-color-default , var (--mod-switch-border-color-default , var (--spectrum-switch-border-color-default )));
212
220
border-style : solid;
213
221
@@ -250,10 +258,10 @@ governing permissions and limitations under the License.
250
258
content : "" ;
251
259
box-sizing : border-box;
252
260
253
- transition : background var (--mod-animation-duration-100 , var (--spectrum-animation-duration-100 )) ease-in-out,
254
- border var (--mod-animation-duration-100 , var (--spectrum-animation-duration-100 )) ease-in-out,
255
- transform var (--mod-animation-duration-100 , var (--spectrum-animation-duration-100 )) ease-in-out,
256
- box-shadow var (--mod-animation-duration-100 , var (--spectrum-animation-duration-100 )) ease-in-out;
261
+ transition : background var (--mod-switch- animation-duration-100 , var (--spectrum-switch -animation-duration-100 )) ease-in-out,
262
+ border var (--mod-switch- animation-duration-100 , var (--spectrum-switch -animation-duration-100 )) ease-in-out,
263
+ transform var (--mod-switch- animation-duration-100 , var (--spectrum-switch -animation-duration-100 )) ease-in-out,
264
+ box-shadow var (--mod-switch- animation-duration-100 , var (--spectrum-switch -animation-duration-100 )) ease-in-out;
257
265
258
266
inline-size : var (--mod-switch-handle-size , var (--spectrum-switch-handle-size ));
259
267
block-size : var (--mod-switch-handle-size , var (--spectrum-switch-handle-size ));
@@ -272,20 +280,20 @@ governing permissions and limitations under the License.
272
280
block-size : var (--mod-switch-handle-selected-size , var (--spectrum-switch-handle-selected-size ));
273
281
274
282
inset-block-start : calc ((var (--mod-switch-control-height , var (--spectrum-switch-control-height ))
275
- - var (--mod-border-width-200 , var (--spectrum-border-width-200 ))
283
+ - var (--mod-switch- border-width , var (--spectrum-switch- border-width ))
276
284
- var (--mod-switch-handle-selected-size , var (--spectrum-switch-handle-selected-size )))
277
285
* 0.25
278
286
);
279
287
inset-inline-start : calc ((var (--mod-switch-control-height , var (--spectrum-switch-control-height ))
280
- - var (--mod-border-width-200 , var (--spectrum-border-width-200 ))
288
+ - var (--mod-switch- border-width , var (--spectrum-switch- border-width ))
281
289
- var (--mod-switch-handle-selected-size , var (--spectrum-switch-handle-selected-size )))
282
290
* 0.25
283
291
);
284
292
285
- transform : translateX (calc (100% + (var (--mod-border-width-200 , var (--spectrum-border-width-200 )) * 0.25 )));
293
+ transform : translateX (calc (100% + (var (--mod-switch- border-width , var (--spectrum-switch- border-width )) * 0.25 )));
286
294
287
295
& : dir (rtl ) {
288
- transform : translateX (calc (-1 * (100% + (var (--mod-border-width-200 , var (--spectrum-border-width-200 )) * 0.25 ))));
296
+ transform : translateX (calc (-1 * (100% + (var (--mod-switch- border-width , var (--spectrum-switch- border-width )) * 0.25 ))));
289
297
}
290
298
291
299
.spectrum-Switch : hover & {
@@ -302,14 +310,14 @@ governing permissions and limitations under the License.
302
310
.spectrum-Switch : active .spectrum-Switch-input : not (: disabled ): checked + & {
303
311
/* Add down state without overriding translateX */
304
312
transform :
305
- translateX (calc (100% + (var (--mod-border-width-200 , var (--spectrum-border-width-200 )) * 0.25 )))
313
+ translateX (calc (100% + (var (--mod-switch- border-width , var (--spectrum-switch- border-width )) * 0.25 )))
306
314
perspective (var (--spectrum-component-size-minimum-perspective-down ))
307
315
translateZ (var (--spectrum-component-size-difference-down ));
308
316
309
317
& : dir (rtl ) {
310
318
/* Add down state without overriding translateX */
311
319
transform :
312
- translateX (calc (-1 * (100% + (var (--mod-border-width-200 , var (--spectrum-border-width-200 )) * 0.25 ))))
320
+ translateX (calc (-1 * (100% + (var (--mod-switch- border-width , var (--spectrum-switch- border-width )) * 0.25 ))))
313
321
perspective (var (--spectrum-component-size-minimum-perspective-down ))
314
322
translateZ (var (--spectrum-component-size-difference-down ));
315
323
}
@@ -328,14 +336,14 @@ governing permissions and limitations under the License.
328
336
inset-block-start : 0 ;
329
337
margin : 0 ;
330
338
331
- transition : opacity var (--mod-animation-duration-100 , var (--spectrum-animation-duration-100 )) ease-out,
332
- outline-offset var (--mod-animation-duration-100 , var (--spectrum-animation-duration-100 )) ease-out,
333
- border var (--mod-animation-duration-100 , var (--spectrum-animation-duration-100 )) ease-in-out;
339
+ transition : opacity var (--mod-switch- animation-duration-100 , var (--spectrum-switch -animation-duration-100 )) ease-out,
340
+ outline-offset var (--mod-switch- animation-duration-100 , var (--spectrum-switch -animation-duration-100 )) ease-out,
341
+ border var (--mod-switch- animation-duration-100 , var (--spectrum-switch -animation-duration-100 )) ease-in-out;
334
342
335
343
.spectrum-Switch-input : focus-visible + & {
336
344
outline : var (--mod-switch-focus-indicator-thickness , var (--spectrum-switch-focus-indicator-thickness )) solid
337
345
var (--highcontrast-switch-focus-indicator-color , var (--mod-switch-focus-indicator-color , var (--spectrum-switch-focus-indicator-color )));
338
- outline-offset : calc (var (--mod-focus-indicator-gap , var (--spectrum-focus-indicator-gap )) + var (--mod-switch-focus-indicator-thickness , var (--spectrum-switch-focus-indicator-thickness )));
346
+ outline-offset : calc (var (--mod-switch- focus-indicator-gap , var (--spectrum-switch -focus-indicator-gap )) + var (--mod-switch-focus-indicator-thickness , var (--spectrum-switch-focus-indicator-thickness )));
339
347
}
340
348
}
341
349
}
0 commit comments