Skip to content

Commit d95efb6

Browse files
committed
fix(dark-mode): sync tokens and fix black-on-black text
- global.css: dark muted #888 → #a3a3a3, dark faint #555 → #737373 (in sync with aichatbackup token set) - VaultDashboard: add text-foreground to root div so CSS vars re-resolve inside .dark scope (fixes inherited black-on-black) - PopupApp: add initialDark prop, dark state, and bg-background text-foreground on root div - StatusIndicator: replace hardcoded #fbfbfb / #000 / #e2e2e2 with var(--color-surface) / var(--color-foreground) / var(--color-grid)
1 parent ef80fb5 commit d95efb6

5 files changed

Lines changed: 12 additions & 7 deletions

File tree

.memory/decisions.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,5 @@
22

33
Architectural commitments made in this project.
44

5+
6+
- [dark-mode-tokens] Dark mode uses semantic CSS tokens. Never use dark:bg-[#hex] or dark:text-[#hex]. Use: text-foreground, bg-surface, bg-surface-hover, bg-surface-raised, bg-code, bg-background. FloatingDial uses CSS var() in inline styles (e.g. var(--color-surface)) since it can't use Tailwind for inline styles.

src/components/feedback/StatusIndicator.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ const defaultLabels: Record<SaveStatus, string> = {
2525
};
2626

2727
const statusColors: Record<SaveStatus, string> = {
28-
idle: "#fbfbfb",
28+
idle: "var(--color-surface)",
2929
saving: "#fb631b",
3030
done: "#27ae60",
3131
error: "#ef4444",
@@ -38,7 +38,7 @@ export function StatusIndicator({
3838
labels,
3939
}: StatusIndicatorProps) {
4040
const bg = statusColors[status];
41-
const textColor = status === "idle" ? "#000" : "#fff";
41+
const textColor = status === "idle" ? "var(--color-foreground)" : "#fff";
4242
const label = { ...defaultLabels, ...labels }[status];
4343

4444
return (
@@ -51,7 +51,7 @@ export function StatusIndicator({
5151
height: size,
5252
borderRadius: "50%",
5353
background: bg,
54-
border: "1px solid #e2e2e2",
54+
border: "1px solid var(--color-grid)",
5555
color: textColor,
5656
display: "flex",
5757
alignItems: "center",

src/components/views/PopupApp.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,18 +16,21 @@ interface PopupAppProps {
1616
loading?: boolean;
1717
version?: string;
1818
onOpenDashboard?: () => void;
19+
initialDark?: boolean;
1920
}
2021

2122
export function PopupApp({
2223
threads = [],
2324
loading = false,
2425
version = "0.1.0",
2526
onOpenDashboard,
27+
initialDark = false,
2628
}: PopupAppProps) {
29+
const [dark, setDark] = React.useState(initialDark);
2730
const countFor = (p: Provider) => threads.filter((t) => t.provider === p).length;
2831

2932
return (
30-
<div className="p-4 flex flex-col gap-4" style={{ width: 360 }}>
33+
<div className={`p-4 flex flex-col gap-4 bg-background text-foreground${dark ? " dark" : ""}`} style={{ width: 360 }}>
3134
{/* Header */}
3235
<div className="flex items-center justify-between pb-3 border-b border-grid">
3336
<HacklmLogo size={28} />

src/components/views/VaultDashboard.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ export function VaultDashboard({
5959
const providersWithThreads = ALL_PROVIDERS.filter((p) => threads.some((t) => t.provider === p));
6060

6161
return (
62-
<div className={`flex h-screen bg-background${dark ? " dark" : ""}`}>
62+
<div className={`flex h-screen bg-background text-foreground${dark ? " dark" : ""}`}>
6363

6464
{/* ── Sidebar ─────────────────────────────────────────┤ */}
6565
<aside className="w-64 shrink-0 bg-surface border-r border-grid p-4 flex flex-col gap-4">

src/styles/global.css

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,8 @@
6565
--color-code: #242424;
6666
--color-grid: #2a2a2a;
6767
--color-foreground: #e8e8e8;
68-
--color-muted: #888888;
69-
--color-faint: #555555;
68+
--color-muted: #a3a3a3;
69+
--color-faint: #737373;
7070
color-scheme: dark;
7171
}
7272
}

0 commit comments

Comments
 (0)