WIP: Theme switcher

- Light/Dark Toggle works
- Theme Preview works
- TODO: Theme switching
This commit is contained in:
grimsi
2024-04-08 11:33:47 +02:00
parent 5a2b26ee0c
commit 47f8febbd2
11 changed files with 662 additions and 683 deletions
+9 -7
View File
@@ -1,18 +1,20 @@
import {useAtom} from "jotai"
import {atomWithStorage} from "jotai/utils"
import {Theme} from "Frontend/@/registry/themes"
import {Theme} from "@/registry/themes"
type Config = {
theme: Theme["name"]
mode: "light" | "dark",
radius: number
theme: {
name: Theme["name"],
mode: "light" | "dark" | "system"
}
}
const configAtom = atomWithStorage<Config>("config", {
theme: "zinc",
mode: "light",
radius: 0.5,
theme: {
name: "zinc",
mode: "system"
}
})
export function useConfig() {