Re: [csswg-drafts] [css-shadow-parts] Access control (#3506)

> only allows blacklisting. So no to say "only colour can be overridden" because you have to explicitly add a an !important rule for every property

I think that's fine. A whitelist would exclude any new property that the component writer didn't think about, which is unfortunate.

> access control would not be orthogonal style values. !important applies to a rule, not a property. You can't just mark a property as important, you have to give it an explicit value.

`!important` applies to a declaration. If you don't want to give an explicit value you can use one of the CSS wide keywords like `initial`, `inherit`, or `unset`. I think `color: initial !important;` seems descriptive enough of the intent.

> wouldn't the outer style rule be able to add !important too and end up overriding? Is this desirable?

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 `::part` is defined that would make this different. `!important` rules in the shadow root should win important rules outside of the shadow root. If that's not the case that's a bug in Blink per https://github.com/w3c/csswg-drafts/issues/2368#issuecomment-370161382.

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

Received on Tuesday, 15 January 2019 04:44:53 UTC