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

The CSS Working Group just discussed `[css-scoping-1] Dynamic changes of state and attributes referenced by :host-context rules are pretty hard to handle efficiently.`, and agreed to the following:

* ``RESOLVED: Drop `:host-context()` ``

<details><summary>The full IRC log of that discussion</summary>
&lt;emilio> TabAtkins: emilio brought up the issue that `:host-context` pseudo-class matches the host element inside a shadow root, and it matches the host if any of the ancestors match the compound<br>
&lt;emilio> ... intention was to solve some theming use cases (light/dark mode etc)<br>
&lt;emilio> ... issue is that this is not very efficient, tree-crossing, and invalidation is difficult<br>
&lt;emilio> ... since then, most of the use cases can be replaced by style queries (and better)<br>
&lt;emilio> ... e.g. instead of light / dark class, you can use it to set a custom prop and use inheritance<br>
&lt;emilio> ... shadow tree can use a style query<br>
&lt;emilio> ... it handles scoping / don't have to worry about which one is closer<br>
&lt;emilio> ... it pulls in the cost of the container query but avoids the cost of cross-tree invalidations<br>
&lt;emilio> ... emilio and WebKit impl would prefer to remove host-context<br>
&lt;emilio> ... afaict it's only chrome<br>
&lt;emilio> ... this could be a compat issue for chrome, so fairly limited<br>
&lt;emilio> ... so I'm ok with dropping this given the powers CSS has now<br>
&lt;emilio> ... unless there's objections I'd be happy with a resolution<br>
&lt;emilio> astearns: do you think you'll be successful convincing Blink to remove it?<br>
&lt;keithamus> q+<br>
&lt;emilio> TabAtkins: we shall see<br>
&lt;astearns> ack keithamus<br>
&lt;emilio> ... but at least it can be clear that it's chrome-only and not intended to be implemented everywhere<br>
&lt;emilio> keithamus: is there a use counter?<br>
&lt;emilio> TabAtkins: not sure but that'd be the first step in our deprecation process<br>
&lt;emilio> astearns: is there anything that host-context can be used for not covered by container-style queries?<br>
&lt;emilio> TabAtkins: the only difference is it switches who has control over<br>
&lt;emilio> ... that said you shouldn't be depending on details from the outer tree if the outer tree isn't expecting it<br>
&lt;emilio> ... shouldn't really matter where the control lives<br>
&lt;emilio> ... but if the same person controls both sides, there's no difference in abilities<br>
&lt;dbaron> use counter: https://chromestatus.com/metrics/feature/timeline/popularity/470<br>
&lt;emilio> TabAtkins: slowly trending upwards but given the numbers probably possible to remove via a deprecation process<br>
&lt;emilio> astearns: proposed resolution to drop `:host-context()`, objections?<br>
&lt;emilio> +1 :-)<br>
&lt;emilio> RESOLVED: Drop `:host-context()`<br>
</details>


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


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

Received on Wednesday, 19 March 2025 16:31:29 UTC