Re: [csswg-drafts] [css-ui] Pseudo-elements for stylable select (#10462)

@emilio brought up concerns regarding how it would be possible with these pseudos to allow multiple ways in CSS to target an element, and whether they should be exposed as pseudo elements or regular elements in which cases. This is possible if we go with the idea that I had in the issue description:

> It would also be ideal for these pseudo-elements to target either the "fallback" element inside the UA shadowroot or the author provided element which gets slotted in depending on which one is rendered.

If you have the following markup:
```html
<select style="appearance:base">
  <button>button</button>
</select>
```

Then the following two different selectors can target the author supplied button:
1. `select::select-button`
2. `select > button`

You could also use getComputedStyle to target this in two different ways, and emilio also mentioned getAnimations({subtree:true}). We have to make sure that in the case that the author doesn't supply a button, we avoid leaking the fallback button in the UA shadowroot to script.

Do people think this means that we should only support targeting the "fallback" button in the UA shadowroot via the pseudo-element? Do we need any particular kind of mitigation to support targeting either element?

-- 
GitHub Notification of comment by josepharhar
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/10462#issuecomment-2248672445 using your GitHub account


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

Received on Wednesday, 24 July 2024 18:38:36 UTC