MCPcopy
hub / github.com/srcbookdev/srcbook / getTheme

Function getTheme

packages/components/src/components/use-theme.tsx:7–15  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

5export type CodeThemeType = typeof srcbookLight | typeof srcbookDark;
6
7export function getTheme(): ThemeType {
8 const theme = localStorage.getItem('sb:theme');
9
10 if (theme === 'light' || theme === 'dark') {
11 return theme;
12 }
13
14 return 'dark';
15}
16
17function persistTheme(theme: ThemeType) {
18 localStorage.setItem('sb:theme', theme);

Callers 1

useThemeFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected