- From: Steve Orvell via GitHub <sysbot+gh@w3.org>
- Date: Tue, 15 Oct 2024 17:03:48 +0000
- To: public-css-archive@w3.org
> Does that include browser defaults? What about user preferences? They aren't scoped. When I scope over a custom element, do I exclude shadow styles? Are important styles excluded as well? This part doesn't seem too tricky to me. It's an author styles concept so it only applies to those (default and user would still apply). Shadow DOM is separately isolated so it's unchanged. Important doesn't penetrate since I think for properties this would act like `all:initial` + custom properties. > I just have so many questions about how this would be done in a manageable way that doesn't lead to chaos. Yup, I share the concern. The isolation concept is inherently *defensive* and potentially implies that other style rules could be unknown "threats." This is probably a bad signal to send, although `all: initial` seems sort of similarly defensive in nature. The recent additions of @layer and @scope seem more pro-actively oriented: I do something additive to "take control" of the cascade and region of influence. With this in mind, I think another direction we could go to achieve a similar level of expressiveness and flexibility would be to have more power about bringing a set of rules into a scope. So instead of `isolate` a region we selectively `include` rules into that region. Perhaps this would be via @layer (or maybe this goes more with mixins?) For example: 1. ensure layer can be used easily on all stylesheets (<style>, < link >) 2. allow a layer to be "applied" to a scope: ```html <link rel=stylesheet href=... layer=foo> <style> @scope (.foo) { @mixin-layer(foo); } </style> ``` If this seems like a more reasonable direction, it probably needs its own issue (and/or there are likely other relevant issues). -- GitHub Notification of comment by sorvell Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/11002#issuecomment-2414559889 using your GitHub account -- Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config
Received on Tuesday, 15 October 2024 17:03:49 UTC