Re: [csswg-drafts] [css-cascade] Evaluate specificity of ::slotted and global styles in the same conditions (#6466)

@castastrophe 

> I want to note, I would not expect a !important from within a slot to be able to be overwritten from the outside of the component.

Then, we're pretty locked:
 a. `::slotted()` can specify styles which will only work if there no other applicable style set anywhere outside (no concept of specificity), something like a fallback in the absence of any style.
 b. `::slotted()` with `!important` will overwrite permanently, no way for outer styles to overwrite it back.
 
 >  I find a fairly major flaw in your original proposal though to be honest which is this statement I would like to propose that shadow DOM styles fight with the global styles in the same conditions. which I feel contradicts the exact goal of web components which is to separate Shadow DOM elements from the global cascade entirely.
 
Then `::slotted()` shouldn't exist and `!important` shouldn't be considered, right?

I think the point here is to have a useful `::slotted()`, the current one is very limited because it forces you to never ever write global styles if you want slotted() styles to work.

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


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

Received on Wednesday, 27 July 2022 16:43:04 UTC