Re: [csswg-drafts] [CSS Pseudo] Revisit CSS Custom Properties in highlight pseudos (#9909)

A model with less load could be to inherit:

- custom properties from the originating element
- properties from the highlight tree

The root highlights would still inherit custom properties from `:root` in this model.

For example, this markup:

```html
<html>
  <body>
    <div>
      <p>…</p>
    </div>
  </body>
<html>
```

When selecting text in the paragrph, this would be the lookup chain:

- p::selection
- p
- div::selection
- body::selection
- :root::selection
- :root

This would still allow authors to set a custom property on an intermediary element. For example, if they set `--color` on `<div>`, the `<p>` would end up inheriting that, and thus the `p::selection` would be able to use `--color`.


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


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

Received on Friday, 16 February 2024 16:29:03 UTC