From a1b672417961096b8a95c979ddbc726a9f5d1684 Mon Sep 17 00:00:00 2001 From: Gabe Farrell Date: Wed, 18 Jun 2025 00:55:55 -0400 Subject: [PATCH] feat: add support for custom themes --- client/app/app.css | 7 +++ .../app/components/modals/SettingsModal.tsx | 2 +- .../themeSwitcher/ThemeSwitcher.tsx | 59 ++++++++++++++++--- client/app/providers/ThemeProvider.tsx | 21 ++++++- 4 files changed, 77 insertions(+), 12 deletions(-) diff --git a/client/app/app.css b/client/app/app.css index f0b786e..143572c 100644 --- a/client/app/app.css +++ b/client/app/app.css @@ -139,6 +139,13 @@ input[type="text"]:focus { outline: none; border: 1px solid var(--color-fg-tertiary); } +textarea { + border: 1px solid var(--color-bg); +} +textarea:focus { + outline: none; + border: 1px solid var(--color-fg-tertiary); +} input[type="password"] { border: 1px solid var(--color-bg); } diff --git a/client/app/components/modals/SettingsModal.tsx b/client/app/components/modals/SettingsModal.tsx index 4ae62d6..66ed7f9 100644 --- a/client/app/components/modals/SettingsModal.tsx +++ b/client/app/components/modals/SettingsModal.tsx @@ -19,7 +19,7 @@ export default function SettingsModal({ open, setOpen } : Props) { const contentClasses = "w-full px-2 mt-8 sm:mt-0 sm:px-10 overflow-y-auto" return ( - setOpen(false)} maxW={900}> + setOpen(false)} maxW={900}> { + console.log(custom) + try { + const theme = JSON.parse(custom) + theme.name = "custom" + setCustomTheme(theme) + delete theme.name + setCustom(JSON.stringify(theme, null, " ")) + console.log(theme) + } catch(err) { + console.log(err) + } + } useEffect(() => { if (theme) { @@ -14,13 +48,22 @@ export function ThemeSwitcher() { }, [theme]); return ( - <> -

Select Theme

-
- {themes.map((t) => ( - - ))} +
+
+

Select Theme

+
+ {themes.map((t) => ( + + ))} +
+
+
+

Use Custom Theme

+
+