Open mfreed7 opened 10 months ago
Placeholders.
I will add a detailed proposal here later.
Given that https://w3c.github.io/aria/#aria-orientation exists I wonder to what extent we should consider this to be a presentational aspect of the control. Maybe orient=vertical
is the right approach?
I'm curious what value knowing the orientation in ARIA brings.
I agree that (ab)using writing-mode
and direction
for this is pretty hacky. We really should just add a dedicated property for it instead; those writing orientation properties have side effects we don't really want to invoke.
Quick proposal:
slider-orientation: [ inline | block | self-inline | self-block ]
|| [ start | end | self-start | self-end ]
If we give it an initial value of self-inline self-start
, this'll automatically play nicely with the existing writing-mode/direction hacks, I believe, and in the default case (where you aren't setting either of those properties) will correctly give a horizontal slider with the low value toward the left (in English). You can also override that to, say, inline start
, and then use writing-mode/direction to change how the text in it renders without affecting the slider itself.
I'm extracting this question from the various discussions in several forums:
For slider controls (
<input type=range>
,<progress>
,<meter>
, potentially<input type=checkbox switch>
, etc.) there is a desire to be able to control:In current browsers, #1 is controlled by the CSS
writing-mode
property, and #2 is controlled by the CSSdirection
property. This does allow full control of orientation and direction for sliders, and at least recently (thanks @dizhang168), this behavior is implemented interoperably, despite a lack of standards for this behavior. However, because of #3 (see https://github.com/whatwg/html/issues/4177#issuecomment-1882909538 in particular), it might make sense to have a specific CSS property to control the orientation and direction of slider type controls. One tricky detail will be getting it to behave predictably in the face of existingwriting-mode
/direction
behavior, and maybe even the non-standardorient=vertical
.