Add dark mode for PWA frontend
Run Tests on Branches / Detect Changes (push) Successful in 12s
Run Tests on Branches / Backend Tests (push) Has been skipped
Run Tests on Branches / Frontend Tests (push) Successful in 1m47s
Run Tests on Branches / Frontend Mobile Tests (push) Has been skipped

This commit is contained in:
Antoni Nuñez Romeu
2026-07-09 13:18:25 +02:00
parent 2e9b2f2c1f
commit e9a1d7c53d
11 changed files with 289 additions and 33 deletions
+111
View File
@@ -71,6 +71,101 @@
--primary-shadow: rgba(127, 191, 143, 0.12);
--primary-light: #eaf7ec;
--primary-faint: rgba(127, 191, 143, 0.06);
--fab-bg: #2b5bb5;
--fab-text: #ffffff;
--fab-shadow: rgba(43, 91, 181, 0.32);
--warning: #b45309;
--warning-container: rgba(180, 83, 9, 0.12);
--suggestion-1: #ffffff;
--suggestion-2: #f0f7ff;
--suggestion-3: #e0f0ff;
--suggestion-4: #d4ebff;
--suggestion-border-1: #e2e8f0;
--suggestion-border-2: #dbeafe;
--suggestion-border-3: #bfdbfe;
--suggestion-border-4: #93c5fd;
--suggestion-text: #1e293b;
--suggestion-icon-bg: rgba(59, 130, 246, 0.08);
--suggestion-icon-color: #3b82f6;
}
/* ── Dark mode ── */
[data-theme="dark"] {
--primary: #8ed4a0;
--on-primary: #003912;
--primary-container: #1a5c2a;
--on-primary-container: #c2ecd0;
--secondary: #b8c9ff;
--on-secondary: #1a3066;
--secondary-container: #2a4080;
--on-secondary-container: #d9e2ff;
--tertiary: #dac4ff;
--on-tertiary: #3b2a5a;
--tertiary-container: #524070;
--on-tertiary-container: #efe7ff;
--surface: #111417;
--on-surface: #e1e3e4;
--on-surface-variant: #c0c9bb;
--surface-container-lowest: #0c0e10;
--surface-container-low: #191c1d;
--surface-container: #1e2122;
--surface-container-high: #282b2c;
--surface-container-highest: #333637;
--error: #ffb4ab;
--on-error: #690005;
--error-container: #93000a;
--on-error-container: #ffdad6;
--outline: #8a9486;
--outline-variant: #41493e;
--on-background: #e1e3e4;
--inverse-surface: #e1e3e4;
--inverse-on-surface: #2e3132;
--inverse-primary: #2e7d32;
--surface-tint: #8ed4a0;
--surface-dim: #111417;
--surface-bright: #373a3b;
--surface-variant: #41493e;
--primary-fixed: #acf4a4;
--primary-fixed-dim: #91d78a;
--secondary-fixed: #d9e2ff;
--secondary-fixed-dim: #b0c6ff;
--tertiary-fixed: #e9ddff;
--tertiary-fixed-dim: #cfbcff;
--shadow-soft: 0 4px 20px rgba(0, 0, 0, 0.32);
--text-main: var(--on-surface);
--text-muted: var(--on-surface-variant);
--surface-muted: var(--surface-container-low);
--surface-card: var(--surface-container-lowest);
--border: var(--outline-variant);
--border-strong: var(--outline);
--glass-bg: var(--surface-container);
--glass-border: var(--outline-variant);
--glass-shadow: var(--shadow-soft);
--accent: var(--primary);
--accent-warm: #f5a97a;
--primary-hover: #a0dfb0;
--primary-ring: rgba(142, 212, 160, 0.25);
--primary-shadow: rgba(142, 212, 160, 0.15);
--primary-light: #0d2b12;
--primary-faint: rgba(142, 212, 160, 0.08);
--fab-bg: #5b8bd5;
--fab-text: #ffffff;
--fab-shadow: rgba(91, 139, 213, 0.35);
--warning: #f59e0b;
--warning-container: rgba(245, 158, 11, 0.15);
--suggestion-1: #1e2122;
--suggestion-2: #1a2332;
--suggestion-3: #1a2a3a;
--suggestion-4: #1a3040;
--suggestion-border-1: #333637;
--suggestion-border-2: #2a4080;
--suggestion-border-3: #2a4a8a;
--suggestion-border-4: #3060a0;
--suggestion-text: #e1e3e4;
--suggestion-icon-bg: rgba(96, 165, 250, 0.12);
--suggestion-icon-color: #60a5fa;
}
* {
@@ -79,6 +174,14 @@
box-sizing: border-box;
}
html {
color-scheme: light;
}
[data-theme="dark"] {
color-scheme: dark;
}
html, body {
height: 100%;
overflow: hidden;
@@ -117,6 +220,14 @@ body::after {
z-index: -1;
}
[data-theme="dark"] body::before {
opacity: 0.15;
}
[data-theme="dark"] body::after {
background-color: rgba(0, 0, 0, 0.55);
}
#root {
height: 100dvh;
overflow: hidden;