MCPcopy
hub / github.com/microsoft/playwright / currentDocumentTheme

Function currentDocumentTheme

packages/web/src/theme.ts:88–94  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

86}
87
88export function currentDocumentTheme(): DocumentTheme | null {
89 if (document.documentElement.classList.contains('dark-mode'))
90 return 'dark-mode';
91 if (document.documentElement.classList.contains('light-mode'))
92 return 'light-mode';
93 return null;
94}
95
96export function useThemeSetting(): [Theme, (value: Theme) => void] {
97 const [theme, setTheme] = React.useState<Theme>(currentTheme());

Callers 2

XtermWrapperFunction · 0.90
updateDocumentThemeFunction · 0.85

Calls 1

containsMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…