From 2c717b670efa0bac2dc152a663bed1b53f1a667d Mon Sep 17 00:00:00 2001 From: Sidharth Vinod Date: Wed, 3 Sep 2025 16:47:14 +0530 Subject: [PATCH] chore: Update menu --- src/app.css | 3 + src/app.postcss | 68 --------------- src/lib/components/MainMenu.svelte | 129 +++++++++++++++++++---------- static/icons/mermaid-tail.svg | 4 + static/icons/mermaid.svg | 5 ++ 5 files changed, 98 insertions(+), 111 deletions(-) delete mode 100644 src/app.postcss create mode 100644 static/icons/mermaid-tail.svg create mode 100644 static/icons/mermaid.svg diff --git a/src/app.css b/src/app.css index 5c7e75e8..d55b7668 100644 --- a/src/app.css +++ b/src/app.css @@ -33,6 +33,7 @@ --destructive: hsl(0 72.22% 50.59%); --destructive-foreground: hsl(210 40% 98%); --border: hsl(214.3 31.8% 91.4%); + --border-dark: hsl(214.3 31.8% 81.4%); --input: hsl(214.3 31.8% 91.4%); --ring: hsl(222.2 84% 4.9%); --radius: 0.75rem; @@ -55,6 +56,7 @@ --destructive: hsl(0 62.8% 30.6%); --destructive-foreground: hsl(210 40% 98%); --border: hsl(217.2 32.6% 17.5%); + --border-dark: hsl(217.2 32.6% 27.5%); --input: hsl(217.2 32.6% 17.5%); --ring: hsl(212.7 26.8% 83.9%); } @@ -77,6 +79,7 @@ --color-card: var(--card); --color-card-foreground: var(--card-foreground); --color-border: var(--border); + --color-border-dark: var(--border-dark); --color-input: var(--input); --color-primary: var(--primary); --color-primary-foreground: var(--primary-foreground); diff --git a/src/app.postcss b/src/app.postcss deleted file mode 100644 index 8f63096c..00000000 --- a/src/app.postcss +++ /dev/null @@ -1,68 +0,0 @@ -@import '@fontsource-variable/recursive/crsv.css'; - -@tailwind base; -@tailwind components; -@tailwind utilities; - -@layer base { - :root { - --background: 0 0% 100%; - --foreground: 222.2 84% 4.9%; - --card: 0 0% 100%; - --card-foreground: 222.2 84% 4.9%; - --popover: 0 0% 100%; - --popover-foreground: 222.2 84% 4.9%; - --primary: 240 10% 91%; - --primary-foreground: 255 20% 15%; - --secondary: 210 40% 96.1%; - --secondary-foreground: 222.2 47.4% 11.2%; - --muted: 228 24% 96%; - --muted-foreground: 215.4 16.3% 46.9%; - --accent: 340 100% 44%; - --accent-foreground: 210 40% 98%; - --destructive: 0 72.22% 50.59%; - --destructive-foreground: 210 40% 98%; - --border: 214.3 31.8% 91.4%; - --input: 214.3 31.8% 91.4%; - --ring: 222.2 84% 4.9%; - --radius: 0.75rem; - } - .dark { - --background: 222.2 84% 4.9%; - --foreground: 210 40% 98%; - --card: 222.2 84% 4.9%; - --card-foreground: 210 40% 98%; - --popover: 222.2 84% 4.9%; - --popover-foreground: 210 40% 98%; - --primary: 210 40% 30%; - --primary-foreground: 222.2 47.4% 90%; - --secondary: 217.2 32.6% 17.5%; - --secondary-foreground: 210 40% 98%; - --muted: 217.2 32.6% 17.5%; - --muted-foreground: 215 20.2% 65.1%; - --accent: 340 100% 44%; - --accent-foreground: 210 40% 98%; - --destructive: 0 62.8% 30.6%; - --destructive-foreground: 210 40% 98%; - --border: 217.2 32.6% 17.5%; - --input: 217.2 32.6% 17.5%; - --ring: 212.7 26.8% 83.9%; - } -} - -@layer base { - * { - @apply border-border; - } - body { - @apply h-screen w-screen overflow-hidden bg-background text-foreground; - } -} - -body { - font-family: 'Recursive Variable', sans-serif; -} - -.d { - @apply border border-red-500; -} diff --git a/src/lib/components/MainMenu.svelte b/src/lib/components/MainMenu.svelte index 6747facf..32a68cdd 100644 --- a/src/lib/components/MainMenu.svelte +++ b/src/lib/components/MainMenu.svelte @@ -1,56 +1,95 @@ -{#snippet menuItem(options: { label: string; icon: Component; href: string; class?: string })} +{#snippet menuItem(options: MenuItem)} @@ -58,36 +97,40 @@ {/snippet} +{#snippet mcMenuItem(item: MenuItem)} + + {@render menuItem(item)} + +{/snippet} + +{#snippet darkModeMenuItem(options: MenuItem)} +
+ + + Dark Mode + + setMode(dark ? 'dark' : 'light')} /> +
+{/snippet} + - Mermaid Live Editor + - - {#each menuItems as item (item.label)} - {@render menuItem(item)} - {/each} - -
- - - Dark Mode - - setMode(dark ? 'dark' : 'light')} /> -
- - {#each mermaidChartMenuItems as item (item.label)} - - {@render menuItem({ - ...item, - class: 'text-accent bg-background hover:bg-muted' - })} - + + {#each menuItems as { renderer, ...item } (item.label)} + {@render renderer(item)} {/each}
diff --git a/static/icons/mermaid-tail.svg b/static/icons/mermaid-tail.svg new file mode 100644 index 00000000..054a47e0 --- /dev/null +++ b/static/icons/mermaid-tail.svg @@ -0,0 +1,4 @@ + + + + diff --git a/static/icons/mermaid.svg b/static/icons/mermaid.svg new file mode 100644 index 00000000..b8f2cf83 --- /dev/null +++ b/static/icons/mermaid.svg @@ -0,0 +1,5 @@ + + + + +