← Back to release summary

:host, :host-context, and ::slotted specificity

Category
CSS
Type
New or changed feature
Status
Enabled by default (Chrome 71)
Intent stage
None

Summary

Chrome did not count the specificity for the :host() and :host-context() pseudo classes themselves. ::slotted() did not count the specificity for its arguments. This was not specified until [1] was resolved. From M71 Chrome ships specificity calculations per spec for Shadow DOM v1. The old behavior is kept for v0 for compatibility with existing content. [1] https://github.com/w3c/csswg-drafts/issues/1915 Bugs: https://crbug.com/888042 https://crbug.com/857415

Standards & signals

Docs: https://drafts.csswg.org/css-scoping/#host-selector https://drafts.csswg.org/css-scoping/#slotted-pseudo

View on chromestatus.com