Web platform 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.

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