File tree 3 files changed +15
-12
lines changed
packages/calcite-components/src/components/switch
3 files changed +15
-12
lines changed Original file line number Diff line number Diff line change
1
+ export const CSS = {
2
+ container : "container" ,
3
+ track : "track" ,
4
+ handle : "handle" ,
5
+ } ;
Original file line number Diff line number Diff line change 85
85
inset-inline : -1px theme (" inset.auto" );
86
86
}
87
87
88
- :host ( : hover) ,
88
+ .container : hover ,
89
89
:host (:focus ) {
90
90
.handle {
91
91
@apply border-color-brand ;
101
101
@apply border-color-brand ;
102
102
inset-inline : theme (" inset.auto" ) -1px ;
103
103
}
104
- }
105
104
106
- :host ([checked ]:hover ) {
107
- .track {
108
- @apply bg-brand border-color-brand-hover ;
109
- }
110
- .handle {
111
- @apply border-color-brand-hover ;
112
- box-shadow : inset 0 0 0 1px var (--calcite-color-brand-hover );
105
+ .container :hover {
106
+ .handle {
107
+ @apply border-color-brand-hover ;
108
+ box-shadow : inset 0 0 0 1px var (--calcite-color-brand-hover );
109
+ }
113
110
}
114
111
}
115
112
Original file line number Diff line number Diff line change @@ -32,6 +32,7 @@ import {
32
32
setUpLoadableComponent ,
33
33
} from "../../utils/loadable" ;
34
34
import { Scale } from "../interfaces" ;
35
+ import { CSS } from "./resources" ;
35
36
36
37
@Component ( {
37
38
tag : "calcite-switch" ,
@@ -204,13 +205,13 @@ export class Switch
204
205
< div
205
206
aria-checked = { toAriaBoolean ( this . checked ) }
206
207
aria-label = { getLabelText ( this ) }
207
- class = " container"
208
+ class = { CSS . container }
208
209
ref = { this . setSwitchEl }
209
210
role = "switch"
210
211
tabIndex = { 0 }
211
212
>
212
- < div class = " track" >
213
- < div class = " handle" />
213
+ < div class = { CSS . track } >
214
+ < div class = { CSS . handle } />
214
215
</ div >
215
216
< HiddenFormInputSlot component = { this } />
216
217
</ div >
You can’t perform that action at this time.
0 commit comments