Skip to content

installExplorerTheme

reference
1 min readUpdated

Kind: Function

Source: atloria-monorepo/packages/ui-core/src/components/api-explorer/theme.ts

Put the mode-resolving sheet in the host document, once.

It has to live in the light DOM: only there can a selector see <html> and read the mode off it. Everything the sheet sets is a custom property on the explorer's own elements, so nothing outside the explorer changes — and from those elements the values inherit down through every shadow root the explorer opens.

Called from connectedCallback, which runs before the first render, so the very first paint is already themed.

Signature

ts
function installExplorerTheme(doc: Document): void

Parameters

NameType
docDocument

Returns: void

Was this page helpful?

Download as PDF