-
Notifications
You must be signed in to change notification settings - Fork 371
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
Selectors in ::slotted don’t change specificity #728
Comments
I think per spec pseudo-elements are only counted when computing specificity (there's no special rule for ::slotted): https://drafts.csswg.org/selectors-4/#specificity-rules That being said there are already other issues with specificity It'd be nice to get this part of the spec properly defined to match both reality and / or what authors expect... |
It's probably best to file this against w3c/csswg-drafts, especially now Selectors is getting some editor attention. This is not really something that this repository can solve. |
Understood. |
Continued in w3c/csswg-drafts#2271 |
Let’s say I have a custom element
<my-elem>
, that has the following shadow root markup:I’d argue most authors would expect
<main>
to have a blue background color, but it is in fact red. It seems the selectors passed to::slotted()
don’t affect specificity. So precedence is defined by order of declaration.Was this intentional? If so, why? If not, is it changeable?
(Live demo, code)
The text was updated successfully, but these errors were encountered: