Re: [csswg-drafts] [css-ui] Changing UA styles based on the computed value of the appearance property (#10028)

It hadn't occurred to me before, but we could do something like `light-dark()` to support this (thanks @lilles!). We could give the UA properties that we care about an internal CSS function which evaluates to one thing for appearance:auto/none, and a different one for appearance:base/base-select.

As I've [implemented in chromium](https://chromium-review.googlesource.com/c/chromium/src/+/5389566), it looks like this for background-color specifically:
```css
select {
  background-color: -internal-appearance-auto-base-select(Field, transparent);
}
```

This required the `appearance` property to be computed before `background-color`, but I was able to enforce this in chromium by setting the priority of appearance to a higher value than background-color.

I don't know if the per-property priority is something that exists in csswg specs, and I'm not sure if the particular form of this function is what we would want to spec either, but from my point of view this solves the issue.

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


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

Received on Wednesday, 10 April 2024 15:30:28 UTC