MCPcopy
hub / github.com/21st-dev/1code / useCodeTheme

Function useCodeTheme

src/renderer/lib/hooks/use-code-theme.ts:17–30  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

15 * 2. Fallback to legacy code-only theme atoms
16 */
17export function useCodeTheme(): string {
18 const { resolvedTheme } = useTheme()
19 const lightTheme = useAtomValue(vscodeCodeThemeLightAtom)
20 const darkTheme = useAtomValue(vscodeCodeThemeDarkAtom)
21 const fullTheme = useAtomValue(fullThemeDataAtom)
22
23 // If a full VS Code theme is selected, use its ID for syntax highlighting
24 if (fullTheme) {
25 return fullTheme.id
26 }
27
28 // Fallback to legacy code-only theme selection
29 return resolvedTheme === "light" ? lightTheme : darkTheme
30}

Callers 5

HighlightedJsonFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected