metacubexd/src/signals/theme.ts

9 lines
290 B
TypeScript
Raw Normal View History

import { makePersisted } from '@solid-primitives/storage'
import { createSignal } from 'solid-js'
import { themes } from '~/constants'
export const [curTheme, setCurTheme] = makePersisted(
createSignal<(typeof themes)[number]>('halloween'),
{ name: 'theme', storage: localStorage },
)