-
Notifications
You must be signed in to change notification settings - Fork 728
[css-forms-1] Improve slider UA styles #12427
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
7c2d3a6
to
6053ab4
Compare
@@ -829,6 +841,11 @@ ISSUE: Refine meter, progress, switch and range input styling. | |||
inline-size: 0; | |||
} | |||
|
|||
input[type=checkbox][switch]::slider-fill { | |||
background-color: transparent; | |||
border-radius: inherit; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not really sure if this should be needed, for my range input prototype it isn't but for switch it seems to be else the fill overflows the track.
We can adjust accordingly in future if it's not needed.
6053ab4
to
02fb20b
Compare
align-items: center; | ||
width: 2em; | ||
} | ||
|
||
::slider-track { | ||
height: 1em; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probably need some thought on how to meet WCAG target sizing here. Same goes for existing checkbox styling I believe.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good by itself, I do think we should do this at the same for other controls too though, it's very likely that range inputs (and potentially other slider based controls) end up looking similar in terms of border-radius.
css-forms-1/Overview.bs
Outdated
position: absolute; | ||
} | ||
|
||
input[type=checkbox][switch]:checked::slider-thumb { | ||
inset-inline-end: 0; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder if we could use grid and align properties somehow here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suspect we'll still end up using absolute positioning for range inputs though. So it depends how much cleaner it actually is.
Okay I'll make this draft and merge my other PR into this one so it can all be judged together. |
Positioning of ::slider-thumb and sizing of ::slider-fill for range still need to be added.
02fb20b
to
da4f5d2
Compare
See #12267
Still need to add stuff such as hover styles to this but this is the basics.
(Range Image includes an implementation of sizing and background color for the fill, and positioning of the thumb which aren't included in this PR)