Re: [csswg-drafts] [css-forms-1] UA styles for base appearance listbox select elements (#12510)

The CSS Working Group just discussed `[css-forms-1] UA styles for base appearance listbox select elements`.

<details><summary>The full IRC log of that discussion</summary>
&lt;fantasai> lea, if we go down that line we can maybe call it `:embedded-field` or something. I think selecting based on that vs mixing it up with pickers is better.<br>
&lt;fantasai> in many form controls the picker is an optional aid, not the core part of the control<br>
&lt;masonf> jarhar: we defined a bunch of UA styles for customizable-select when it has no size attribute and a picker. I'd like to do the same for in-page listbox without a picker, with or without multiple.<br>
&lt;lea> q+<br>
&lt;lea> q-<br>
&lt;masonf> jarhar: I think this is easy, compared to single-select, since it's just removing some things like button styles.<br>
&lt;Lwarlow> Yeah the embedded vs in page with optional picker is interesting<br>
&lt;lea> q+<br>
&lt;masonf> jarhar: I wrote a comment about 5 styles that should apply (commented on the issue).<br>
&lt;masonf> jarhar: overflow, border, display, and user-select<br>
&lt;masonf> jarhar: what do you think?<br>
&lt;astearns> ack lea<br>
&lt;una> q+<br>
&lt;masonf> lea: one requirement - it should be possible to size intrinsically to fit the contents.<br>
&lt;masonf> lea: seems like it should be possible, just don't want to lose track of this<br>
&lt;masonf> lea: once you can style them, you've got flexibility to change the appearance a lot. All of these require no scrolling.<br>
&lt;masonf> lea: cannot describe the way that listbox sizing works currently. Maybe that just goes away with appearance base. But that means that size stopped working.<br>
&lt;masonf> lea: if you say size:3 it doesn't do 3 lh's it says three options<br>
&lt;masonf> lea: however tall three options are. Not sure this is useful, but maybe.<br>
&lt;astearns> ack una<br>
&lt;Lwarlow> Q+<br>
&lt;masonf> una: generally these look good. I'm always a fan of simplicity. Fewer things for authors to override.<br>
&lt;masonf> una: I noticed padding block and inline that was removed. Why remove padding and gaps and things?<br>
&lt;masonf> jarhar: I think the padding and gaps are to space the content inside the button, so the picker icon has space.<br>
&lt;masonf> jarhar: and to make sure text inside the button is spaced away from edges. With listbox, that doesn't apply.<br>
&lt;lea> q+<br>
&lt;masonf> jarhar: option elements will already have those rules, and the options will fill the select.<br>
&lt;masonf> una: makes sense<br>
&lt;astearns> ack Lwarlow<br>
&lt;masonf> lwarlow: one other thing is field sizing as a default still makes sense. The fixed styling if we're allowing it should be opt-in rather than opt-out.<br>
&lt;masonf> lwarlow: by default people will want it to just fill based on the number of options, and set a max height. Rather than being fixed.<br>
&lt;masonf> lwarlow: don't need to opt in to field-sizing: content<br>
&lt;masonf> lwarlow: only reason this isn't used more is that it isn't implemented everywhere<br>
&lt;lea> s/cannot describe the way that listbox sizing works currently. Maybe that just goes away with appearance base. But that means that size stopped working./CSS cannot currently describe the way that listbox sizing works currently. Maybe that's okay and you lose that with appearance base. But that means that the `size` attribute stops working. Or maybe we define `size` to mean "this many `1lch`" and not "this many options"/<br>
&lt;masonf> lwarlow: other than that, these styles make sense<br>
&lt;masonf> lwarlow: don't think it should have border or border radius<br>
&lt;masonf> lwarlow: just matching everything else makes sense. Should be box-sizing:border-box maybe?<br>
&lt;masonf> lwarlow: not having overflow:scroll is good. That's odd currently.<br>
&lt;astearns> ack lea<br>
&lt;masonf> lea: I agree with not having border radius, and generally the fewer styles the better.<br>
&lt;masonf> lea: not sure about padding. Usually listboxes it's not the select that has padding, it's the options. Same for gap, usually no gap.<br>
&lt;masonf> lea: field-sizing: content with !important. Generally do we really need that? In appearance:base it gets sized as a regular element. Not sure what field-sizing would do there?<br>
&lt;masonf> lea: agree that most authors want to set max height. Do we really need field-sizing, and !important?<br>
&lt;masonf> lwarlow: reason for that is that at least in Chromium, if you didn't have it, the computed value would be fixed. Felt strange<br>
&lt;lea> also just realized I was reading the select styles as listbox styles.<br>
&lt;masonf> lwarlow: question about form controls having special behavior in base appearance mode<br>
&lt;masonf> lwarlow: there's a CSS issue discussing this<br>
&lt;masonf> lwarlow: some people might like select's fixed behavior, automatically sizing based on longest option<br>
&lt;masonf> lea: I was reading the select styles, they do make sense for drop downselect, I just meant for listboxes<br>
&lt;lea> q+<br>
&lt;masonf> lwarlow: don't need the !important, that's likely an impl detail<br>
&lt;masonf> lwarlow: you can't do fixed sizing width-wise, and no easy way height-wise. Might be that we can't allow fixed mode.<br>
&lt;masonf> lea: we could also say field-sizing always resolves to content in appearance base or something<br>
&lt;masonf> lea: I was expecting flex, but you have inline-block. Authors can override.<br>
&lt;masonf> lea: do browsers use flex or something else?<br>
&lt;masonf> jarhar: picker with select is a flexbox, I'd imagine it's the same here for listbox right?<br>
&lt;masonf> jarhar: customizable-select picker is display:block<br>
&lt;Lwarlow> Q+<br>
&lt;astearns> ack lea<br>
&lt;astearns> ack Lwarlow<br>
&lt;masonf> lwarlow: we probably need a wider discussion of the display value in appearance:base.<br>
&lt;ntim> q+<br>
&lt;masonf> lwarlow: maybe it doesn't matter much here, but matters more in other controls<br>
&lt;lea> (also fewer things for authors to override)<br>
&lt;masonf> lwarlow: we should be consistent. Maybe select is special.<br>
&lt;astearns> ack ntim<br>
&lt;masonf> ntim: one goal for appearnace:base is to make it as close to a plain div as possible.<br>
&lt;masonf> ntim: field-sizing:content isn't like a plain div. If you put display:block on a div, it fills the available space. That doesn't happen with field-sizing:content<br>
&lt;masonf> ntim: want to solve this generally<br>
&lt;masonf> ntim: maybe new field-sizing:auto value?<br>
&lt;masonf> astearns: want to reduce the number of author overrides, vs having it be close to a div. Those are in tension.<br>
&lt;masonf> astearns: need extra justification for things that make things more complicated for bare div<br>
&lt;masonf> ntim: from perspective of a new author, wondering why form controls behave differently. Try to fix with appearance:base<br>
&lt;masonf> astearns: we have these two sets of styles, but no way (yet) to decide between them<br>
&lt;masonf> jarhar: I took notes, and I'll post back to the issue. On the selector I can just give up on that and just use existing spec concepts to swithc.<br>
&lt;masonf> s/swithc/switch<br>
&lt;masonf> astearns: we can move forward with these rules and have UA magic make them apply<br>
&lt;masonf> annevk: to be clear, I wasn't against exposing it, just wanted it to be consistent<br>
&lt;masonf> annevk: seems like some pseudo class is warranted.<br>
&lt;masonf> astearns: take this back to the issue, debate the things we didn't decide today<br>
</details>


-- 
GitHub Notification of comment by css-meeting-bot
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/12510#issuecomment-3114014396 using your GitHub account


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Thursday, 24 July 2025 15:59:20 UTC