Open History to see the last commit
1import { createContext, useContext } from 'solid-js'
2import type { Accessor } from 'solid-js'
3β
4export const ThemeContext = createContext<Accessor<'light' | 'dark'>>(
5 () => 'dark' as const,
6)
7β
8/**
9 * Returns the devtools theme from context.
10 * @returns A getter for the current theme, `'light'` or `'dark'`. Defaults to `'dark'`.
11 */
12export function useTheme() {
13 return useContext(ThemeContext)
14}