- From: Nathan Knowler via GitHub <sysbot+gh@w3.org>
- Date: Sun, 14 Jan 2024 22:49:11 +0000
- To: public-css-archive@w3.org
@mirisuzanne I do think that access goes hand-in-hand with priority though (inversely, i.e. access decreases in subsequent layers). It might not be what Cascade Layers were explicitly designed for, but just how Cascade Layers came to be out of an eye towards how the Cascade already worked, that’s what inspired how this feature should work. User agent and user styles have access to shadow contexts for styling, so shifting the shadow context down to be within the layers of the document styles, the layers which come before would have access in the same way. Just because access seems to be tied to priority in this way, doesn’t mean that’s how Cascade Layers should work, but I think it does work well with the design of shadow DOM styling APIs. My goal with this feature isn’t to replace those APIs (i.e. custom elements, CSS Parts, custom properties, `:state()` via `CustomStateSet`). I think they are still the right tool for the problems that they solve: providing a more declarative styling API for an HTML component abstraction that becomes more maintainable for the consumer. If anything, I hope that this feature will actually free them up to do what they were designed to do. I fear by opening access without keeping that tied to a level of priority will effectively make these existing APIs useless. Sure if developers wanted to, they could use a feature like this to style all of their shadow roots, but I think they’d lose out on the power of the existing Shadow DOM styling APIs since _style encapsulation_ is what makes them useful. I think maybe the underlying challenge here is that **theming requires coordination across layers in the cascade**. Theming often requires some access to defaults, since it’s not easy for component authors to be able to make their component inherently/universally themable, especially as a component becomes more complex (i.e. composing elements). I actually think that might be what this [experimental “Defaults Styles for Custom Elements” section of the latest Scoping Level 1 Editor’s Draft](https://drafts.csswg.org/css-scoping-1/#default-element-styles) is trying to get at. -- GitHub Notification of comment by knowler Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/9792#issuecomment-1891098852 using your GitHub account -- Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config
Received on Sunday, 14 January 2024 22:49:14 UTC