Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 33 additions & 2 deletions css-forms-1/Overview.bs
Original file line number Diff line number Diff line change
Expand Up @@ -813,11 +813,31 @@ select {

## Sliders ## {#stylesheet-sliders}

ISSUE: Refine meter, progress, switch and range input styling.
ISSUE(12267): Refine meter, progress, switch and range input styling.

```css
input:is([type=checkbox][switch], [type=range]) {
display: inline-flex;
position: relative;
align-items: center;
width: 100%;
}

input[type=checkbox][switch] {
width: 2em;
}

::slider-track {
height: 1em;
width: 100%;
}

input[type=range]::slider-track {
height: 0.5em;
}

input[type=checkbox][switch]::slider-track {
border-radius: 1em;
}

::slider-fill {
Expand All @@ -829,13 +849,24 @@ ISSUE: Refine meter, progress, switch and range input styling.
inline-size: 0;
}

input[type=checkbox][switch]::slider-fill {
background-color: transparent;
border-radius: inherit;
}

::slider-thumb {
border-radius: 0;
border: none;
background-color: currentColor;
appearance: none;
width: 1em;
height: 100%;
height: 1em;
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need to consider the WCAG touch size requirements for this. I suspect we'll need something bigger.

border-radius: 100%;
position: absolute;
}

input[type=checkbox][switch]:checked::slider-thumb {
inset-inline-end: 0;
}
```

Expand Down