Web features explorer

host-context

Limited availability
Tags: css Groups: CSS > Selectors Web Components

The :host-context() CSS pseudo-class selects the containing element of the shadow tree in which it is used if that element or an ancestor matches the provided selector. To learn more, see :host-context() at MDN.

Compatibility