-
Notifications
You must be signed in to change notification settings - Fork 759
[css-pseudo] Custom properties on :root #6641
Copy link
Copy link
Closed
Closed
Copy link
Labels
Issue body actions
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?
css-pseudo-4Current WorkCurrent Work
Type
Projects
Milestone
Relationships
Development
Issue actions
You can’t perform that action at this time.