-
Notifications
You must be signed in to change notification settings - Fork 715
[css-shadow-parts] Access control #3506
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Using |
@stefsullrew do you have a feel for whether you would want allow-by-default and blacklist or deny-by-default and whitelist or do you think both are useful/needed. @emilio I think !important can kind of achieve it but it seems hard to use (correct me if I'm wrong below)
|
@fergald For our use case, allow all by default and blacklist would be ideal to prevent declaring a lengthy list of CSS properties. |
I think that's fine. A whitelist would exclude any new property that the component writer didn't think about, which is unfortunate.
No, or at least that's one of the design goals of the shadow cascade rules: https://drafts.csswg.org/css-scoping/#shadow-cascading I don't see anything in particular as to how |
@fergald I think both would be useful in a variety of scenarios. Components intended to be themed would benefit from the 'deny all except' approach while components that are meant to be more flexible would be best served by a 'allow all except' approach. The default, should nothing be defined, would be an 'allow all' mechanism from our perspective. Hope this helps you better understand our point of view. Do you believe this makes sense for the spec and potentially implementation? @emilio The thinking behind this is to allow greater ease of customization and "theming" of components while having guardrails in place to prevent breaking a component. |
(Split from issue #3467, reported by @stefsullrew)
It would be very useful if it was possible to limit access to CSS rules for a defined part. The purpose is to limit the styling API of a component by only allowing certain things to be overridden or to lock down certain things that should never be overridden.
In the example below “part='title'” is defined but only “color” and “background-color” can be overridden, all other rules would be ignored.
We envision allow all by default with the possibility to allow or deny specific lists of CSS rules.
In the example below “part='title'” is defined but “color” and “background-color” are locked, all other rules would apply and override the component's default styles.
The text was updated successfully, but these errors were encountered: