detectHostTheme
megane-viewer / detectHostTheme
Function: detectHostTheme()
detectHostTheme(
doc?):ResolvedTheme|null
Defined in: stores/useThemeStore.ts:39
The theme the embedding host (not the OS) is showing, when it says so.
- JupyterLab marks
<body data-jp-theme-light="true|false">. - VSCode webviews (custom editor and notebook outputs) put
vscode-light,vscode-dark,vscode-high-contrastorvscode-high-contrast-lighton<body>and mirror it indata-vscode-theme-kind.
A VSCode or JupyterLab theme can disagree with the OS preference, so
"system" follows the host first and prefers-color-scheme only elsewhere.
Parameters
doc?
Document | undefined
Returns
ResolvedTheme | null