Web platform features explorer

:host-context()

This feature is discouraged. Consider using Container style queries instead. For the rationale, see:

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.

Status

Discouraged

MDN documentation

Browser support

  • Chrome 54 Released on 2016-10-12
  • Chrome Android 54 Released on 2016-10-19
  • Edge 79 Released on 2020-01-15
  • Firefox See bugzil.la/1082060
  • Firefox for Android See bugzil.la/1082060
  • Safari
  • Safari on iOS