-
TIL
:host-context()is a CSS selector for matching ancestor elements to a shadow tree. Great for use cases like theming whenprefers-color-schemeisn't available.css :host-context([theme="dark"]) { background-color: black; }
develwoutacause’s Twitter Archive—№ 50:host-context() is a CSS selector for matching ancestor elements to a shadow tree.
Great for use cases like theming when prefers-color-scheme isn't available.
css
:host-context([theme="dark"]) {
background-color: black;
}