Skip to content

Commit 7c2d3a6

Browse files
committed
[css-forms-1] Add initial UA styles for switch
1 parent 3af4db6 commit 7c2d3a6

File tree

1 file changed

+23
-1
lines changed

1 file changed

+23
-1
lines changed

‎css-forms-1/Overview.bs

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -813,13 +813,25 @@ select {
813813

814814
## Sliders ## {#stylesheet-sliders}
815815

816-
ISSUE: Refine meter, progress, switch and range input styling.
816+
ISSUE(12267): Refine meter, progress, switch and range input styling.
817817

818818
```css
819+
input[type=checkbox][switch] {
820+
display: inline-flex;
821+
position: relative;
822+
align-items: center;
823+
width: 2em;
824+
}
825+
819826
::slider-track {
820827
height: 1em;
821828
}
822829

830+
input[type=checkbox][switch]::slider-track {
831+
width: 100%;
832+
border-radius: 1em;
833+
}
834+
823835
::slider-fill {
824836
height: 100%;
825837
background-color: currentColor;
@@ -833,6 +845,16 @@ ISSUE: Refine meter, progress, switch and range input styling.
833845
width: 1em;
834846
height: 100%;
835847
}
848+
849+
input[type=checkbox][switch]::slider-thumb {
850+
border-radius: 100%;
851+
height: 1em;
852+
position: absolute;
853+
}
854+
855+
input[type=checkbox][switch]:checked::slider-thumb {
856+
inset-inline-end: 0;
857+
}
836858
```
837859

838860
## Checkboxes & radios ## {#stylesheet-checkbox-radio}

0 commit comments

Comments
 (0)