MCPcopy Index your code
hub / github.com/github/docs / filterTheme

Function filterTheme

components/hooks/useTheme.ts:64–71  ·  view source on GitHub ↗
({ name = '', color_mode = '' } = {})

Source from the content-addressed store, hash-verified

62}
63
64function filterTheme({ name = '', color_mode = '' } = {}): SupportedTheme | undefined {
65 if (Object.values<string>(SupportedTheme).includes(name)) {
66 return name as SupportedTheme
67 }
68 if (Object.values<string>(SupportedTheme).includes(color_mode)) {
69 return color_mode as SupportedTheme
70 }
71}
72
73export function getCssTheme(cookieValue = ''): CssColorTheme {
74 if (!cookieValue) return defaultCSSTheme

Callers 1

getCssThemeFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected