From 0151b9a01f98ebcb839a5897d4d789b354b05faf Mon Sep 17 00:00:00 2001 From: Nikolay Tatarinov Date: Fri, 6 Feb 2026 18:33:44 +0300 Subject: [PATCH] Add dark theme support in CSS and fix neutral color variable in HTML template --- static/css/main.css | 40 ++++++++++++++++++++++++++++++++++++++++ templates/index.html | 2 +- 2 files changed, 41 insertions(+), 1 deletion(-) diff --git a/static/css/main.css b/static/css/main.css index f4302f0..258779c 100644 --- a/static/css/main.css +++ b/static/css/main.css @@ -36,4 +36,44 @@ --noise: 0; } +@plugin "daisyui/theme" { + name: "dark"; + default: false; + prefersdark: true; + color-scheme: "dark"; + --color-base-100: oklch(22% 0.014 260); + --color-base-200: oklch(19% 0.012 260); + --color-base-300: oklch(16% 0.01 260); + --color-base-content: oklch(95% 0.01 260); + --color-primary: oklch(58% 0.2 270); + --color-primary-content: oklch(96% 0.02 272); + --color-secondary: oklch(62% 0.15 250); + --color-secondary-content: oklch(96% 0.02 250); + --color-accent: oklch(72% 0.18 280); + --color-accent-content: oklch(20% 0.02 280); + --color-neutral: oklch(28% 0.02 260); + --color-neutral-content: oklch(92% 0.004 286.32); + --color-info: oklch(74% 0.16 232.661); + --color-info-content: oklch(29% 0.066 243.157); + --color-success: oklch(76% 0.177 163.223); + --color-success-content: oklch(37% 0.077 168.94); + --color-warning: oklch(82% 0.189 84.429); + --color-warning-content: oklch(41% 0.112 45.904); + --color-error: oklch(71% 0.194 13.428); + --color-error-content: oklch(27% 0.105 12.094); + --radius-selector: 0.5rem; + --radius-field: 0.25rem; + --radius-box: 0.5rem; + --size-selector: 0.25rem; + --size-field: 0.25rem; + --border: 1px; + --depth: 1; + --noise: 0; +} + +/* Dark theme: main content area uses base-200 so navbar and cards (base-100) stand out */ +[data-theme=dark] main { + background-color: var(--color-base-200); +} + @source "../../templates"; \ No newline at end of file diff --git a/templates/index.html b/templates/index.html index e76840a..adc1eb1 100644 --- a/templates/index.html +++ b/templates/index.html @@ -680,7 +680,7 @@ primary: getCSSVar('--color-primary'), secondary: getCSSVar('--color-secondary'), accent: getCSSVar('--color-accent'), - neutral: getCSSVar('-color-neutral'), + neutral: getCSSVar('--color-neutral'), info: getCSSVar('--color-info'), success: getCSSVar('--color-success'), warning: getCSSVar('--color-warning'),