[csswg-drafts] [css-pseudo] Custom properties on :root (#6641)

andruud has just created a new issue for https://github.com/w3c/csswg-drafts:

== [css-pseudo] Custom properties on :root ==
It's a common pattern to define all the primitives in your style guide as "global" (/ attempted global) custom properties on :root, e.g.

```
:root {
  --pale-blue: <etc>;
  --light-blue: <etc>;
  /* ... hundreds ... */
}
```

If I understand the highlight inheritance model correctly, such global custom properties would not be available on `::selection` (etc), unless you modify the custom-property-defining rule to something like `:root, :root::selection {}`. In principle what the author would be doing is creating two separate mega-blobs of custom properties. This may or may not be easy to optimize depending on how the usage patterns will actually end up.

Authors can use `@property`  w/ initial value to address it. Is that enough, or we do something else about this?

@delan @tabatkins 

Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/6641 using your GitHub account


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

Received on Monday, 20 September 2021 09:05:12 UTC