|
16 | 16 | --color-white: #FFFFFF; |
17 | 17 | --color-ink: #1E1B4B; /* Indigo 950 — body text */ |
18 | 18 | --color-primary-soft-bg: #EEF2FF; |
| 19 | + --color-primary-border: #C7D2FE; /* Indigo 200 */ |
19 | 20 |
|
20 | 21 | /* ── Supporting ───────────────────────────────────────────── */ |
21 | 22 | --color-border: #E2E8F0; /* slate-200 */ |
|
118 | 119 | --fg-3: var(--color-text-muted); |
119 | 120 | --bg-page: var(--color-surface); |
120 | 121 | --bg-surface: var(--color-white); |
| 122 | + |
| 123 | + /* Nav-active background — overridden in dark mode so the active pill |
| 124 | + reads as "raised" (lighter than navbar) instead of fading into bg. */ |
| 125 | + --nav-active-bg: var(--color-surface); |
| 126 | +} |
| 127 | + |
| 128 | +/* ═══════════════════════════════════════════════════════════════ |
| 129 | + Dark Theme — applied via <html data-theme="dark"> |
| 130 | + Strategy: re-map the same token names so every page that already |
| 131 | + uses var(--color-*) flips automatically. No HTML changes needed. |
| 132 | +
|
| 133 | + Specificity note: existing prototype pages redefine these tokens |
| 134 | + inside inline <style>{ :root { ... } } blocks. `:root` has |
| 135 | + specificity (0,1,0); `html[data-theme="dark"]` has (0,1,1), so the |
| 136 | + dark overrides win regardless of source order. |
| 137 | + ═══════════════════════════════════════════════════════════════ */ |
| 138 | +html[data-theme="dark"] { |
| 139 | + /* ── Core palette ─────────────────────────────────────────── */ |
| 140 | + --color-primary: #818CF8; /* indigo-400, brighter on dark */ |
| 141 | + --color-secondary: #A5B4FC; /* indigo-300 */ |
| 142 | + --color-cta: #34D399; /* emerald-400 */ |
| 143 | + --color-cta-hover: #10B981; |
| 144 | + --color-surface: #0B0B12; /* page bg, near-black */ |
| 145 | + --color-white: #16161F; /* card / sidebar bg, raised 1 step */ |
| 146 | + --color-ink: #E2E8F0; /* slate-200, primary text */ |
| 147 | + --color-primary-soft-bg: #1E1B4B; /* indigo-950 */ |
| 148 | + --color-primary-border: #3730A3; /* Indigo 800 */ |
| 149 | + |
| 150 | + /* ── Supporting ───────────────────────────────────────────── */ |
| 151 | + --color-border: #2A2A35; |
| 152 | + --color-border-muted: #1F1F28; |
| 153 | + --color-text-muted: #9CA3AF; /* slate-400 — raised from zinc-500 for WCAG AA */ |
| 154 | + --color-text-soft: #A1A1AA; /* zinc-400 */ |
| 155 | + --color-slate-50: #1F1F28; /* hover bg in dark */ |
| 156 | + |
| 157 | + /* Aliases */ |
| 158 | + --color-ink-muted: #9CA3AF; /* = --color-text-muted */ |
| 159 | + |
| 160 | + /* ── Semantic state — desaturated for dark backgrounds ────── */ |
| 161 | + --color-error: #F87171; |
| 162 | + --color-error-bg: #2A1414; |
| 163 | + --color-error-border: #5B2222; |
| 164 | + --color-error-soft-bg: #2A1414; |
| 165 | + --color-error-soft-border:#5B2222; |
| 166 | + |
| 167 | + --color-success: #4ADE80; |
| 168 | + --color-success-bg: #0F2A18; |
| 169 | + --color-success-border: #1F5132; |
| 170 | + --color-success-soft-bg: #0F2A18; |
| 171 | + --color-success-soft-border: #1F5132; |
| 172 | + |
| 173 | + --color-warning: #FACC15; |
| 174 | + --color-warning-bg: #2A2210; |
| 175 | + --color-warning-border: #5C4A1A; |
| 176 | + --color-warning-soft-bg: #2A2210; |
| 177 | + --color-warning-soft-border: #5C4A1A; |
| 178 | + |
| 179 | + --color-info: #60A5FA; |
| 180 | + --color-info-bg: #0F1F33; |
| 181 | + --color-info-border: #1E3A66; |
| 182 | + |
| 183 | + /* ── Shadows — much subtler on dark, mostly ring-style ────── */ |
| 184 | + --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.40); |
| 185 | + --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.45); |
| 186 | + --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.50); |
| 187 | + --shadow-xl: 0 20px 25px rgba(0, 0, 0, 0.55); |
| 188 | + --shadow-card: 0 0 0 1px rgba(129, 140, 248, 0.10), 0 4px 24px rgba(0, 0, 0, 0.40); |
| 189 | + |
| 190 | + /* Nav-active pill: lighter than --color-white (#16161F) so it reads as raised */ |
| 191 | + --nav-active-bg: #2A2A35; |
121 | 192 | } |
122 | 193 |
|
| 194 | +/* `data-theme` is always resolved to "light" or "dark" by theme.js. |
| 195 | + The "system" choice is resolved client-side using matchMedia. */ |
| 196 | + |
123 | 197 | /* ── Semantic type rules ──────────────────────────────────── */ |
124 | 198 | html[lang="zh-TW"] body, |
125 | 199 | html[lang="zh"] body { line-height: var(--leading-body-zh); } |
|
0 commit comments