Re: [csswg-drafts] [css-scoping-1] Dynamic changes of state and attributes referenced by :host-context rules are pretty hard to handle efficiently. (#1914)

> On the heading elements, then e-small would use those variables for example.

What happens when the parent element cannot be informed about the child element?

In the case of the `<e-small>` that _could_ exist in an `<h1>`, how would I prepare the `<h1>` to pass that custom property? It's likely that known custom element parents isn't the clearest of examples here. This really looks to allow an HTML developer to understand the contexts in which they can place a custom element without having to reach into the definition of anything above that element (whether via JS or CSS) in their HTML.

In the case that this sort of location based property setting was _customizable_, documenting a Custom Property for a consumer to leverage could definitely be a possibility, but if it were meant to only be _enumerable_ (possessing a fixed number of values) then documenting a class or `:host-context` 😉 for consumers to establish would allow this to be set once and cascade to all of the `<e-small>` elements in that context without the consumer having to go to each `<e-small>` and enumerate it directly.

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


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

Received on Tuesday, 19 October 2021 21:27:46 UTC