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

Function getComponentTheme

components/hooks/useTheme.ts:90–99  ·  view source on GitHub ↗
(cookieValue = '')

Source from the content-addressed store, hash-verified

88}
89
90export function getComponentTheme(cookieValue = ''): ComponentColorTheme {
91 const { colorMode, lightTheme, darkTheme } = getCssTheme(cookieValue)
92 return {
93 // The cookie value is a primer/css color_mode.
94 // We need to convert that to a primer/react compatible version.
95 colorMode: cssColorModeToComponentColorMode[colorMode],
96 dayScheme: lightTheme,
97 nightScheme: darkTheme,
98 }
99}
100
101export function useTheme() {
102 const [theme, setTheme] = useState<ColorModeThemes>({

Callers 2

use-theme.jsFile · 0.90
useThemeFunction · 0.85

Calls 1

getCssThemeFunction · 0.85

Tested by

no test coverage detected