From ff2d3542195dc44b3359ede4b7aa31fa3562c0a7 Mon Sep 17 00:00:00 2001 From: Hibryda Date: Sat, 7 Mar 2026 22:07:14 +0100 Subject: [PATCH] feat(v3): add 7 editor themes to multi-theme system Generalize theme system from Catppuccin-only (4 flavors) to 11 themes across 2 groups. New editor themes: VSCode Dark+, Atom One Dark, Monokai, Dracula, Nord, Solarized Dark, GitHub Dark. All themes map to the same 26 --ctp-* CSS custom properties, so every component works unchanged. ThemeId replaces CatppuccinFlavor as primary type. Theme store uses getCurrentTheme()/setTheme() with deprecated wrappers. SettingsTab uses optgroup-based theme selector. --- .../components/Workspace/SettingsTab.svelte | 68 ++++- v2/src/lib/stores/theme.svelte.ts | 46 ++- v2/src/lib/styles/themes.ts | 283 ++++++++++-------- 3 files changed, 248 insertions(+), 149 deletions(-) diff --git a/v2/src/lib/components/Workspace/SettingsTab.svelte b/v2/src/lib/components/Workspace/SettingsTab.svelte index b68ac85..2e4e570 100644 --- a/v2/src/lib/components/Workspace/SettingsTab.svelte +++ b/v2/src/lib/components/Workspace/SettingsTab.svelte @@ -14,8 +14,8 @@ } from '../../stores/workspace.svelte'; import { deriveIdentifier } from '../../types/groups'; import { getSetting, setSetting } from '../../adapters/settings-bridge'; - import { getCurrentFlavor, setFlavor } from '../../stores/theme.svelte'; - import type { CatppuccinFlavor } from '../../styles/themes'; + import { getCurrentTheme, setTheme } from '../../stores/theme.svelte'; + import { THEME_LIST, type ThemeId } from '../../styles/themes'; let activeGroupId = $derived(getActiveGroupId()); let activeGroup = $derived(getActiveGroup()); @@ -29,8 +29,17 @@ // Global settings let defaultShell = $state(''); let defaultCwd = $state(''); - let themeFlavor = $state(getCurrentFlavor()); - const flavors: CatppuccinFlavor[] = ['latte', 'frappe', 'macchiato', 'mocha']; + let selectedTheme = $state(getCurrentTheme()); + + // Group themes by category for + const themeGroups = $derived(() => { + const map = new Map(); + for (const t of THEME_LIST) { + if (!map.has(t.group)) map.set(t.group, []); + map.get(t.group)!.push(t); + } + return [...map.entries()]; + }); onMount(async () => { const [shell, cwd] = await Promise.all([ @@ -39,7 +48,7 @@ ]); defaultShell = shell ?? ''; defaultCwd = cwd ?? ''; - themeFlavor = getCurrentFlavor(); + selectedTheme = getCurrentTheme(); }); async function saveGlobalSetting(key: string, value: string) { @@ -50,9 +59,9 @@ } } - async function handleThemeChange(flavor: CatppuccinFlavor) { - themeFlavor = flavor; - await setFlavor(flavor); + async function handleThemeChange(themeId: ThemeId) { + selectedTheme = themeId; + await setTheme(themeId); } // New project form @@ -92,14 +101,18 @@

Global

- +
@@ -154,14 +167,14 @@ {#each activeGroup.projects as project}
-