[Range] Add * to slider-thumb and tick - #1449
Conversation
…s api # Conflicts: # site/src/pages/components/enhanced-range-input.explainer.mdx
d48340f to
23a68ad
Compare
lukewarlow
left a comment
There was a problem hiding this comment.
Perhaps we should allow the non functional version to target all of them and the functional to target specific ones?
|
There were discussions in the csswg about multiple slider-fills so it might be worth looking at those conversations? |
@lukewarlow mind linking to these conversations? |
|
Sorry for the delay: w3c/csswg-drafts#12419 |
Co-authored-by: Keith Cirkel <keithamus@users.noreply.github.com>
|
|
||
| #### Exposing Thumb and Segment Geometry to CSS | ||
|
|
||
| To support layout customization beyond a straight horizontal track, we propose exposing each thumb's position along the track as a CSS custom property on the `::slider-thumb(*)` part (e.g. `--slider-thumb-position`, a percentage or `<number>` along the track), with segments similarly exposing their start and size. This is purely additional information for styling — it does not change hit-testing, keyboard behavior, or value computation, which remain based on the linear `min`/`max` model described above. |
There was a problem hiding this comment.
Exposing custom properties by the browser is going to be a non-starter I suspect. I think instead a new function that returns the value is a better starting point. (Alternatively, perhaps we can get it from the CSS forms control-value() function or something)
|
@lukewarlow I updated some of the explainer according to your feedback.
Here I don't really agree; to be honest, it might be worth opening a discussion. I'd expect it to target all thumbs as well, which would make the Not taken up in this explainer, but something that came to mind is if these thumbs are actually considered siblings? This would allow you to do: (pretty much this idea: https://codepen.io/utilitybend/pen/PwPxePK) But that might be stretching it, and I'll make an issue of this later on. It should certainly be picked up, but maybe out of scope for this particular PR. Tagging @gregwhitworth and @keithamus as well to inform. I was a bit delayed. |
lukewarlow
left a comment
There was a problem hiding this comment.
I think some of this probably needs further thought and maybe some details will be changed but approving to keep things moving.
@lukewarlow Absolutely. The way I see it, this is still getting the starting point up and running for the first experimental implementations. |
I following this idea for an API this would be logical.