You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I’d argue most authors would expect <main> to have a blue background color, but it is in fact red. AFACIT, this is currently per spec. 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?
This is also related to #1915, and also (loosely) to #2158 / #1027.
Note that the spec as of right now doesn't do any kind of special-casing, so :host and :host-context should also not have any particular specificity rules, but @lilles mentioned there why he thought it's unfortunate.
I think it should work like :not() for specificity calculation.
tabatkins
changed the title
[selectors] Selectors in ::slotted don’t affect specificity
[scoping] Selectors in ::slotted don’t affect specificity
Feb 6, 2018
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. AFACIT, this is currently per spec. 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: