Re: [csswg-drafts] [css-cascade][css-scoping] Host layerable shadow roots (#9792)

There seem to be two issues at play: _styling access_ to the shadow DOM and _styling priority_ in relation to shadow DOM styles. Layers are well designed for helping with the priority side. I like the idea of layering custom element styles into a page style, much the same way I would layer-in styles from other third-party tools. That's what layers were designed for!

I'm a bit less convinced by the way layers are used here to also grant access. For one thing, it feels a bit tangential to the layering, and not entirely obvious that adjusting the priority also provides access for _some but not all_ page styles. But also: this puts a limit on the ability of layers to do what they're designed for: explicitly re-arrange priorities. I'm not sure it makes sense to say: you can prioritize these styles anywhere you want, but only lower priority styles get access to the shadow DOM.

I can see use-cases where that works, but also use-cases for the opposite. When I ship a web component, I want to provide default styles that are _easy to override_. The current priority order is fine, with the page taking precedence. What I really want to do is provide access for those page styles to get in.

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


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

Received on Saturday, 13 January 2024 22:52:47 UTC