File tree Expand file tree Collapse file tree 2 files changed +24
-14
lines changed
packages/calcite-components/src/components/switch Expand file tree Collapse file tree 2 files changed +24
-14
lines changed Original file line number Diff line number Diff line change 47
47
48
48
@include disabled ();
49
49
50
- // focus styles
51
- :host {
52
- @apply focus-base w-auto ;
53
- }
54
-
55
50
.container {
56
- @apply rounded-full ;
51
+ @apply outline- 0 ;
57
52
}
58
53
59
54
.track {
67
62
border
68
63
border-solid
69
64
align-top
70
- transition-all
71
- duration- 150
72
- ease-in-out ;
65
+ focus-base ;
66
+ }
67
+
68
+ :host (:focus ) .track {
69
+ @apply focus-outset ;
73
70
}
74
71
75
72
.handle {
124
121
}
125
122
}
126
123
127
- .container :focus {
128
- @apply focus-outset ;
129
- }
130
-
131
124
@include hidden-form-input ();
132
125
@include base-component ();
Original file line number Diff line number Diff line change @@ -39,7 +39,7 @@ export const disabled_TestOnly = (): string => html`<calcite-switch disabled che
39
39
export const Focus_TestOnly = ( ) : string =>
40
40
html `
41
41
< div style ="width:300px;height:300px; padding: 20px ">
42
- < calcite-switch > </ calcite-switch >
42
+ < calcite-switch > </ calcite-switch >
43
43
</ div >
44
44
< script >
45
45
( async ( ) => {
@@ -52,3 +52,20 @@ export const Focus_TestOnly = (): string =>
52
52
Focus_TestOnly . parameters = {
53
53
chromatic : { delay : 1000 } ,
54
54
} ;
55
+
56
+ export const FocusLabel_TestOnly = ( ) : string =>
57
+ html `
58
+ < div style ="width:300px;height:300px; padding: 20px ">
59
+ < calcite-label > Switch label< calcite-switch > </ calcite-switch > </ calcite-label >
60
+ </ div >
61
+ < script >
62
+ ( async ( ) => {
63
+ await customElements . whenDefined ( "calcite-switch" ) ;
64
+ await document . querySelector ( "calcite-switch" ) . setFocus ( ) ;
65
+ } ) ( ) ;
66
+ </ script >
67
+ ` ;
68
+
69
+ FocusLabel_TestOnly . parameters = {
70
+ chromatic : { delay : 1000 } ,
71
+ } ;
You can’t perform that action at this time.
0 commit comments