Skip to content

πŸ™Œ OpenHands: AI-Driven Development

feat: Support Light+ and Solarized Light theme (#16632)

david l eulera3cfe98267c5
diff --git a/__tests__/components/buttons/circle-plus-check-toggle.test.tsx b/__tests__/components/buttons/circle-plus-check-toggle.test.tsx
index 24793eb8db..9826045145 100644
--- a/__tests__/components/buttons/circle-plus-check-toggle.test.tsx
+++ b/__tests__/components/buttons/circle-plus-check-toggle.test.tsx
@@ -8,9 +8,7 @@ import {
describe("CirclePlusBadge", () => {
it("renders a decorative plus with hover styles and tooltip", () => {
- render(
- <CirclePlusBadge testId="automation-plus" />,
- );
+ render(<CirclePlusBadge testId="automation-plus" />);
const plusBadge = screen.getByTestId("automation-plus");
expect(plusBadge.tagName).toBe("SPAN");
@@ -74,8 +72,8 @@ describe("CirclePlusCheckToggle", () => {
const toggle = screen.getByTestId("skill-toggle");
expect(toggle).toHaveAttribute("data-showing-remove", "false");
- expect(toggle.className).toContain("border-white");
- expect(toggle.className).not.toContain("bg-white");
+ expect(toggle.className).toContain("border-contrast");
+ expect(toggle.className).not.toContain("bg-contrast");
await user.hover(toggle);
expect(toggle).toHaveAttribute("data-showing-remove", "true");
diff --git a/__tests__/components/conversation-events/chat/task-tracking-item-status.test.tsx b/__tests__/components/conversation-events/chat/task-tracking-item-status.test.tsx
index 799424e6bf..44780613c1 100644
--- a/__tests__/components/conversation-events/chat/task-tracking-item-status.test.tsx
+++ b/__tests__/components/conversation-events/chat/task-tracking-item-status.test.tsx
@@ -61,7 +61,7 @@ describe("conversation task status display", () => {
expect(title).toHaveClass("text-muted");
} else {
expect(icon).toHaveClass("text-[#ffffff]");
- expect(title).toHaveClass("text-white");
+ expect(title).toHaveClass("text-contrast");
expect(title).not.toHaveClass("text-muted");
}
},
diff --git a/__tests__/components/features/chat/change-agent-button.test.tsx b/__tests__/components/features/chat/change-agent-button.test.tsx
index 7607977af3..dda0b35141 100644
--- a/__tests__/components/features/chat/change-agent-button.test.tsx
+++ b/__tests__/components/features/chat/change-agent-button.test.tsx
@@ -246,8 +246,8 @@ describe("ChangeAgentButton mode selection", () => {
"border-transparent",
"text-muted",
"cursor-pointer",
- "hover:text-white",
- "hover:bg-white/10",
+ "hover:text-contrast",
+ "hover:bg-contrast/10",
);
expect(screen.getByTestId("code-agent-icon")).toBeInTheDocument();
expect(screen.queryByTestId("plan-agent-icon")).not.toBeInTheDocument();
@@ -269,7 +269,7 @@ describe("ChangeAgentButton mode selection", () => {
const label = screen.getByText("COMMON$CODE");
expect(label).toHaveClass("text-[11px]");
- expect(label).toHaveClass("text-white");
+ expect(label).toHaveClass("text-inherit");
expect(label).not.toHaveClass("text-2.75");
});
@@ -382,13 +382,16 @@ describe("ChangeAgentButton availability", () => {
expect(button).toHaveClass("opacity-50", "cursor-not-allowed");
[
"cursor-pointer",
- "hover:text-white",
- "hover:bg-white/10",
- "text-white",
+ "hover:text-contrast",
+ "hover:bg-contrast/10",
"hover:bg-[#597FF4]",
].forEach((interactiveClass) => {
expect(button).not.toHaveClass(interactiveClass);
});
+ if (overrides.conversationMode === "plan") {
+ expect(button).toHaveClass("text-white", "bg-[#4A67BD]");
+ expect(screen.getByText("COMMON$PLAN")).toHaveClass("text-inherit");
+ }
await user.click(button);
fireEvent.keyDown(document, { key: "Tab", shiftKey: true });
diff --git a/__tests__/components/features/chat/components/context-window-meter.test.tsx b/__tests__/components/features/chat/components/context-window-meter.test.tsx
index b6542d2bc2..2136bceac6 100644
--- a/__tests__/components/features/chat/components/context-window-meter.test.tsx
+++ b/__tests__/components/features/chat/components/context-window-meter.test.tsx
@@ -118,7 +118,7 @@ describe("ContextWindowMeter", () => {
renderWithProviders(<ContextWindowMeter />);
const trigger = screen.getByTestId("context-window-meter");
- expect(trigger).toHaveClass("hover:bg-white/10");
+ expect(trigger).toHaveClass("hover:bg-contrast/10");
expect(trigger.className).not.toContain("--oh-interactive-hover");
});
@@ -150,9 +150,7 @@ describe("ContextWindowMeter", () => {
expect(
screen.getByTestId("context-window-compact-button"),
).toHaveTextContent("CONVERSATION$COMPACT_CONTEXT");
- expect(
- screen.getByText("CONVERSATION$CONTEXT_WINDOW"),
- ).toBeInTheDocument();
+ expect(screen.getByText("CONVERSATION$CONTEXT_WINDOW")).toBeInTheDocument();
});
it("opens the Usage drawer from the popover meter", () => {
diff --git a/__tests__/components/features/chat/components/context-window-ring.test.tsx b/__tests__/components/features/chat/components/context-window-ring.test.tsx
index 34e1940cc2..93d0e97be2 100644
--- a/__tests__/components/features/chat/components/context-window-ring.test.tsx
+++ b/__tests__/components/features/chat/components/context-window-ring.test.tsx
@@ -1,10 +1,8 @@
import { render, screen } from "@testing-library/react";
import { describe, expect, it } from "vitest";
-import {
- ContextWindowRing,
- CONTEXT_WINDOW_RING_TRACK_ALPHA,
-} from "#/components/features/chat/components/context-window-ring";
+import { ContextWindowRing } from "#/components/features/chat/components/context-window-ring";
import { COLOR_THEMES } from "#/themes/color-themes";
+import { AGENT_SERVER_UI_DEFAULT_CSS_VARIABLES } from "#/styles/agent-server-ui-style-scope";
/**
* WCAG 2.1 SC 1.4.11 asks 3:1 for non-text contrast. The ring's track carries
@@ -21,8 +19,6 @@ const MIN_RATIO = 3;
const SURFACE_STOP = "--cool-grey-925"; // --oh-surface, the composer background
const FOREGROUND_STOP = "--cool-grey-100"; // --oh-foreground, the neutral arc
-/** `chatInputIconButtonClassName` fills the trigger with `hover:bg-white/10`. */
-const HOVER_OVERLAY = "#FFFFFF";
const HOVER_ALPHA = 0.1;
function channels(hex: string): [number, number, number] {
@@ -76,9 +72,9 @@ describe("ContextWindowRing", () => {
render(<ContextWindowRing percentage={5} />);
// A stop-pinned track cannot hold across palettes; see the constant's docs.
- expect(screen.getByTestId("context-window-ring-track").style.stroke).toEqual(
- expect.stringContaining("var(--oh-foreground)"),
- );
+ expect(
+ screen.getByTestId("context-window-ring-track").style.stroke,
+ ).toEqual(expect.stringContaining("var(--oh-context-window-foreground)"));
});
/**
@@ -86,35 +82,43 @@ describe("ContextWindowRing", () => {
* contrast cases below describe the shipped track rather than a constant that
* could drift away from it.
*/
- function renderedTrackAlpha(): number {
+ function renderedTrackColor(): string {
render(<ContextWindowRing percentage={5} />);
- const { stroke } = screen.getByTestId("context-window-ring-track").style;
- const percent = stroke.match(/var\(--oh-foreground\)\s+([\d.]+)%/);
- if (!percent) {
- throw new Error(`track is not a foreground mix: ${stroke}`);
- }
- return Number(percent[1]) / 100;
+ return screen.getByTestId("context-window-ring-track").style.stroke;
}
it("renders the alpha it documents", () => {
- expect(renderedTrackAlpha()).toBeCloseTo(CONTEXT_WINDOW_RING_TRACK_ALPHA, 5);
+ expect(renderedTrackColor()).toContain(
+ "var(--oh-context-window-track-weight)",
+ );
});
describe.each(Object.entries(COLOR_THEMES))(
"contrast under the %s palette",
(_key, theme) => {
- const surface = theme.scale[SURFACE_STOP];
- const arc = theme.scale[FOREGROUND_STOP];
- const hoverFill = composite(HOVER_OVERLAY, surface, HOVER_ALPHA);
+ const surface =
+ theme.tokens?.["--oh-surface"] ?? theme.scale[SURFACE_STOP];
+ const arc =
+ theme.tokens?.["--oh-context-window-foreground"] ??
+ theme.scale[FOREGROUND_STOP];
+ const alpha =
+ Number.parseFloat(
+ theme.tokens?.["--oh-context-window-track-weight"] ??
+ AGENT_SERVER_UI_DEFAULT_CSS_VARIABLES[
+ "--oh-context-window-track-weight"
+ ],
+ ) / 100;
+ const hoverOverlay = theme.tokens?.["--oh-contrast"] ?? "#FFFFFF";
+ const hoverFill = composite(hoverOverlay, surface, HOVER_ALPHA);
it("keeps the track legible against the composer surface", () => {
- const track = composite(arc, surface, renderedTrackAlpha());
+ const track = composite(arc, surface, alpha);
expect(contrastRatio(track, surface)).toBeGreaterThanOrEqual(MIN_RATIO);
});
it("keeps the track legible under the trigger's hover fill", () => {
- const track = composite(arc, hoverFill, renderedTrackAlpha());
+ const track = composite(arc, hoverFill, alpha);
expect(contrastRatio(track, hoverFill)).toBeGreaterThanOrEqual(
MIN_RATIO,
@@ -122,8 +126,6 @@ describe("ContextWindowRing", () => {
});
it("keeps a neutral arc distinguishable from the track in both states", () => {
- const alpha = renderedTrackAlpha();
-
expect(
contrastRatio(arc, composite(arc, surface, alpha)),
).toBeGreaterThanOrEqual(MIN_RATIO);
diff --git a/__tests__/components/features/chat/git-control-bar-pull-button.test.tsx b/__tests__/components/features/chat/git-control-bar-pull-button.test.tsx
index ebef9b957c..0c78c79fdc 100644
--- a/__tests__/components/features/chat/git-control-bar-pull-button.test.tsx
+++ b/__tests__/components/features/chat/git-control-bar-pull-button.test.tsx
@@ -54,11 +54,11 @@ describe("GitControlBarPullButton", () => {
const button = screen.getByRole("button");
expect(button).not.toBeDisabled();
- expect(button.className).toContain("text-white");
+ expect(button.className).toContain("text-contrast");
expect(button.className).toContain("hover:bg-tertiary");
expect(screen.getByTestId("pull-icon")).toHaveAttribute(
"data-color",
- "white",
+ "var(--oh-contrast)",
);
});
});
diff --git a/__tests__/components/features/command-menu/command-menu.test.tsx b/__tests__/components/features/command-menu/command-menu.test.tsx
index 8513c6c044..26cc0f304a 100644
--- a/__tests__/components/features/command-menu/command-menu.test.tsx
+++ b/__tests__/components/features/command-menu/command-menu.test.tsx
@@ -412,7 +412,7 @@ describe("CommandMenu", () => {
"border-border",
"shadow-[0_24px_90px_rgba(0,0,0,0.52),0_0_0_1px_rgba(255,255,255,0.03)_inset]",
);
- expect(activeOption).toHaveClass("rounded-xl", "bg-white/[0.09]");
+ expect(activeOption).toHaveClass("rounded-xl", "bg-contrast/[0.09]");
expect(inactiveOption).toHaveClass("rounded-xl", "text-muted");
expect(activeIcon).toHaveClass("size-9", "border-accent");
expect(inactiveIcon).toHaveClass("size-9", "border-border");
diff --git a/__tests__/components/features/conversation-panel/conversation-group-folder-interactions.test.tsx b/__tests__/components/features/conversation-panel/conversation-group-folder-interactions.test.tsx
index cdd4915053..3693e00a21 100644
--- a/__tests__/components/features/conversation-panel/conversation-group-folder-interactions.test.tsx
+++ b/__tests__/components/features/conversation-panel/conversation-group-folder-interactions.test.tsx
@@ -188,7 +188,7 @@ describe("conversation group folder interactions", () => {
expect(add).toHaveClass(
"h-6",
"text-inherit",
- "hover:bg-white/10",
+ "hover:bg-contrast/10",
"focus-visible:outline-none",
"disabled:cursor-not-allowed",
);
diff --git a/__tests__/components/features/conversation/conversation-name-with-status.test.tsx b/__tests__/components/features/conversation/conversation-name-with-status.test.tsx
index 293391dd38..70980ea740 100644
--- a/__tests__/components/features/conversation/conversation-name-with-status.test.tsx
+++ b/__tests__/components/features/conversation/conversation-name-with-status.test.tsx
@@ -223,9 +223,8 @@ describe("conversation name status controls", () => {
it("opens on mouse hover and closes when the pointer leaves", () => {
renderSubject();
- const container = screen.getByTestId(
- "server-status-menu-trigger",
- ).parentElement as HTMLElement;
+ const container = screen.getByTestId("server-status-menu-trigger")
+ .parentElement as HTMLElement;
expect(
screen.queryByTestId("server-status-context-menu"),
@@ -250,9 +249,8 @@ describe("conversation name status controls", () => {
it("ignores hover from non-mouse pointers", () => {
renderSubject();
- const container = screen.getByTestId(
- "server-status-menu-trigger",
- ).parentElement as HTMLElement;
+ const container = screen.getByTestId("server-status-menu-trigger")
+ .parentElement as HTMLElement;
fireEvent.pointerEnter(container, { pointerType: "touch" });
@@ -264,7 +262,7 @@ describe("conversation name status controls", () => {
it("toggles the menu closed and reflects aria-expanded when clicked twice", () => {
renderSubject();
const trigger = screen.getByTestId("server-status-menu-trigger");
- expect(trigger).toHaveClass("rounded-md", "hover:bg-white/10");
+ expect(trigger).toHaveClass("rounded-md", "hover:bg-contrast/10");
expect(trigger).toHaveAttribute("aria-expanded", "false");
fireEvent.click(trigger);
diff --git a/__tests__/components/features/conversation/conversation-overview-diffs-row.test.tsx b/__tests__/components/features/conversation/conversation-overview-diffs-row.test.tsx
index 9912d302f4..29c3a6b30b 100644
--- a/__tests__/components/features/conversation/conversation-overview-diffs-row.test.tsx
+++ b/__tests__/components/features/conversation/conversation-overview-diffs-row.test.tsx
@@ -71,7 +71,9 @@ describe("ConversationOverviewDiffsRow", () => {
await user.click(
screen.getByTestId("conversation-overview-diffs-git-action"),
);
- await user.click(screen.getByTestId("conversation-overview-diffs-git-pull"));
+ await user.click(
+ screen.getByTestId("conversation-overview-diffs-git-pull"),
+ );
expect(useConversationStore.getState().messageToSend?.text).toContain(
"pull",
);
@@ -79,7 +81,9 @@ describe("ConversationOverviewDiffsRow", () => {
await user.click(
screen.getByTestId("conversation-overview-diffs-git-action"),
);
- await user.click(screen.getByTestId("conversation-overview-diffs-git-push"));
+ await user.click(
+ screen.getByTestId("conversation-overview-diffs-git-push"),
+ );
expect(useConversationStore.getState().messageToSend?.text).toContain(
"push",
);
@@ -130,11 +134,11 @@ describe("ConversationOverviewDiffsRow", () => {
"conversation-overview-diffs-git-action",
);
- expect(row).toHaveClass("hover:bg-white/5");
+ expect(row).toHaveClass("hover:bg-contrast/5");
expect(row?.className).toContain(
"has-[.conversation-overview-diffs-git-action:hover]:bg-transparent",
);
- expect(changesButton).not.toHaveClass("hover:bg-white/5");
- expect(gitAction).toHaveClass("hover:bg-white/10");
+ expect(changesButton).not.toHaveClass("hover:bg-contrast/5");
+ expect(gitAction).toHaveClass("hover:bg-contrast/10");
});
});
diff --git a/__tests__/components/shared/brand-button.test.tsx b/__tests__/components/shared/brand-button.test.tsx
index 72d27c9fda..1d3649d555 100644
--- a/__tests__/components/shared/brand-button.test.tsx
+++ b/__tests__/components/shared/brand-button.test.tsx
@@ -18,7 +18,7 @@ describe("BrandButton", () => {
// tailwind-merge, dropping text-sm or being dropped by a size override.
expect(screen.getByRole("button", { name: "Save" })).toHaveClass(
className ?? "text-sm",
- "text-on-primary",
+ "text-[var(--oh-accent-foreground)]",
);
},
);
diff --git a/__tests__/routes/llm-settings.test.tsx b/__tests__/routes/llm-settings.test.tsx
index d1f906b518..db431b6035 100644
--- a/__tests__/routes/llm-settings.test.tsx
+++ b/__tests__/routes/llm-settings.test.tsx
@@ -336,7 +336,7 @@ describe("LlmSettingsScreen", () => {
fireEvent.click(screen.getByTestId("subscription-connect"));
const userCode = await screen.findByTestId("subscription-user-code");
expect(userCode).toHaveTextContent("USER-CODE");
- expect(userCode.parentElement).toHaveClass("text-white");
+ expect(userCode.parentElement).toHaveClass("text-contrast");
expect(openSpy).toHaveBeenCalledWith(
"https://auth.openai.com/activate?user_code=USER-CODE",
diff --git a/__tests__/themes/color-theme-embedding.test.tsx b/__tests__/themes/color-theme-embedding.test.tsx
new file mode 100644
index 0000000000..8d3dc6b0bd
--- /dev/null
+++ b/__tests__/themes/color-theme-embedding.test.tsx
@@ -0,0 +1,20 @@
+import { render, screen } from "@testing-library/react";
+import { expect, it } from "vitest";
+import { AgentServerUIRoot } from "#/components/providers/agent-server-ui-root";
+
+it("does not apply a stored Canvas preference to an uninitialized library root", () => {
+ localStorage.setItem("openhands-color-theme", "light-plus");
+ try {
+ render(
+ <AgentServerUIRoot data-testid="embedded">
+ Embedded Canvas
+ </AgentServerUIRoot>,
+ );
+ expect(screen.getByTestId("embedded").firstElementChild).toHaveAttribute(
+ "data-theme",
+ "dark",
+ );
+ } finally {
+ localStorage.removeItem("openhands-color-theme");
+ }
+});
diff --git a/__tests__/themes/color-theme-runtime.test.tsx b/__tests__/themes/color-theme-runtime.test.tsx
new file mode 100644
index 0000000000..8373ab1a2f
--- /dev/null
+++ b/__tests__/themes/color-theme-runtime.test.tsx
@@ -0,0 +1,126 @@
+import { act, cleanup, render, screen } from "@testing-library/react";
+import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
+import { AgentServerUIRoot } from "#/components/providers/agent-server-ui-root";
+import {
+ AVAILABLE_COLOR_THEMES,
+ COLOR_THEME_BOOTSTRAP_SCRIPT,
+ DEFAULT_COLOR_THEME,
+ applyColorTheme,
+ getColorThemeCss,
+ readPersistedColorTheme,
+ setColorTheme,
+ subscribeColorTheme,
+} from "#/themes/color-themes";
+
+describe("color themes", () => {
+ beforeEach(() => {
+ window.localStorage.clear();
+ applyColorTheme(DEFAULT_COLOR_THEME);
+ });
+ afterEach(cleanup);
+
+ it("offers both light palettes", () => {
+ expect(AVAILABLE_COLOR_THEMES).toEqual(
+ expect.arrayContaining([
+ { key: "light-plus", label: "Light+" },
+ { key: "solarized-light", label: "Solarized Light" },
+ ]),
+ );
+ });
+
+ it("reactively updates mounted and newly mounted roots without overwriting caller styles", () => {
+ const props = {
+ styleOverrides: {
+ "--oh-background": "#123456",
+ "--oh-color-primary": "#abcdef",
+ },
+ };
+ const { rerender } = render(
+ <AgentServerUIRoot {...props} data-testid="scope">
+ Canvas
+ </AgentServerUIRoot>,
+ );
+ act(() => setColorTheme("light-plus"));
+ const scope = screen.getByTestId("scope");
+ expect(scope).toHaveAttribute("data-color-theme", "light-plus");
+ expect(scope.firstElementChild).toHaveClass("light");
+ expect(scope.style.getPropertyValue("--oh-background")).toBe("#123456");
+ expect(scope.style.getPropertyValue("--oh-color-primary")).toBe("#abcdef");
+ rerender(
+ <AgentServerUIRoot {...props} data-testid="scope">
+ Updated
+ </AgentServerUIRoot>,
+ );
+ expect(scope.style.getPropertyValue("--oh-background")).toBe("#123456");
+ render(<AgentServerUIRoot data-testid="new-scope">New</AgentServerUIRoot>);
+ expect(screen.getByTestId("new-scope")).toHaveAttribute(
+ "data-color-scheme",
+ "light",
+ );
+ expect(
+ screen.getByTestId("new-scope").style.getPropertyValue("--oh-background"),
+ ).toBe("");
+ act(() => setColorTheme("openhands-neutral"));
+ expect(scope.firstElementChild).toHaveClass("dark");
+ expect(scope.style.getPropertyValue("--oh-background")).toBe("#123456");
+ expect(
+ document.getElementById("oh-color-theme-override")?.textContent,
+ ).not.toContain("--oh-background: #FFFFFF");
+ });
+
+ it("persists selection and notifies only after CSS is applied", () => {
+ const listener = vi.fn(() => {
+ expect(
+ document.getElementById("oh-color-theme-override")?.textContent,
+ ).toBe(getColorThemeCss("solarized-light"));
+ });
+ const unsubscribe = subscribeColorTheme(listener);
+ setColorTheme("solarized-light");
+ expect(readPersistedColorTheme()).toBe("solarized-light");
+ expect(listener).toHaveBeenCalledOnce();
+ unsubscribe();
+ });
+
+ it.each(["light-plus", "solarized-light", "openhands-neutral"] as const)(
+ "bootstraps %s before React mounts",
+ (key) => {
+ // Reproduce the prerendered dark wrapper while app initialization waits.
+ render(<AgentServerUIRoot data-testid="shell">Canvas</AgentServerUIRoot>);
+ const wrapper = screen.getByTestId("shell").firstElementChild!;
+ expect(wrapper).toHaveAttribute("data-theme", "dark");
+ localStorage.setItem("openhands-color-theme", key);
+ document.getElementById("oh-color-theme-override")?.remove();
+ window.eval(COLOR_THEME_BOOTSTRAP_SCRIPT);
+ expect(
+ document.getElementById("oh-color-theme-override")?.textContent,
+ ).toBe(getColorThemeCss(key));
+ expect(document.documentElement.style.colorScheme).toBe(
+ key === "openhands-neutral" ? "dark" : "light",
+ );
+ // A later base sheet must not restore HeroUI's dark native controls.
+ const heroSheet = document.createElement("style");
+ heroSheet.textContent = ".dark { color-scheme: dark; }";
+ document.head.appendChild(heroSheet);
+ try {
+ expect(getComputedStyle(wrapper).colorScheme).toBe(
+ key === "openhands-neutral" ? "dark" : "light",
+ );
+ } finally {
+ heroSheet.remove();
+ }
+ },
+ );
+
+ it.each(["missing-theme", "constructor", "__proto__"])(
+ "rejects invalid stored key %s",
+ (key) => {
+ localStorage.setItem("openhands-color-theme", key);
+ expect(readPersistedColorTheme()).toBe(DEFAULT_COLOR_THEME);
+ document.getElementById("oh-color-theme-override")?.remove();
+ expect(() => window.eval(COLOR_THEME_BOOTSTRAP_SCRIPT)).not.toThrow();
+ expect(
+ document.getElementById("oh-color-theme-override")?.textContent,
+ ).toBe(getColorThemeCss(DEFAULT_COLOR_THEME));
+ },
+ );
+});
diff --git a/__tests__/themes/color-themes.test.tsx b/__tests__/themes/color-themes.test.tsx
index e4eeb68891..d0ea38d9c2 100644
--- a/__tests__/themes/color-themes.test.tsx
+++ b/__tests__/themes/color-themes.test.tsx
@@ -1,5 +1,5 @@
-import { render, screen } from "@testing-library/react";
-import { describe, expect, it } from "vitest";
+import { act, render, screen } from "@testing-library/react";
+import { afterEach, describe, expect, it } from "vitest";
import { AgentServerUIRoot } from "#/components/providers/agent-server-ui-root";
import {
AVAILABLE_COLOR_THEMES,
@@ -8,6 +8,28 @@ import {
} from "#/themes/color-themes";
describe("color themes", () => {
+ afterEach(() => {
+ document
+ .querySelectorAll("style[data-theme-test]")
+ .forEach((el) => el.remove());
+ });
+
+ it("leaves omitted tokens owned by consumer stylesheets", () => {
+ const sheet = document.createElement("style");
+ sheet.dataset.themeTest = "";
+ sheet.textContent =
+ "[data-agent-server-ui] { --oh-color-primary: #123456; --oh-radius: 12px; }";
+ document.head.appendChild(sheet);
+ render(
+ <AgentServerUIRoot data-testid="consumer-scope">
+ Canvas
+ </AgentServerUIRoot>,
+ );
+ act(() => applyColorTheme("openhands-neutral"));
+ const style = getComputedStyle(screen.getByTestId("consumer-scope"));
+ expect(style.getPropertyValue("--oh-color-primary")).toBe("#123456");
+ expect(style.getPropertyValue("--oh-radius")).toBe("12px");
+ });
it("includes OpenHands-Neo as a neutral-based theme with white button tokens", () => {
const neo = COLOR_THEMES["openhands-neo"];
@@ -55,7 +77,9 @@ describe("color themes", () => {
expect(styleEl?.textContent).toContain(
"[data-agent-server-ui][data-agent-server-ui] {",
);
- expect(styleEl?.textContent).toContain("[data-theme=dark][data-theme=dark] {");
+ expect(styleEl?.textContent).toContain(
+ "[data-agent-server-ui] [data-theme][data-theme] {",
+ );
styleEl?.remove();
});
@@ -78,6 +102,11 @@ describe("color themes", () => {
});
it("applies Neo button tokens on the scoped UI root used by primary buttons", () => {
+ const baseSheet = document.createElement("style");
+ baseSheet.dataset.themeTest = "";
+ baseSheet.textContent =
+ "[data-agent-server-ui] { --oh-color-primary: #c9b974; }";
+ document.head.appendChild(baseSheet);
render(
<AgentServerUIRoot>
<button type="button" data-testid="primary-button">
@@ -86,18 +115,20 @@ describe("color themes", () => {
</AgentServerUIRoot>,
);
- applyColorTheme("openhands-neo");
+ act(() => applyColorTheme("openhands-neo"));
- const scopeRoot = screen.getByTestId("primary-button").closest(
- "[data-agent-server-ui]",
- ) as HTMLElement;
+ const scopeRoot = screen
+ .getByTestId("primary-button")
+ .closest("[data-agent-server-ui]") as HTMLElement;
- expect(scopeRoot.style.getPropertyValue("--oh-color-primary")).toBe(
- "#ffffff",
- );
+ expect(
+ getComputedStyle(scopeRoot).getPropertyValue("--oh-color-primary"),
+ ).toBe("#ffffff");
- applyColorTheme("openhands-neutral");
+ act(() => applyColorTheme("openhands-neutral"));
- expect(scopeRoot.style.getPropertyValue("--oh-color-primary")).toBe("");
+ expect(
+ getComputedStyle(scopeRoot).getPropertyValue("--oh-color-primary"),
+ ).toBe("#c9b974");
});
});
diff --git a/src/components/conversation-events/chat/task-tracking/task-item.tsx b/src/components/conversation-events/chat/task-tracking/task-item.tsx
index 13f525f822..c420927036 100644
--- a/src/components/conversation-events/chat/task-tracking/task-item.tsx
+++ b/src/components/conversation-events/chat/task-tracking/task-item.tsx
@@ -38,7 +38,7 @@ export function TaskItem({ task }: TaskItemProps) {
<div className="shrink-0">{icon}</div>
<div className="flex flex-col items-start justify-center leading-5 text-nowrap whitespace-pre font-normal">
<Typography.Text
- className={cn("text-xs text-white", isDoneStatus && "text-muted")}
+ className={cn("text-xs text-contrast", isDoneStatus && "text-muted")}
>
{task.title}
</Typography.Text>
diff --git a/src/components/conversation-events/chat/task-tracking/task-list-section.tsx b/src/components/conversation-events/chat/task-tracking/task-list-section.tsx
index b673c03d01..a2aca766dc 100644
--- a/src/components/conversation-events/chat/task-tracking/task-list-section.tsx
+++ b/src/components/conversation-events/chat/task-tracking/task-list-section.tsx
@@ -17,7 +17,7 @@ export function TaskListSection({ taskList }: TaskListSectionProps) {
{/* Header Tabs */}
<div className="flex gap-1 items-center border-b border-border h-10.25 px-2 shrink-0">
<LessonPlanIcon className="shrink-0 w-4.5 h-4.5 text-muted" />
- <Typography.Text className="text-[11px] text-nowrap text-white tracking-[0.11px] font-medium leading-4 whitespace-pre">
+ <Typography.Text className="text-[11px] text-nowrap text-contrast tracking-[0.11px] font-medium leading-4 whitespace-pre">
{t(I18nKey.COMMON$TASKS)}
</Typography.Text>
</div>
diff --git a/src/components/features/alerts/alert-banner.tsx b/src/components/features/alerts/alert-banner.tsx
index 141a110638..0c1a5e5552 100644
--- a/src/components/features/alerts/alert-banner.tsx
+++ b/src/components/features/alerts/alert-banner.tsx
@@ -116,7 +116,7 @@ export function AlertBanner({
<div
data-testid="alert-banner"
className={cn(
- "bg-base border border-primary text-white p-4 rounded",
+ "bg-base border border-primary text-contrast p-4 rounded",
"flex flex-row items-center justify-between m-1",
currentPath === "/" && "mt-3 mr-3",
)}
diff --git a/src/components/features/automations/automation-action-button-classes.ts b/src/components/features/automations/automation-action-button-classes.ts
index 5409644dad..0cd11f0d54 100644
--- a/src/components/features/automations/automation-action-button-classes.ts
+++ b/src/components/features/automations/automation-action-button-classes.ts
@@ -2,6 +2,6 @@ import { cn } from "#/utils/utils";
import { dropdownInstantColorClassName } from "#/utils/dropdown-classes";
export const automationIconActionButtonClassName = cn(
- "inline-flex size-8 shrink-0 cursor-pointer items-center justify-center rounded-md border-0 bg-transparent text-muted hover:bg-interactive-hover hover:text-white focus-visible:outline-none disabled:cursor-not-allowed disabled:opacity-50 disabled:hover:bg-transparent disabled:hover:text-muted",
+ "inline-flex size-8 shrink-0 cursor-pointer items-center justify-center rounded-md border-0 bg-transparent text-muted hover:bg-interactive-hover hover:text-contrast focus-visible:outline-none disabled:cursor-not-allowed disabled:opacity-50 disabled:hover:bg-transparent disabled:hover:text-muted",
dropdownInstantColorClassName,
);
diff --git a/src/components/features/automations/automation-card.tsx b/src/components/features/automations/automation-card.tsx
index c7697d6953..e90053d384 100644
--- a/src/components/features/automations/automation-card.tsx
+++ b/src/components/features/automations/automation-card.tsx
@@ -245,7 +245,7 @@ export function AutomationCard({
placement="top"
closeDelay={100}
disableAnimation={disableAnimation}
- className="rounded-xl border border-border bg-base-secondary p-0 text-white shadow-xl"
+ className="rounded-xl border border-border bg-base-secondary p-0 text-contrast shadow-xl"
>
<span className="min-w-0 flex-1 cursor-default truncate text-text-secondary">
{shortSummary}
diff --git a/src/components/features/automations/automation-list-row.tsx b/src/components/features/automations/automation-list-row.tsx
index d2df5bab87..d1397ee0c2 100644
--- a/src/components/features/automations/automation-list-row.tsx
+++ b/src/components/features/automations/automation-list-row.tsx
@@ -131,7 +131,7 @@ export function AutomationListRow({
placement="top-start"
closeDelay={100}
disableAnimation={disableAnimation}
- className="rounded-xl border border-border bg-base-secondary p-0 text-white shadow-xl"
+ className="rounded-xl border border-border bg-base-secondary p-0 text-contrast shadow-xl"
>
<NavigationLink
to={detailHref}
diff --git a/src/components/features/automations/automation-view-toggle.tsx b/src/components/features/automations/automation-view-toggle.tsx
index 2a3f7e01b2..b4b99b2dfc 100644
--- a/src/components/features/automations/automation-view-toggle.tsx
+++ b/src/components/features/automations/automation-view-toggle.tsx
@@ -143,7 +143,7 @@ export function AutomationViewToggle({
setOpen((current) => !current);
}}
className={cn(
- "inline-flex size-9 shrink-0 cursor-pointer items-center justify-center rounded-lg border border-border bg-base-secondary text-white transition-colors hover:bg-interactive-hover focus-visible:border-white/40 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-white/20",
+ "inline-flex size-9 shrink-0 cursor-pointer items-center justify-center rounded-lg border border-border bg-base-secondary text-contrast transition-colors hover:bg-interactive-hover focus-visible:border-contrast/40 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-contrast/20",
"disabled:cursor-not-allowed disabled:opacity-50 disabled:hover:bg-base-secondary",
)}
>
diff --git a/src/components/features/automations/create-instructions.tsx b/src/components/features/automations/create-instructions.tsx
index 13a8b21fd9..cdfa46ddcc 100644
--- a/src/components/features/automations/create-instructions.tsx
+++ b/src/components/features/automations/create-instructions.tsx
@@ -20,7 +20,7 @@ function InlineCodeChip({ children }: { children?: ReactNode }) {
data-testid="automations-create-instructions-example"
className={cn(
"mx-0.5 inline-block rounded-sm border border-border-subtle",
- "bg-surface-raised px-1.5 py-0.5 align-baseline font-mono text-[11px] text-white",
+ "bg-surface-raised px-1.5 py-0.5 align-baseline font-mono text-[11px] text-contrast",
)}
>
{children}
diff --git a/src/components/features/automations/dashboard/automations-dashboard-controls.tsx b/src/components/features/automations/dashboard/automations-dashboard-controls.tsx
index 1565066e7d..212c888b65 100644
--- a/src/components/features/automations/dashboard/automations-dashboard-controls.tsx
+++ b/src/components/features/automations/dashboard/automations-dashboard-controls.tsx
@@ -100,13 +100,13 @@ export function AutomationsDashboardControls({
className={cn(
dropdownFilterTriggerClassName,
"h-9 py-0",
- activeCount > 0 && "border-white/60 bg-white/10",
+ activeCount > 0 && "border-contrast/60 bg-contrast/10",
)}
>
<ListFilter className="h-4 w-4 shrink-0" aria-hidden />
<span className="whitespace-nowrap">{filtersLabel}</span>
{activeCount > 0 ? (
- <span className="rounded-full bg-white px-1.5 text-[11px] font-medium text-black">
+ <span className="rounded-full bg-contrast px-1.5 text-[11px] font-medium text-contrast-foreground">
{activeCount}
</span>
) : null}
diff --git a/src/components/features/automations/dashboard/automations-filtered-empty-state.tsx b/src/components/features/automations/dashboard/automations-filtered-empty-state.tsx
index 533062847c..3eab3ca5ee 100644
--- a/src/components/features/automations/dashboard/automations-filtered-empty-state.tsx
+++ b/src/components/features/automations/dashboard/automations-filtered-empty-state.tsx
@@ -25,7 +25,7 @@ export function AutomationsFilteredEmptyState({
type="button"
data-testid="automations-clear-filters"
onClick={onClear}
- className="mt-2 text-sm text-white underline-offset-2 hover:underline"
+ className="mt-2 text-sm text-contrast underline-offset-2 hover:underline"
>
{t(I18nKey.AUTOMATIONS$CLEAR_FILTERS)}
</button>
diff --git a/src/components/features/automations/delete-confirmation-modal.tsx b/src/components/features/automations/delete-confirmation-modal.tsx
index e0e1fcbf87..9345ba3866 100644
--- a/src/components/features/automations/delete-confirmation-modal.tsx
+++ b/src/components/features/automations/delete-confirmation-modal.tsx
@@ -53,7 +53,7 @@ export function DeleteConfirmationModal({
<button
type="button"
onClick={onCancel}
- className="rounded-lg border border-border px-4 py-2 text-sm text-white hover:bg-surface-raised"
+ className="rounded-lg border border-border px-4 py-2 text-sm text-contrast hover:bg-surface-raised"
>
{t(I18nKey.AUTOMATIONS$CANCEL)}
</button>
diff --git a/src/components/features/automations/detail/prompt-section.tsx b/src/components/features/automations/detail/prompt-section.tsx
index 520e4d5c0d..83e01b5aba 100644
--- a/src/components/features/automations/detail/prompt-section.tsx
+++ b/src/components/features/automations/detail/prompt-section.tsx
@@ -69,7 +69,7 @@ export function PromptSection({ prompt }: PromptSectionProps) {
{isOverflowing ? (
<button
type="button"
- className="self-start cursor-pointer text-sm font-normal text-muted hover:text-white"
+ className="self-start cursor-pointer text-sm font-normal text-muted hover:text-contrast"
onClick={() => setIsExpanded((expanded) => !expanded)}
data-testid="automation-prompt-toggle"
>
diff --git a/src/components/features/automations/detail/run-logs-modal.tsx b/src/components/features/automations/detail/run-logs-modal.tsx
index c060070a8f..f174847b32 100644
--- a/src/components/features/automations/detail/run-logs-modal.tsx
+++ b/src/components/features/automations/detail/run-logs-modal.tsx
@@ -241,7 +241,7 @@ export function RunLogsModal({
const tabBaseClass =
"border-b-2 px-3 py-2 text-sm font-normal transition-colors focus:outline-none";
- const tabActiveClass = "border-[var(--oh-primary)] text-white";
+ const tabActiveClass = "border-[var(--oh-primary)] text-contrast";
const tabInactiveClass = "border-transparent text-muted hover:text-content";
return (
diff --git a/src/components/features/automations/detail/run-phase.tsx b/src/components/features/automations/detail/run-phase.tsx
index 12dae6593f..0ef3d943b5 100644
--- a/src/components/features/automations/detail/run-phase.tsx
+++ b/src/components/features/automations/detail/run-phase.tsx
@@ -185,7 +185,7 @@ export function RunPhase({
disableAnimation={import.meta.env.MODE === "test"}
classNames={{
content:
- "max-w-xs whitespace-pre-wrap break-words rounded-xl border border-border bg-base-secondary px-3 py-2 text-left text-xs text-white shadow-xl",
+ "max-w-xs whitespace-pre-wrap break-words rounded-xl border border-border bg-base-secondary px-3 py-2 text-left text-xs text-contrast shadow-xl",
}}
>
<span className="flex min-w-0 cursor-default items-center gap-1">
diff --git a/src/components/features/automations/empty-state.tsx b/src/components/features/automations/empty-state.tsx
index 66baaf7810..408619a361 100644
--- a/src/components/features/automations/empty-state.tsx
+++ b/src/components/features/automations/empty-state.tsx
@@ -12,7 +12,7 @@ export function EmptyState() {
data-testid="automations-empty"
className={extensionModuleEmptyStateClassName}
>
- <p className="text-sm text-white">{t(I18nKey.AUTOMATIONS$EMPTY)}</p>
+ <p className="text-sm text-contrast">{t(I18nKey.AUTOMATIONS$EMPTY)}</p>
<div className="mt-4 flex justify-center">
<CreateInstructions />
diff --git a/src/components/features/automations/error-state.tsx b/src/components/features/automations/error-state.tsx
index 8ff97b22b9..6ea00eef70 100644
--- a/src/components/features/automations/error-state.tsx
+++ b/src/components/features/automations/error-state.tsx
@@ -18,7 +18,7 @@ export function ErrorState({ onRetry }: ErrorStateProps) {
<button
type="button"
onClick={onRetry}
- className="mt-4 rounded-lg border border-border px-4 py-2 text-sm text-white hover:bg-surface-raised"
+ className="mt-4 rounded-lg border border-border px-4 py-2 text-sm text-contrast hover:bg-surface-raised"
>
{t(I18nKey.AUTOMATIONS$ERROR_RETRY)}
</button>
diff --git a/src/components/features/automations/import-automation-modal.tsx b/src/components/features/automations/import-automation-modal.tsx
index 04278b19cd..fd540cfe78 100644
--- a/src/components/features/automations/import-automation-modal.tsx
+++ b/src/components/features/automations/import-automation-modal.tsx
@@ -54,7 +54,7 @@ function ImportAutomationPicker({ onFile }: { onFile: (file: File) => void }) {
target="_blank"
rel="noopener noreferrer"
data-testid="import-automation-format-docs"
- className="text-white no-underline transition-colors hover:text-white"
+ className="text-contrast no-underline transition-colors hover:text-contrast"
>
{t(I18nKey.AUTOMATIONS$IMPORT_FORMAT_DOCS)}
</a>
diff --git a/src/components/features/automations/recommended-automations-rail.tsx b/src/components/features/automations/recommended-automations-rail.tsx
index 092bd15f89..1a7b8728eb 100644
--- a/src/components/features/automations/recommended-automations-rail.tsx
+++ b/src/components/features/automations/recommended-automations-rail.tsx
@@ -184,7 +184,7 @@ export function RecommendedAutomationsRail({
testId={`recommended-automation-rail-icon-${automation.id}`}
/>
<div className="min-w-0">
- <h3 className="truncate text-sm font-semibold text-white">
+ <h3 className="truncate text-sm font-semibold text-contrast">
{automation.name}
</h3>
<p className="mt-0.5 line-clamp-2 text-xs leading-relaxed text-tertiary-light">
diff --git a/src/components/features/automations/recommended-automations-section.tsx b/src/components/features/automations/recommended-automations-section.tsx
index ce4e15f827..5f291d77b9 100644
--- a/src/components/features/automations/recommended-automations-section.tsx
+++ b/src/components/features/automations/recommended-automations-section.tsx
@@ -130,7 +130,7 @@ function buildRecommendedAutomationPills(
<McpLogoBadge entry={entry} size="xs" />
{name}
{installed ? (
- <span className="text-white">
+ <span className="text-contrast">
{translate(I18nKey.RECOMMENDED_AUTOMATIONS$CONNECTED)}
</span>
) : !entry ? (
@@ -257,7 +257,7 @@ function AutomationCardGrid({
<div className="flex min-w-0 flex-1 flex-col gap-3">
<header className="flex items-start justify-between gap-3">
<div className="min-w-0 flex-1">
- <h3 className="truncate text-sm font-semibold text-white">
+ <h3 className="truncate text-sm font-semibold text-contrast">
{automation.name}
</h3>
<p className="mt-0.5 truncate text-xs text-tertiary-alt">
diff --git a/src/components/features/automations/responder-deployment-modal.tsx b/src/components/features/automations/responder-deployment-modal.tsx
index 4d1b0df528..8181a0c7d5 100644
--- a/src/components/features/automations/responder-deployment-modal.tsx
+++ b/src/components/features/automations/responder-deployment-modal.tsx
@@ -66,7 +66,7 @@ export function ResponderDeploymentModal({
className="flex flex-1 flex-col gap-3 rounded-xl border border-border bg-surface-raised p-4"
>
<div className="flex flex-col gap-1">
- <h3 className="text-sm font-semibold text-white">
+ <h3 className="text-sm font-semibold text-contrast">
{t(option.titleKey)}
</h3>
<p className="text-xs leading-relaxed text-tertiary-light">
diff --git a/src/components/features/automations/search-input.tsx b/src/components/features/automations/search-input.tsx
index 2f46e696ea..b41fb9d6da 100644
--- a/src/components/features/automations/search-input.tsx
+++ b/src/components/features/automations/search-input.tsx
@@ -17,7 +17,7 @@ export function SearchInput({ value, onChange, className }: SearchInputProps) {
className={cn(
"relative flex min-w-0 flex-1 items-center",
"h-9 rounded-lg border border-border bg-base-secondary",
- "focus-within:border-white/40 focus-within:ring-1 focus-within:ring-white/20",
+ "focus-within:border-contrast/40 focus-within:ring-1 focus-within:ring-contrast/20",
"transition-colors",
className,
)}
@@ -32,7 +32,7 @@ export function SearchInput({ value, onChange, className }: SearchInputProps) {
onChange={(e) => onChange(e.target.value)}
placeholder={t(I18nKey.AUTOMATIONS$SEARCH_PLACEHOLDER)}
aria-label={t(I18nKey.AUTOMATIONS$SEARCH_PLACEHOLDER)}
- className="min-w-0 flex-1 border-0 bg-transparent px-3 text-sm text-white outline-none placeholder:text-tertiary-alt"
+ className="min-w-0 flex-1 border-0 bg-transparent px-3 text-sm text-contrast outline-none placeholder:text-tertiary-alt"
/>
</div>
);
diff --git a/src/components/features/automations/turn-off-confirmation-modal.tsx b/src/components/features/automations/turn-off-confirmation-modal.tsx
index a44a7006e4..b15ca920dd 100644
--- a/src/components/features/automations/turn-off-confirmation-modal.tsx
+++ b/src/components/features/automations/turn-off-confirmation-modal.tsx
@@ -61,7 +61,7 @@ export function TurnOffConfirmationModal({
<button
type="button"
onClick={onCancel}
- className="rounded-lg border border-border px-4 py-2 text-sm text-white hover:bg-surface-raised"
+ className="rounded-lg border border-border px-4 py-2 text-sm text-contrast hover:bg-surface-raised"
>
{t(I18nKey.AUTOMATIONS$CANCEL)}
</button>
diff --git a/src/components/features/backends/backend-form-modal.tsx b/src/components/features/backends/backend-form-modal.tsx
index e7f979d265..6e830614e1 100644
--- a/src/components/features/backends/backend-form-modal.tsx
+++ b/src/components/features/backends/backend-form-modal.tsx
@@ -238,7 +238,10 @@ function BackendStatusBadge({
className="flex items-center gap-3 text-sm"
>
<BackendStatusDot isConnected={isConnected} />
- <span className="text-white" data-testid={`${testIdRoot}-status-label`}>
+ <span
+ className="text-contrast"
+ data-testid={`${testIdRoot}-status-label`}
+ >
{statusLabel}
</span>
<span className="text-tertiary-alt">Β·</span>
@@ -998,7 +1001,12 @@ function CloudLoginColumn({
<div className="flex w-full min-w-0 flex-col items-center gap-3">
{showBranding ? (
<div className="flex flex-col items-center gap-1">
- <OpenHandsLogoWhite width={56} height={56} aria-hidden />
+ <OpenHandsLogoWhite
+ width={56}
+ height={56}
+ className="text-contrast [&_path:not([fill=transparent])]:fill-current"
+ aria-hidden
+ />
<h4
className={modalTitleLgMediumClassName}
@@ -1138,8 +1146,8 @@ function BackendOptionTab({
"first:border-r first:border-r-border",
"focus-visible:z-10 focus-visible:outline-2 focus-visible:-outline-offset-2 focus-visible:outline-blue-300",
isSelected
- ? "bg-surface-raised text-white after:absolute after:inset-x-0 after:bottom-0 after:h-0.5 after:bg-primary"
- : "text-muted hover:bg-surface-raised hover:text-white",
+ ? "bg-surface-raised text-contrast after:absolute after:inset-x-0 after:bottom-0 after:h-0.5 after:bg-primary"
+ : "text-muted hover:bg-surface-raised hover:text-contrast",
)}
>
<span
@@ -1245,7 +1253,7 @@ function AgentServerGuidance({ location }: { location: AgentServerLocation }) {
>
{/* Heading wraps the button so the accordion keeps a real heading in the
document outline while the whole row stays clickable. */}
- <h4 className="text-white">
+ <h4 className="text-contrast">
<button
id={toggleId}
type="button"
@@ -1300,7 +1308,7 @@ function AgentServerGuidance({ location }: { location: AgentServerLocation }) {
{isRemote ? (
<div>
- <h5 className="font-medium text-white">
+ <h5 className="font-medium text-contrast">
{t(I18nKey.BACKEND$REMOTE_CONNECTION_TITLE)}
</h5>
<p className="mt-1 leading-5">
@@ -1308,7 +1316,7 @@ function AgentServerGuidance({ location }: { location: AgentServerLocation }) {
</p>
</div>
) : (
- <code className="block break-words font-mono text-xs text-white">
+ <code className="block break-words font-mono text-xs text-contrast">
{LOCAL_BACKEND_COMMAND}
</code>
)}
@@ -1368,6 +1376,7 @@ function AddBackendChooser({
width={32}
height={32}
data-testid="add-backend-option-cloud-logo"
+ className="text-contrast [&_path:not([fill=transparent])]:fill-current"
/>
}
onSelect={setSelectedOption}
diff --git a/src/components/features/backends/backend-row.tsx b/src/components/features/backends/backend-row.tsx
index d8cc356403..048b580de4 100644
--- a/src/components/features/backends/backend-row.tsx
+++ b/src/components/features/backends/backend-row.tsx
@@ -16,7 +16,7 @@ import { getBackendStatusLabel } from "./backend-status-label";
import { getLockedCloudHost } from "#/api/agent-server-config";
const ROW_ACTION_BUTTON_CLASS =
- "inline-flex cursor-pointer items-center justify-center rounded-md p-1 text-muted transition-colors hover:bg-interactive-hover hover:text-white";
+ "inline-flex cursor-pointer items-center justify-center rounded-md p-1 text-muted transition-colors hover:bg-interactive-hover hover:text-contrast";
interface BackendRowProps {
backend: Backend;
@@ -81,7 +81,9 @@ export function BackendRow({
<BackendStatusDot isConnected={dotStatus} />
<div className="flex min-w-0 flex-1 flex-col">
<div className="flex min-w-0 items-center gap-2">
- <span className="truncate text-sm text-white">{backend.name}</span>
+ <span className="truncate text-sm text-contrast">
+ {backend.name}
+ </span>
<BackendVersion backend={backend} />
</div>
{orgLabel ? (
diff --git a/src/components/features/backends/backend-selector.tsx b/src/components/features/backends/backend-selector.tsx
index 8db4bcc1c3..8ba81048c6 100644
--- a/src/components/features/backends/backend-selector.tsx
+++ b/src/components/features/backends/backend-selector.tsx
@@ -431,7 +431,7 @@ export function BackendSelector({
data-testid="backend-selector-settings-link"
aria-label={settingsLabel}
className={cn(
- "inline-flex items-center justify-center shrink-0 w-9 h-9 rounded-md text-muted hover:text-white hover:bg-surface-raised cursor-pointer",
+ "inline-flex items-center justify-center shrink-0 w-9 h-9 rounded-md text-muted hover:text-contrast hover:bg-surface-raised cursor-pointer",
formControlTransitionClassName,
)}
>
@@ -446,11 +446,11 @@ export function BackendSelector({
className={
isSettingsActive
? cn(
- "inline-flex items-center justify-center shrink-0 w-9 h-9 rounded-md bg-tertiary text-white font-normal cursor-pointer",
+ "inline-flex items-center justify-center shrink-0 w-9 h-9 rounded-md bg-tertiary text-contrast font-normal cursor-pointer",
formControlTransitionClassName,
)
: cn(
- "inline-flex items-center justify-center shrink-0 w-9 h-9 rounded-md text-muted hover:text-white hover:bg-surface-raised cursor-pointer",
+ "inline-flex items-center justify-center shrink-0 w-9 h-9 rounded-md text-muted hover:text-contrast hover:bg-surface-raised cursor-pointer",
formControlTransitionClassName,
)
}
diff --git a/src/components/features/backends/device-flow-auth.tsx b/src/components/features/backends/device-flow-auth.tsx
index a9b06f93c4..169dff7269 100644
--- a/src/components/features/backends/device-flow-auth.tsx
+++ b/src/components/features/backends/device-flow-auth.tsx
@@ -294,7 +294,7 @@ function DeviceFlowStatusContent({
>
<div className="flex items-center justify-center gap-2">
<LoadingSpinner />
- <span className="text-sm font-medium text-white">
+ <span className="text-sm font-medium text-contrast">
{t(I18nKey.BACKEND$AUTH_AWAITING)}
</span>
</div>
@@ -351,7 +351,7 @@ function DeviceFlowStatusContent({
function LoadingSpinner() {
return (
<svg
- className="animate-spin h-4 w-4 text-white"
+ className="animate-spin h-4 w-4 text-contrast"
xmlns="http://www.w3.org/2000/svg"
fill="none"
viewBox="0 0 24 24"
diff --git a/src/components/features/canvas-extensions/canvas-extension-card.tsx b/src/components/features/canvas-extensions/canvas-extension-card.tsx
index 076afbb48a..ca3f25d6ac 100644
--- a/src/components/features/canvas-extensions/canvas-extension-card.tsx
+++ b/src/components/features/canvas-extensions/canvas-extension-card.tsx
@@ -32,7 +32,7 @@ export function CanvasExtensionCard({
>
<header className="flex items-start justify-between gap-4">
<div className="min-w-0 flex-1">
- <h3 className="truncate text-sm font-semibold text-white">
+ <h3 className="truncate text-sm font-semibold text-contrast">
{displayName}
</h3>
<p className="mt-0.5 truncate text-xs text-tertiary-alt">
diff --git a/src/components/features/chat/change-agent-button.tsx b/src/components/features/chat/change-agent-button.tsx
index 08422fa9fb..7c989d22d0 100644
--- a/src/components/features/chat/change-agent-button.tsx
+++ b/src/components/features/chat/change-agent-button.tsx
@@ -169,13 +169,13 @@ export function ChangeAgentButton() {
formControlTransitionClassName,
isExecutionAgent
? "border border-transparent text-muted"
- : "border border-[#597FF4] bg-[#4A67BD]",
+ : "border border-[#597FF4] bg-[#4A67BD] text-white",
!isButtonDisabled &&
isExecutionAgent &&
cn("cursor-pointer", formControlMutedHoverClassName),
!isButtonDisabled &&
!isExecutionAgent &&
- "cursor-pointer text-white hover:bg-[#597FF4]",
+ "cursor-pointer hover:bg-[#597FF4]",
isButtonDisabled &&
cn(
"opacity-50 cursor-not-allowed",
@@ -185,7 +185,7 @@ export function ChangeAgentButton() {
>
<div className="flex items-center gap-1 pl-1.5">
{buttonIcon}
- <Typography.Text className="text-[11px] not-italic font-normal leading-5">
+ <Typography.Text className="text-[11px] text-inherit not-italic font-normal leading-5">
{buttonLabel}
</Typography.Text>
</div>
diff --git a/src/components/features/chat/chat-action-tooltip.tsx b/src/components/features/chat/chat-action-tooltip.tsx
index 2216fd2f0b..a4cb4dde40 100644
--- a/src/components/features/chat/chat-action-tooltip.tsx
+++ b/src/components/features/chat/chat-action-tooltip.tsx
@@ -15,7 +15,7 @@ export function ChatActionTooltip({
<StyledTooltip
content={tooltip}
placement="bottom"
- tooltipClassName="bg-white text-black text-xs font-medium leading-5"
+ tooltipClassName="bg-contrast text-contrast-foreground text-xs font-medium leading-5"
>
<span data-aria-label={ariaLabel}>{children}</span>
</StyledTooltip>
diff --git a/src/components/features/chat/chat-add-file-button.tsx b/src/components/features/chat/chat-add-file-button.tsx
index b09f8a6055..cf10ffe0b0 100644
--- a/src/components/features/chat/chat-add-file-button.tsx
+++ b/src/components/features/chat/chat-add-file-button.tsx
@@ -74,7 +74,7 @@ export function ChatAddFileButton({
chatInputIconButtonClassName,
"relative shrink-0 size-6",
disabled ? "cursor-not-allowed text-text-subtle" : undefined,
- menuOpen && !disabled && "text-white bg-white/10",
+ menuOpen && !disabled && "text-contrast bg-contrast/10",
)}
aria-label={t(I18nKey.CHAT_INTERFACE$PLUS_MENU)}
aria-expanded={menuOpen}
diff --git a/src/components/features/chat/chat-send-button.tsx b/src/components/features/chat/chat-send-button.tsx
index 37751ea1ab..e76070db15 100644
--- a/src/components/features/chat/chat-send-button.tsx
+++ b/src/components/features/chat/chat-send-button.tsx
@@ -16,10 +16,10 @@ export function ChatSendButton({
<button
type="button"
className={cn(
- "flex items-center justify-center rounded-full border border-white size-8",
+ "flex items-center justify-center rounded-full border border-contrast size-8",
disabled
? "cursor-not-allowed border-muted"
- : "cursor-pointer hover:bg-white/10",
+ : "cursor-pointer hover:bg-contrast/10",
buttonClassName,
)}
data-name="arrow-up-circle-fill"
diff --git a/src/components/features/chat/chat-suggestions.tsx b/src/components/features/chat/chat-suggestions.tsx
index 160fce1268..7b16fe9e0c 100644
--- a/src/components/features/chat/chat-suggestions.tsx
+++ b/src/components/features/chat/chat-suggestions.tsx
@@ -25,7 +25,7 @@ export function ChatSuggestions({ onSuggestionsClick }: ChatSuggestionsProps) {
className="pointer-events-auto absolute inset-x-4 bottom-37.75 top-0 flex flex-col items-center justify-center md:inset-x-8"
>
<div className="flex flex-col items-center p-4 rounded-xl w-full">
- <span className="pb-6 text-[32px] font-medium leading-5 text-white">
+ <span className="pb-6 text-[32px] font-medium leading-5 text-contrast">
{t(I18nKey.LANDING$TITLE)}
</span>
</div>
diff --git a/src/components/features/chat/components/chat-input-field.tsx b/src/components/features/chat/components/chat-input-field.tsx
index 0a06897b9c..c4274344b5 100644
--- a/src/components/features/chat/components/chat-input-field.tsx
+++ b/src/components/features/chat/components/chat-input-field.tsx
@@ -52,7 +52,7 @@ export function ChatInputField({
ref={chatInputRef}
className={cn(
// eslint-disable-next-line shadcn/no-arbitrary-values
- "chat-input bg-transparent text-white text-[16px] font-normal leading-5 outline-none resize-none custom-scrollbar min-h-5 max-h-100 [text-overflow:inherit] [text-wrap-mode:inherit] [white-space-collapse:inherit] block whitespace-pre-wrap",
+ "chat-input bg-transparent text-contrast text-[16px] font-normal leading-5 outline-none resize-none custom-scrollbar min-h-5 max-h-100 [text-overflow:inherit] [text-wrap-mode:inherit] [white-space-collapse:inherit] block whitespace-pre-wrap",
disabled && "cursor-not-allowed opacity-50",
)}
contentEditable={!disabled}
diff --git a/src/components/features/chat/components/chat-input-grip.tsx b/src/components/features/chat/components/chat-input-grip.tsx
index 686ca1770d..eb58e47ff4 100644
--- a/src/components/features/chat/components/chat-input-grip.tsx
+++ b/src/components/features/chat/components/chat-input-grip.tsx
@@ -41,7 +41,7 @@ export function ChatInputGrip({
<div
ref={gripRef}
className={cn(
- "pointer-events-none absolute top-0 left-0 w-full h-px bg-white z-[2] transition-opacity duration-200",
+ "pointer-events-none absolute top-0 left-0 w-full h-px bg-contrast z-[2] transition-opacity duration-200",
!canResize && "opacity-0",
canResize &&
(isGripVisible || isGripDragging
diff --git a/src/components/features/chat/components/context-window-ring.tsx b/src/components/features/chat/components/context-window-ring.tsx
index 20c650279d..71fa8fde41 100644
--- a/src/components/features/chat/components/context-window-ring.tsx
+++ b/src/components/features/chat/components/context-window-ring.tsx
@@ -5,7 +5,7 @@ const CONTEXT_WINDOW_RING_SIZE = 16;
const CONTEXT_WINDOW_RING_STROKE = 2;
/**
- * Opacity of the ring's unfilled track, as a fraction of `--oh-foreground`.
+ * Default opacity of the ring's unfilled track on dark themes.
*
* The track is derived from the foreground rather than pinned to a scale stop.
* It carries information (the arc's proportion is only readable against it), so
@@ -16,18 +16,17 @@ const CONTEXT_WINDOW_RING_STROKE = 2;
* fixes it, and no fixed stop holds across the three palettes in
* `color-themes.ts`, whose scales differ.
*
- * Compositing the foreground over whatever the active theme paints keeps the
- * track between surface and arc by construction rather than by coincidence.
- * 42% is the value that maximises the worst case across the shipped palettes;
- * `context-window-ring.test.tsx` asserts it per theme.
+ * Light palettes override the foreground and weight tokens because a single
+ * translucent mix cannot preserve 3:1 contrast on both dark and light
+ * surfaces. `context-window-ring.test.tsx` asserts the effective values for
+ * every shipped theme.
*/
-export const CONTEXT_WINDOW_RING_TRACK_ALPHA = 0.42;
-
/** Shared by the ring's track and the popover's usage bar, which had the same defect. */
-export const CONTEXT_WINDOW_TRACK_COLOR = `color-mix(in srgb, var(--oh-foreground) ${CONTEXT_WINDOW_RING_TRACK_ALPHA * 100}%, transparent)`;
+export const CONTEXT_WINDOW_TRACK_COLOR =
+ "color-mix(in srgb, var(--oh-context-window-foreground) var(--oh-context-window-track-weight), transparent)";
const TONE_STROKE = {
- neutral: "var(--oh-foreground)",
+ neutral: "var(--oh-context-window-foreground)",
warning: "#f59e0b", // amber-500
danger: "#ef4444", // red-500
} as const;
diff --git a/src/components/features/chat/confirmation-mode-enabled.tsx b/src/components/features/chat/confirmation-mode-enabled.tsx
index 1023223fed..e06bc071cd 100644
--- a/src/components/features/chat/confirmation-mode-enabled.tsx
+++ b/src/components/features/chat/confirmation-mode-enabled.tsx
@@ -17,7 +17,7 @@ function ConfirmationModeEnabled() {
<StyledTooltip
closeDelay={100}
content={t(I18nKey.COMMON$CONFIRMATION_MODE_ENABLED)}
- tooltipClassName="bg-white text-black hover:bg-transparent"
+ tooltipClassName="bg-contrast text-contrast-foreground hover:bg-transparent"
>
<div className="flex items-center justify-center w-6.5 h-6.5 rounded-lg bg-surface">
<LockIcon width={15} height={15} />
diff --git a/src/components/features/chat/git-control-bar-branch-button.tsx b/src/components/features/chat/git-control-bar-branch-button.tsx
index 566e992154..47fc80d5e9 100644
--- a/src/components/features/chat/git-control-bar-branch-button.tsx
+++ b/src/components/features/chat/git-control-bar-branch-button.tsx
@@ -56,7 +56,7 @@ export function GitControlBarBranchButton({
<BranchIcon width={12} height={12} color="white" />
</div>
<div
- className="font-normal text-white text-sm leading-5 truncate"
+ className="font-normal text-contrast text-sm leading-5 truncate"
title={buttonText}
>
{buttonText}
diff --git a/src/components/features/chat/git-control-bar-repo-button.tsx b/src/components/features/chat/git-control-bar-repo-button.tsx
index 9db9d93e6d..07e2a772bd 100644
--- a/src/components/features/chat/git-control-bar-repo-button.tsx
+++ b/src/components/features/chat/git-control-bar-repo-button.tsx
@@ -65,7 +65,7 @@ export function GitControlBarRepoButton({
/>
</div>
<div
- className="font-normal text-white text-sm leading-5 truncate flex-1 min-w-0"
+ className="font-normal text-contrast text-sm leading-5 truncate flex-1 min-w-0"
title={buttonText}
>
{buttonText}
@@ -88,7 +88,7 @@ export function GitControlBarRepoButton({
: "cursor-pointer hover:border-border-subtle",
)}
>
- <div className="w-3 h-3 flex items-center justify-center flex-shrink-0 text-white">
+ <div className="w-3 h-3 flex items-center justify-center flex-shrink-0 text-contrast">
{showConnectRepoCta ? (
<FolderOpen
className="w-3 h-3"
@@ -101,7 +101,7 @@ export function GitControlBarRepoButton({
)}
</div>
<div
- className="font-normal text-white text-sm leading-5 truncate flex-1 min-w-0"
+ className="font-normal text-contrast text-sm leading-5 truncate flex-1 min-w-0"
title={buttonText}
>
{buttonText}
diff --git a/src/components/features/chat/git-control-bar-tooltip-wrapper.tsx b/src/components/features/chat/git-control-bar-tooltip-wrapper.tsx
index cd4b09ef8a..76627fa55e 100644
--- a/src/components/features/chat/git-control-bar-tooltip-wrapper.tsx
+++ b/src/components/features/chat/git-control-bar-tooltip-wrapper.tsx
@@ -22,7 +22,7 @@ export function GitControlBarTooltipWrapper({
content={tooltipMessage}
placement="top"
showArrow
- tooltipClassName="bg-white text-black"
+ tooltipClassName="bg-contrast text-contrast-foreground"
>
<span data-testid={testId} className="hover:opacity-100">
{children}
diff --git a/src/components/features/chat/open-repository-modal.tsx b/src/components/features/chat/open-repository-modal.tsx
index 68b238cf1d..9970ede92d 100644
--- a/src/components/features/chat/open-repository-modal.tsx
+++ b/src/components/features/chat/open-repository-modal.tsx
@@ -109,7 +109,7 @@ export function OpenRepositoryModal({
<div className="flex flex-col gap-4 w-full">
<div className="flex items-center justify-between">
- <span className="text-sm text-white font-normal leading-5.5">
+ <span className="text-sm text-contrast font-normal leading-5.5">
{t(I18nKey.CONVERSATION$SELECT_OR_INSERT_LINK)}
</span>
{providers.length > 1 && (
diff --git a/src/components/features/chat/pasted-image-upload-as-file-button.tsx b/src/components/features/chat/pasted-image-upload-as-file-button.tsx
index 8d2e3b05c6..f30185ef0a 100644
--- a/src/components/features/chat/pasted-image-upload-as-file-button.tsx
+++ b/src/components/features/chat/pasted-image-upload-as-file-button.tsx
@@ -25,7 +25,7 @@ export function PastedImageUploadAsFileButton({
placement="bottom"
offset={10}
shouldFlip={false}
- tooltipClassName="bg-white text-black text-xs font-medium leading-5"
+ tooltipClassName="bg-contrast text-contrast-foreground text-xs font-medium leading-5"
>
<button
type="button"
diff --git a/src/components/features/chat/plan-preview.tsx b/src/components/features/chat/plan-preview.tsx
index b8bdccc981..e3159ff4fb 100644
--- a/src/components/features/chat/plan-preview.tsx
+++ b/src/components/features/chat/plan-preview.tsx
@@ -71,7 +71,7 @@ export function PlanPreview({
{/* Header */}
<div className="border-b border-border flex h-10.25 items-center px-2 gap-1">
<LessonPlanIcon width={18} height={18} color="var(--oh-muted)" />
- <Typography.Text className="font-normal text-[11px] text-white tracking-[0.11px] leading-4">
+ <Typography.Text className="font-normal text-[11px] text-contrast tracking-[0.11px] leading-4">
{t(I18nKey.COMMON$PLAN_MD)}
</Typography.Text>
<div className="flex-1" />
@@ -81,17 +81,17 @@ export function PlanPreview({
className="flex items-center gap-1 hover:opacity-80 transition-opacity cursor-pointer"
data-testid="plan-preview-view-button"
>
- <Typography.Text className="font-normal text-[11px] text-white tracking-[0.11px] leading-4">
+ <Typography.Text className="font-normal text-[11px] text-contrast tracking-[0.11px] leading-4">
{t(I18nKey.COMMON$VIEW)}
</Typography.Text>
- <ArrowUpRight className="text-white" size={18} />
+ <ArrowUpRight className="text-contrast" size={18} />
</button>
</div>
{/* Content */}
<div
data-testid="plan-preview-content"
- className="flex flex-col gap-2.5 p-4 text-[15px] text-white leading-7.25"
+ className="flex flex-col gap-2.5 p-4 text-[15px] text-contrast leading-7.25"
>
{truncatedContent && (
<>
@@ -122,16 +122,16 @@ export function PlanPreview({
onClick={handleBuildClick}
disabled={isBuildDisabled}
className={cn(
- "bg-white flex items-center justify-center h-6.5 px-2 rounded-sm w-23.25 transition-opacity",
+ "bg-contrast flex items-center justify-center h-6.5 px-2 rounded-sm w-23.25 transition-opacity",
isBuildDisabled
? "opacity-50 cursor-not-allowed"
: "hover:opacity-90 cursor-pointer",
)}
data-testid="plan-preview-build-button"
>
- <Typography.Text className="font-normal text-sm text-black leading-5">
+ <Typography.Text className="font-normal text-sm text-contrast-foreground leading-5">
{t(I18nKey.COMMON$BUILD)}{" "}
- <Typography.Text className="font-normal text-black">
+ <Typography.Text className="font-normal text-contrast-foreground">
βŒ˜β†©
</Typography.Text>
</Typography.Text>
diff --git a/src/components/features/chat/task-tracking/task-item.tsx b/src/components/features/chat/task-tracking/task-item.tsx
index 26a2669f60..1c5a59fa00 100644
--- a/src/components/features/chat/task-tracking/task-item.tsx
+++ b/src/components/features/chat/task-tracking/task-item.tsx
@@ -39,7 +39,10 @@ export function TaskItem({ task }: TaskItemProps) {
<div className="shrink-0">{icon}</div>
<div className="flex flex-col items-start justify-center leading-4 text-nowrap whitespace-pre font-normal">
<Typography.Text
- className={cn("text-xs", isDoneStatus ? "text-muted" : "text-white")}
+ className={cn(
+ "text-xs",
+ isDoneStatus ? "text-muted" : "text-contrast",
+ )}
>
{task.title}
</Typography.Text>
diff --git a/src/components/features/chat/tool-visualizers/primitives/code-block.tsx b/src/components/features/chat/tool-visualizers/primitives/code-block.tsx
index 41dfe18384..612fda52f5 100644
--- a/src/components/features/chat/tool-visualizers/primitives/code-block.tsx
+++ b/src/components/features/chat/tool-visualizers/primitives/code-block.tsx
@@ -1,10 +1,11 @@
import React from "react";
import { useTranslation } from "react-i18next";
-import { vscDarkPlus } from "react-syntax-highlighter/dist/esm/styles/prism";
import { SyntaxHighlighter } from "../../../markdown/syntax-highlighter";
import { CopyableContentWrapper } from "#/components/shared/buttons/copyable-content-wrapper";
import { MAX_CONTENT_LENGTH } from "#/components/conversation-events/chat/event-content-helpers/shared";
+import { useColorTheme } from "#/hooks/use-color-theme";
import { I18nKey } from "#/i18n/declaration";
+import { getSyntaxHighlighterTheme } from "#/themes/syntax-highlighter-themes";
interface CodeBlockProps {
code: string;
@@ -35,6 +36,7 @@ export function CodeBlock({
wrapLongLines = false,
}: CodeBlockProps) {
const { t } = useTranslation("openhands");
+ const colorTheme = useColorTheme();
const [isExpanded, setIsExpanded] = React.useState(false);
const isTruncated = code.length > MAX_CONTENT_LENGTH;
const display =
@@ -50,7 +52,7 @@ export function CodeBlock({
const block = (
<SyntaxHighlighter
className="rounded-lg text-xs"
- style={vscDarkPlus}
+ style={getSyntaxHighlighterTheme(colorTheme)}
language={language}
PreTag="div"
wrapLongLines={wrapLongLines}
@@ -74,7 +76,7 @@ export function CodeBlock({
<button
type="button"
onClick={() => setIsExpanded((prev) => !prev)}
- className="self-start text-xs text-muted transition-colors hover:text-white hover:underline"
+ className="self-start text-xs text-muted transition-colors hover:text-contrast hover:underline"
>
{toggleLabel}
</button>
diff --git a/src/components/features/chat/tool-visualizers/primitives/markdown-file-preview.tsx b/src/components/features/chat/tool-visualizers/primitives/markdown-file-preview.tsx
index 01547bac26..75b9c94e1c 100644
--- a/src/components/features/chat/tool-visualizers/primitives/markdown-file-preview.tsx
+++ b/src/components/features/chat/tool-visualizers/primitives/markdown-file-preview.tsx
@@ -168,7 +168,7 @@ export function MarkdownFilePreview({
>
<div
data-testid="markdown-file-preview-content"
- className="max-h-40 overflow-y-auto px-4 py-3 text-white custom-scrollbar-always [--oh-scroll-fade-from:var(--oh-surface)]"
+ className="max-h-40 overflow-y-auto px-4 py-3 text-contrast custom-scrollbar-always [--oh-scroll-fade-from:var(--oh-surface)]"
>
{/* Deliberately compact: the clipped in-stream card reuses the plan
preview's small typography; the Files drawer renders the same
@@ -194,10 +194,10 @@ export function MarkdownFilePreview({
className="flex shrink-0 cursor-pointer items-center gap-1 transition-opacity hover:opacity-80"
data-testid="markdown-file-preview-view"
>
- <Typography.Text className="text-[11px] leading-4 tracking-[0.11px] text-white">
+ <Typography.Text className="text-[11px] leading-4 tracking-[0.11px] text-contrast">
{t(I18nKey.COMMON$VIEW)}
</Typography.Text>
- <ArrowUpRight className="text-white" size={16} />
+ <ArrowUpRight className="text-contrast" size={16} />
</button>
) : null}
</div>
diff --git a/src/components/features/chat/uploaded-file.tsx b/src/components/features/chat/uploaded-file.tsx
index ea5b5e1528..b5ce1c427b 100644
--- a/src/components/features/chat/uploaded-file.tsx
+++ b/src/components/features/chat/uploaded-file.tsx
@@ -24,7 +24,7 @@ export function UploadedFile({
<span
className={cn(
"text-sm font-normal leading-5 flex-1 max-w-34 truncate",
- isLoading ? "max-w-27 text-muted" : "text-white",
+ isLoading ? "max-w-27 text-muted" : "text-contrast",
)}
>
{file.name}
diff --git a/src/components/features/chat/workspace-mode-selector.tsx b/src/components/features/chat/workspace-mode-selector.tsx
index 0106dc5e1f..faafdb4440 100644
--- a/src/components/features/chat/workspace-mode-selector.tsx
+++ b/src/components/features/chat/workspace-mode-selector.tsx
@@ -73,7 +73,7 @@ export function WorkspaceModeSelector({
onClick={() => setOpen((next) => !next)}
className={cn(
"group flex flex-row items-center justify-between gap-2 pl-2.5 pr-2 py-1 rounded-[100px] truncate relative",
- "border border-[rgba(71,74,84,0.50)] bg-transparent text-white",
+ "border border-[rgba(71,74,84,0.50)] bg-transparent text-contrast",
disabled
? "cursor-not-allowed opacity-50"
: "cursor-pointer hover:border-border-subtle",
@@ -85,7 +85,7 @@ export function WorkspaceModeSelector({
<span className="min-w-0 flex-1 truncate text-sm font-normal leading-5">
{label}
</span>
- <ChevronDown className="size-3 shrink-0 text-white" aria-hidden />
+ <ChevronDown className="size-3 shrink-0 text-contrast" aria-hidden />
</button>
{open ? (
diff --git a/src/components/features/command-menu/command-menu-trigger.tsx b/src/components/features/command-menu/command-menu-trigger.tsx
index 5c260fae0c..3f04841781 100644
--- a/src/components/features/command-menu/command-menu-trigger.tsx
+++ b/src/components/features/command-menu/command-menu-trigger.tsx
@@ -49,7 +49,7 @@ export function CommandMenuTrigger({ collapsed }: CommandMenuTriggerProps) {
<span
className={cn(
SIDEBAR_ICON_SLOT_CLASS,
- "text-muted group-hover:text-white",
+ "text-muted group-hover:text-contrast",
)}
aria-hidden="true"
>
diff --git a/src/components/features/command-menu/command-menu.tsx b/src/components/features/command-menu/command-menu.tsx
index 68373b5dd8..3be7f6cc9e 100644
--- a/src/components/features/command-menu/command-menu.tsx
+++ b/src/components/features/command-menu/command-menu.tsx
@@ -214,7 +214,7 @@ export function CommandMenu() {
<input
ref={inputRef}
id={COMMAND_MENU_SEARCH_INPUT_ID}
- className="h-11 min-w-0 flex-1 bg-transparent text-base text-white outline-none placeholder:text-text-dim"
+ className="h-11 min-w-0 flex-1 bg-transparent text-base text-contrast outline-none placeholder:text-text-dim"
placeholder={t(I18nKey.COMMAND_MENU$PLACEHOLDER)}
aria-label={t(I18nKey.COMMAND_MENU$SEARCH_LABEL)}
role="combobox"
@@ -230,7 +230,7 @@ export function CommandMenu() {
{query ? (
<button
type="button"
- className="inline-flex size-8 items-center justify-center rounded-lg text-muted hover:bg-surface-raised hover:text-white"
+ className="inline-flex size-8 items-center justify-center rounded-lg text-muted hover:bg-surface-raised hover:text-contrast"
aria-label={t(I18nKey.COMMAND_MENU$CLEAR_SEARCH_LABEL)}
onClick={() => {
setQuery(EMPTY_QUERY);
@@ -255,7 +255,7 @@ export function CommandMenu() {
<div className="flex size-11 items-center justify-center rounded-2xl border border-dashed border-border text-text-dim">
<Search className="size-5" />
</div>
- <p className="text-sm font-medium text-white">
+ <p className="text-sm font-medium text-contrast">
{t(I18nKey.COMMAND_MENU$NO_RESULTS_TITLE)}
</p>
<p className="max-w-sm text-xs leading-5 text-muted">
@@ -294,8 +294,8 @@ export function CommandMenu() {
const optionClassName = cn(
"group flex w-full items-center gap-3 rounded-xl px-3 py-2.5 text-left transition-colors duration-150",
isActive
- ? "bg-white/[0.09] text-white shadow-[0_0_0_1px_rgba(255,255,255,0.08)_inset]"
- : "text-muted hover:bg-white/[0.05] hover:text-white",
+ ? "bg-contrast/[0.09] text-contrast shadow-[0_0_0_1px_color-mix(in_srgb,var(--oh-contrast)_8%,transparent)_inset]"
+ : "text-muted hover:bg-contrast/[0.05] hover:text-contrast",
);
const content = (
@@ -304,8 +304,8 @@ export function CommandMenu() {
className={cn(
"flex size-9 shrink-0 items-center justify-center rounded-lg border transition-colors duration-150",
isActive
- ? "border-accent bg-accent/15 text-white"
- : "border-border bg-black/15 text-text-dim group-hover:text-white",
+ ? "border-accent bg-accent/15 text-contrast"
+ : "border-border bg-black/15 text-text-dim group-hover:text-contrast",
)}
aria-hidden="true"
>
diff --git a/src/components/features/context-menu/archived-disabled-tooltip.tsx b/src/components/features/context-menu/archived-disabled-tooltip.tsx
index 5198ab6eee..9b690b5c7b 100644
--- a/src/components/features/context-menu/archived-disabled-tooltip.tsx
+++ b/src/components/features/context-menu/archived-disabled-tooltip.tsx
@@ -24,7 +24,7 @@ export function ArchivedDisabledTooltip({
<StyledTooltip
content={t(I18nKey.CONVERSATION$UNAVAILABLE_FOR_ARCHIVES)}
placement={placement}
- tooltipClassName="bg-white text-black text-xs font-medium leading-5"
+ tooltipClassName="bg-contrast text-contrast-foreground text-xs font-medium leading-5"
>
<span className="block w-full">{children}</span>
</StyledTooltip>
diff --git a/src/components/features/controls/agent-status.tsx b/src/components/features/controls/agent-status.tsx
index 691fcb7a13..36629c3d3c 100644
--- a/src/components/features/controls/agent-status.tsx
+++ b/src/components/features/controls/agent-status.tsx
@@ -141,7 +141,7 @@ export function AgentStatus({
</span>
<div
className={cn(
- "box-border content-stretch flex flex-row gap-0.75 items-center justify-center overflow-clip px-0.5 py-1 relative rounded-[100px] shrink-0 size-6 transition-all duration-200 active:scale-95 bg-transparent text-muted hover:bg-white/10 hover:text-white",
+ "box-border content-stretch flex flex-row gap-0.75 items-center justify-center overflow-clip px-0.5 py-1 relative rounded-[100px] shrink-0 size-6 transition-all duration-200 active:scale-95 bg-transparent text-muted hover:bg-contrast/10 hover:text-contrast",
isInteractive ? "cursor-pointer" : "cursor-default",
)}
>
diff --git a/src/components/features/controls/server-status.tsx b/src/components/features/controls/server-status.tsx
index 833743e854..202ada9fd1 100644
--- a/src/components/features/controls/server-status.tsx
+++ b/src/components/features/controls/server-status.tsx
@@ -54,7 +54,9 @@ export function ServerStatus({
<div className={className} data-testid="server-status">
<div className="flex items-center">
<DebugStackframeDot className="w-6 h-6 shrink-0" color={statusColor} />
- <span className="text-[13px] text-white font-normal">{statusText}</span>
+ <span className="text-[13px] text-contrast font-normal">
+ {statusText}
+ </span>
</div>
</div>
);
diff --git a/src/components/features/conversation-panel/cloud-new-conversation-menu.tsx b/src/components/features/conversation-panel/cloud-new-conversation-menu.tsx
index 7defce179f..ad9d7068a8 100644
--- a/src/components/features/conversation-panel/cloud-new-conversation-menu.tsx
+++ b/src/components/features/conversation-panel/cloud-new-conversation-menu.tsx
@@ -267,8 +267,8 @@ export function CloudNewConversationMenu({
"flex items-center gap-1 rounded border px-2 py-1 text-xs",
dropdownInstantColorClassName,
isActive
- ? "border-border-subtle bg-interactive-hover text-white"
- : "border-transparent text-text-secondary hover:text-white",
+ ? "border-border-subtle bg-interactive-hover text-contrast"
+ : "border-transparent text-text-secondary hover:text-contrast",
)}
>
<GitProviderIcon gitProvider={provider} />
@@ -295,7 +295,7 @@ export function CloudNewConversationMenu({
placeholder={t(I18nKey.COMMON$SEARCH_REPOSITORIES)}
disabled={!selectedProvider}
className={cn(
- "w-full border-0 bg-transparent py-1.5 pl-6 pr-0 text-sm text-white",
+ "w-full border-0 bg-transparent py-1.5 pl-6 pr-0 text-sm text-contrast",
"outline-none placeholder:text-muted",
"focus:outline-none focus:ring-0",
"disabled:cursor-not-allowed disabled:opacity-60",
diff --git a/src/components/features/conversation-panel/compact-conversation-row.tsx b/src/components/features/conversation-panel/compact-conversation-row.tsx
index e6f131f364..1e44139d00 100644
--- a/src/components/features/conversation-panel/compact-conversation-row.tsx
+++ b/src/components/features/conversation-panel/compact-conversation-row.tsx
@@ -67,7 +67,10 @@ export function CompactConversationRow({
sandboxStatus={sandboxStatus}
showTooltip={false}
/>
- <span className="text-sm font-medium text-white truncate" title={title}>
+ <span
+ className="text-sm font-medium text-contrast truncate"
+ title={title}
+ >
{title || t(I18nKey.CONVERSATION$UNTITLED)}
</span>
</div>
@@ -93,7 +96,7 @@ export function CompactConversationRow({
content={preview}
placement="right"
closeDelay={100}
- className="bg-surface text-white border border-border-subtle shadow-xl p-0"
+ className="bg-surface text-contrast border border-border-subtle shadow-xl p-0"
disableAnimation={disableAnimation}
>
<NavigationLink
diff --git a/src/components/features/conversation-panel/confirm-archive-modal.tsx b/src/components/features/conversation-panel/confirm-archive-modal.tsx
index ecbecd11cf..564817dd3b 100644
--- a/src/components/features/conversation-panel/confirm-archive-modal.tsx
+++ b/src/components/features/conversation-panel/confirm-archive-modal.tsx
@@ -28,7 +28,7 @@ export function ConfirmArchiveModal({
ns="openhands"
i18nKey={I18nKey.CONVERSATION$ARCHIVE_WARNING_WITH_TITLE}
values={{ title: conversationTitle }}
- components={{ title: <span className="text-white" /> }}
+ components={{ title: <span className="text-contrast" /> }}
/>
) : (
t(I18nKey.CONVERSATION$ARCHIVE_WARNING)
diff --git a/src/components/features/conversation-panel/confirm-delete-modal.tsx b/src/components/features/conversation-panel/confirm-delete-modal.tsx
index dfd90ec3e8..78377ff599 100644
--- a/src/components/features/conversation-panel/confirm-delete-modal.tsx
+++ b/src/components/features/conversation-panel/confirm-delete-modal.tsx
@@ -35,7 +35,7 @@ export function ConfirmDeleteModal({
ns="openhands"
i18nKey={I18nKey.CONVERSATION$DELETE_WARNING_WITH_TITLE}
values={{ title: conversationTitle }}
- components={{ title: <span className="text-white" /> }}
+ components={{ title: <span className="text-contrast" /> }}
/>
);
} else {
diff --git a/src/components/features/conversation-panel/conversation-active-tag-filters.tsx b/src/components/features/conversation-panel/conversation-active-tag-filters.tsx
index 061878d7dd..c6f34fdef8 100644
--- a/src/components/features/conversation-panel/conversation-active-tag-filters.tsx
+++ b/src/components/features/conversation-panel/conversation-active-tag-filters.tsx
@@ -47,7 +47,7 @@ export function ConversationActiveTagFilters({
}
const chipClassName =
- "flex min-w-0 max-w-full cursor-pointer items-center gap-1 rounded-full bg-surface px-2 py-0.5 text-[10px] leading-4 text-white hover:bg-white/10";
+ "flex min-w-0 max-w-full cursor-pointer items-center gap-1 rounded-full bg-surface px-2 py-0.5 text-[10px] leading-4 text-contrast hover:bg-contrast/10";
return (
<div
@@ -93,7 +93,7 @@ export function ConversationActiveTagFilters({
type="button"
data-testid="clear-tag-filters"
onClick={onClearAll}
- className="shrink-0 cursor-pointer text-[10px] leading-5 text-muted hover:text-white"
+ className="shrink-0 cursor-pointer text-[10px] leading-5 text-muted hover:text-contrast"
>
{t(I18nKey.CONVERSATION_PANEL$CLEAR_FILTERS)}
</button>
diff --git a/src/components/features/conversation-panel/conversation-card/conversation-card-preview.tsx b/src/components/features/conversation-panel/conversation-card/conversation-card-preview.tsx
index 6ed6ccab07..62afd51fe9 100644
--- a/src/components/features/conversation-panel/conversation-card/conversation-card-preview.tsx
+++ b/src/components/features/conversation-panel/conversation-card/conversation-card-preview.tsx
@@ -146,7 +146,7 @@ export function ConversationCardPreview({
/>
</span>
) : null}
- <span className="break-words text-sm font-medium leading-5 text-white">
+ <span className="break-words text-sm font-medium leading-5 text-contrast">
{title}
</span>
</div>
diff --git a/src/components/features/conversation-panel/conversation-card/conversation-card.tsx b/src/components/features/conversation-panel/conversation-card/conversation-card.tsx
index 792ed86070..a25e3576a0 100644
--- a/src/components/features/conversation-panel/conversation-card/conversation-card.tsx
+++ b/src/components/features/conversation-panel/conversation-card/conversation-card.tsx
@@ -219,7 +219,7 @@ export function ConversationCard({
onClick={handleTogglePin}
className={cn(
"flex shrink-0 cursor-pointer items-center justify-center rounded-md p-1",
- "text-muted hover:bg-white/10 hover:text-white",
+ "text-muted hover:bg-contrast/10 hover:text-contrast",
)}
>
<Pin
diff --git a/src/components/features/conversation-panel/conversation-group-folder-row.tsx b/src/components/features/conversation-panel/conversation-group-folder-row.tsx
index 4a153ede7a..72506c07ba 100644
--- a/src/components/features/conversation-panel/conversation-group-folder-row.tsx
+++ b/src/components/features/conversation-panel/conversation-group-folder-row.tsx
@@ -100,7 +100,7 @@ export function ConversationGroupFolderRow({
<div
className={cn(
"flex h-8 w-full min-w-0 items-center gap-0.5 rounded-md pl-2 pr-1 text-sm font-normal",
- "text-muted transition-colors hover:bg-surface-raised hover:text-white",
+ "text-muted transition-colors hover:bg-surface-raised hover:text-contrast",
)}
>
<button
@@ -189,7 +189,7 @@ export function ConversationGroupFolderRow({
className={cn(
"inline-flex h-6 w-6 shrink-0 cursor-pointer items-center justify-center rounded-md",
"text-inherit transition-colors",
- "hover:bg-white/10 hover:text-white",
+ "hover:bg-contrast/10 hover:text-contrast",
"focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-border",
"disabled:cursor-not-allowed disabled:opacity-50",
)}
@@ -226,7 +226,7 @@ export function ConversationGroupFolderRow({
type="button"
data-testid={`thread-folder-view-more-${groupTestIdSuffix}`}
onClick={onTogglePreviewExpanded}
- className="cursor-pointer text-xs text-text-dim hover:text-white"
+ className="cursor-pointer text-xs text-text-dim hover:text-contrast"
>
{isShowingAll
? t(I18nKey.CONVERSATION_PANEL$LESS)
diff --git a/src/components/features/conversation-panel/conversation-layouts-menu.tsx b/src/components/features/conversation-panel/conversation-layouts-menu.tsx
index 2750a154d8..f33cb38340 100644
--- a/src/components/features/conversation-panel/conversation-layouts-menu.tsx
+++ b/src/components/features/conversation-panel/conversation-layouts-menu.tsx
@@ -190,7 +190,7 @@ export function ConversationLayoutsMenu({
aria-expanded={menuOpen}
onClick={() => setMenuOpen(!menuOpen)}
className={cn(
- "relative inline-flex h-7 w-7 items-center justify-center rounded-md text-muted hover:text-white hover:bg-surface-raised",
+ "relative inline-flex h-7 w-7 items-center justify-center rounded-md text-muted hover:text-contrast hover:bg-surface-raised",
dropdownInstantColorClassName,
)}
>
diff --git a/src/components/features/conversation-panel/conversation-panel-new-thread-picker.tsx b/src/components/features/conversation-panel/conversation-panel-new-thread-picker.tsx
index 78f8e9dc52..e4ebfd5d40 100644
--- a/src/components/features/conversation-panel/conversation-panel-new-thread-picker.tsx
+++ b/src/components/features/conversation-panel/conversation-panel-new-thread-picker.tsx
@@ -9,7 +9,7 @@ import { CloudNewConversationMenu } from "./cloud-new-conversation-menu";
const triggerClassName = cn(
"inline-flex h-7 w-7 shrink-0 items-center justify-center rounded-md",
"text-muted transition-colors",
- "hover:bg-surface-raised hover:text-white",
+ "hover:bg-surface-raised hover:text-contrast",
"focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-border",
"disabled:cursor-not-allowed disabled:opacity-50",
);
diff --git a/src/components/features/conversation-panel/conversation-panel-pinned-section.tsx b/src/components/features/conversation-panel/conversation-panel-pinned-section.tsx
index 093f35e4bd..b645489d47 100644
--- a/src/components/features/conversation-panel/conversation-panel-pinned-section.tsx
+++ b/src/components/features/conversation-panel/conversation-panel-pinned-section.tsx
@@ -56,7 +56,7 @@ export function ConversationPanelPinnedSection({
type="button"
data-testid="conversation-panel-pinned-view-more"
onClick={onTogglePreviewExpanded}
- className="cursor-pointer text-xs text-text-dim hover:text-white"
+ className="cursor-pointer text-xs text-text-dim hover:text-contrast"
>
{isShowingAll
? t(I18nKey.CONVERSATION_PANEL$LESS)
diff --git a/src/components/features/conversation-panel/conversation-panel.tsx b/src/components/features/conversation-panel/conversation-panel.tsx
index 24d5d7c152..d7cd96c65f 100644
--- a/src/components/features/conversation-panel/conversation-panel.tsx
+++ b/src/components/features/conversation-panel/conversation-panel.tsx
@@ -903,7 +903,7 @@ export function ConversationPanel({
!showHoverMetadata || openContextMenuId === conversation.id
}
disableAnimation={import.meta.env.MODE === "test"}
- className="max-w-none overflow-visible rounded-xl border border-border bg-base-secondary p-0 text-white shadow-xl"
+ className="max-w-none overflow-visible rounded-xl border border-border bg-base-secondary p-0 text-contrast shadow-xl"
content={
<ConversationCardPreview
title={conversation.title ?? ""}
@@ -1218,7 +1218,7 @@ export function ConversationPanel({
type="button"
data-testid="load-more-conversations"
onClick={requestLoadMore}
- className="text-xs text-muted hover:text-white"
+ className="text-xs text-muted hover:text-contrast"
>
{t(I18nKey.CONVERSATION$LOAD_MORE)}
</button>
diff --git a/src/components/features/conversation-panel/conversation-status-dot.tsx b/src/components/features/conversation-panel/conversation-status-dot.tsx
index c4c25c83d5..42aa8f7c70 100644
--- a/src/components/features/conversation-panel/conversation-status-dot.tsx
+++ b/src/components/features/conversation-panel/conversation-status-dot.tsx
@@ -158,7 +158,7 @@ export function ConversationStatusDot({
content={label}
placement="right"
showArrow
- tooltipClassName="bg-base text-white text-xs shadow-lg"
+ tooltipClassName="bg-base text-contrast text-xs shadow-lg"
>
{dot}
</StyledTooltip>
diff --git a/src/components/features/conversation-panel/edit-conversation-tags-modal.tsx b/src/components/features/conversation-panel/edit-conversation-tags-modal.tsx
index 7485c2787f..9ab5e2f0a7 100644
--- a/src/components/features/conversation-panel/edit-conversation-tags-modal.tsx
+++ b/src/components/features/conversation-panel/edit-conversation-tags-modal.tsx
@@ -179,7 +179,7 @@ export function EditConversationTagsModal({
className="flex items-center gap-2 rounded-md border border-border px-2 py-1"
data-testid={`edit-tag-row-${row.key}`}
>
- <span className="min-w-0 flex-1 truncate text-xs text-white">
+ <span className="min-w-0 flex-1 truncate text-xs text-contrast">
{row.value ? `${row.key}=${row.value}` : row.key}
</span>
<button
@@ -187,7 +187,7 @@ export function EditConversationTagsModal({
aria-label={t(I18nKey.CONVERSATION$REMOVE_TAG)}
data-testid={`remove-tag-${row.key}`}
onClick={() => handleRemove(row.key)}
- className="shrink-0 text-muted hover:text-white"
+ className="shrink-0 text-muted hover:text-contrast"
>
<X className="h-3.5 w-3.5" aria-hidden />
</button>
@@ -206,7 +206,7 @@ export function EditConversationTagsModal({
ref={keyInputRef}
onChange={(event) => setNewKey(event.target.value)}
onKeyDown={handleInputKeyDown}
- className="w-28 shrink-0 rounded-md border border-border bg-base-secondary px-2 py-1 text-xs text-white placeholder:text-muted"
+ className="w-28 shrink-0 rounded-md border border-border bg-base-secondary px-2 py-1 text-xs text-contrast placeholder:text-muted"
/>
<input
type="text"
@@ -216,7 +216,7 @@ export function EditConversationTagsModal({
data-testid="new-tag-value-input"
onChange={(event) => setNewValue(event.target.value)}
onKeyDown={handleInputKeyDown}
- className="min-w-0 flex-1 rounded-md border border-border bg-base-secondary px-2 py-1 text-xs text-white placeholder:text-muted"
+ className="min-w-0 flex-1 rounded-md border border-border bg-base-secondary px-2 py-1 text-xs text-contrast placeholder:text-muted"
/>
<BrandButton
type="button"
diff --git a/src/components/features/conversation-panel/hooks-loading-state.tsx b/src/components/features/conversation-panel/hooks-loading-state.tsx
index 50f467c27c..6bc7aac9c3 100644
--- a/src/components/features/conversation-panel/hooks-loading-state.tsx
+++ b/src/components/features/conversation-panel/hooks-loading-state.tsx
@@ -1,7 +1,7 @@
export function HooksLoadingState() {
return (
<div className="flex justify-center items-center py-8">
- <div className="animate-spin rounded-full h-8 w-8 border-t-2 border-b-2 border-white" />
+ <div className="animate-spin rounded-full h-8 w-8 border-t-2 border-b-2 border-contrast" />
</div>
);
}
diff --git a/src/components/features/conversation-panel/hooks-modal-header.tsx b/src/components/features/conversation-panel/hooks-modal-header.tsx
index 74390a90f2..121573ec10 100644
--- a/src/components/features/conversation-panel/hooks-modal-header.tsx
+++ b/src/components/features/conversation-panel/hooks-modal-header.tsx
@@ -15,7 +15,7 @@ interface HooksModalHeaderProps {
}
const ICON_BUTTON_CLASS =
- "rounded-md p-1 text-white hover:bg-tertiary cursor-pointer disabled:opacity-30 disabled:cursor-not-allowed";
+ "rounded-md p-1 text-contrast hover:bg-tertiary cursor-pointer disabled:opacity-30 disabled:cursor-not-allowed";
export function HooksModalHeader({
isLoading,
diff --git a/src/components/features/conversation-panel/menu-row.tsx b/src/components/features/conversation-panel/menu-row.tsx
index b8f9fcae1c..03581994bb 100644
--- a/src/components/features/conversation-panel/menu-row.tsx
+++ b/src/components/features/conversation-panel/menu-row.tsx
@@ -81,7 +81,7 @@ export function MenuRow({
/>
) : selected ? (
<Check
- className="ml-auto h-3.5 w-3.5 shrink-0 text-white"
+ className="ml-auto h-3.5 w-3.5 shrink-0 text-contrast"
aria-hidden
/>
) : null}
diff --git a/src/components/features/conversation-panel/new-conversation-dropdown-styles.ts b/src/components/features/conversation-panel/new-conversation-dropdown-styles.ts
index 8b2c6eaef7..bf1fed5276 100644
--- a/src/components/features/conversation-panel/new-conversation-dropdown-styles.ts
+++ b/src/components/features/conversation-panel/new-conversation-dropdown-styles.ts
@@ -3,6 +3,6 @@ import { dropdownMenuListGapClassName } from "#/utils/dropdown-classes";
/** Match conversation panel filter and other sidebar menus */
export const NEW_CONVERSATION_DROPDOWN_SURFACE = cn(
- "z-50 flex flex-col rounded-md border border-border-subtle bg-tertiary px-1 py-1 text-white shadow-lg",
+ "z-50 flex flex-col rounded-md border border-border-subtle bg-tertiary px-1 py-1 text-contrast shadow-lg",
dropdownMenuListGapClassName,
);
diff --git a/src/components/features/conversation-panel/plugins-modal.tsx b/src/components/features/conversation-panel/plugins-modal.tsx
index caf752bb06..ddace22fbe 100644
--- a/src/components/features/conversation-panel/plugins-modal.tsx
+++ b/src/components/features/conversation-panel/plugins-modal.tsx
@@ -58,7 +58,7 @@ export function PluginsModal({ onClose }: PluginsModalProps) {
data-testid={`active-plugin-${getPluginDisplayName(plugin)}`}
className="flex flex-col gap-1 p-4"
>
- <Typography.Text className="font-semibold text-white">
+ <Typography.Text className="font-semibold text-contrast">
{getPluginDisplayName(plugin)}
</Typography.Text>
<Typography.Text className="text-xs text-tertiary-alt">
diff --git a/src/components/features/conversation-panel/skills-loading-state.tsx b/src/components/features/conversation-panel/skills-loading-state.tsx
index 3119a1e663..98d668e7b0 100644
--- a/src/components/features/conversation-panel/skills-loading-state.tsx
+++ b/src/components/features/conversation-panel/skills-loading-state.tsx
@@ -1,7 +1,7 @@
export function SkillsLoadingState() {
return (
<div className="flex justify-center items-center py-8">
- <div className="animate-spin rounded-full h-8 w-8 border-t-2 border-b-2 border-white" />
+ <div className="animate-spin rounded-full h-8 w-8 border-t-2 border-b-2 border-contrast" />
</div>
);
}
diff --git a/src/components/features/conversation-panel/skills-modal-header.tsx b/src/components/features/conversation-panel/skills-modal-header.tsx
index 8af2ed003c..e0b6a89185 100644
--- a/src/components/features/conversation-panel/skills-modal-header.tsx
+++ b/src/components/features/conversation-panel/skills-modal-header.tsx
@@ -15,7 +15,7 @@ interface SkillsModalHeaderProps {
}
const ICON_BUTTON_CLASS =
- "rounded-md p-1 text-white hover:bg-tertiary cursor-pointer disabled:opacity-30 disabled:cursor-not-allowed";
+ "rounded-md p-1 text-contrast hover:bg-tertiary cursor-pointer disabled:opacity-30 disabled:cursor-not-allowed";
export function SkillsModalHeader({
isLoading,
diff --git a/src/components/features/conversation/conversation-git-actions-toggle.tsx b/src/components/features/conversation/conversation-git-actions-toggle.tsx
index 9120e615f6..43bc5fc8f7 100644
--- a/src/components/features/conversation/conversation-git-actions-toggle.tsx
+++ b/src/components/features/conversation/conversation-git-actions-toggle.tsx
@@ -75,7 +75,7 @@ export function ConversationGitActionsToggle({
disabled={isArchivedConversation}
className={cn(
GIT_ACTIONS_BUTTON_CLASSNAME,
- isGitMenuOpen && "bg-white/10 text-foreground",
+ isGitMenuOpen && "bg-contrast/10 text-foreground",
isArchivedConversation &&
"cursor-not-allowed opacity-50 hover:bg-transparent hover:text-muted",
className,
diff --git a/src/components/features/conversation/conversation-name-context-menu.tsx b/src/components/features/conversation/conversation-name-context-menu.tsx
index ef3accbfdc..36ebd664ad 100644
--- a/src/components/features/conversation/conversation-name-context-menu.tsx
+++ b/src/components/features/conversation/conversation-name-context-menu.tsx
@@ -71,7 +71,7 @@ function PublicShareToggle({
aria-hidden
className={cn(
"inline-flex h-3.5 w-7 items-center rounded-full px-0.5 py-px transition-colors duration-200 ease-in-out",
- isPublic ? "bg-white" : "bg-base-secondary",
+ isPublic ? "bg-contrast" : "bg-base-secondary",
)}
>
<span
diff --git a/src/components/features/conversation/conversation-name-with-status.tsx b/src/components/features/conversation/conversation-name-with-status.tsx
index 12b97a6f98..f77ad4e12c 100644
--- a/src/components/features/conversation/conversation-name-with-status.tsx
+++ b/src/components/features/conversation/conversation-name-with-status.tsx
@@ -114,7 +114,7 @@ export function ConversationNameWithStatus() {
onClick={handleStatusClick}
className={cn(
"flex items-center justify-center rounded-md",
- "text-muted hover:bg-white/10",
+ "text-muted hover:bg-contrast/10",
)}
>
<DebugStackframeDot
diff --git a/src/components/features/conversation/conversation-name.tsx b/src/components/features/conversation/conversation-name.tsx
index 2fbfafeb77..8d191226e5 100644
--- a/src/components/features/conversation/conversation-name.tsx
+++ b/src/components/features/conversation/conversation-name.tsx
@@ -155,11 +155,11 @@ export function ConversationName() {
onKeyUp={handleKeyUp}
type="text"
defaultValue={conversation.title || ""}
- className="text-white leading-5 bg-transparent border-none outline-none text-base font-normal w-fit max-w-fit field-sizing-content"
+ className="text-contrast leading-5 bg-transparent border-none outline-none text-base font-normal w-fit max-w-fit field-sizing-content"
/>
) : (
<div
- className="text-white leading-5 truncate"
+ className="text-contrast leading-5 truncate"
data-testid="conversation-name-title"
onDoubleClick={handleDoubleClick}
title={conversation.title || ""}
diff --git a/src/components/features/conversation/conversation-overview-context-menu.tsx b/src/components/features/conversation/conversation-overview-context-menu.tsx
index 06a4ec1c1c..492ca48092 100644
--- a/src/components/features/conversation/conversation-overview-context-menu.tsx
+++ b/src/components/features/conversation/conversation-overview-context-menu.tsx
@@ -121,9 +121,9 @@ function OverviewPinButton({
type="button"
data-testid={testId}
className={cn(
- "flex shrink-0 cursor-pointer items-center justify-center rounded-r px-2 text-white",
+ "flex shrink-0 cursor-pointer items-center justify-center rounded-r px-2 text-contrast",
dropdownInstantColorClassName,
- "hover:bg-white/10",
+ "hover:bg-contrast/10",
)}
aria-pressed={pinned}
aria-label={pinned ? pinnedLabel : unpinnedLabel}
@@ -303,7 +303,7 @@ export function ConversationOverviewContextMenu({
type="button"
data-testid={testIdOpen}
className={cn(
- "flex min-w-0 flex-1 cursor-pointer items-center gap-2 rounded-l p-2 text-start text-white",
+ "flex min-w-0 flex-1 cursor-pointer items-center gap-2 rounded-l p-2 text-start text-contrast",
dropdownInstantColorClassName,
)}
onClick={onOpen}
@@ -314,7 +314,7 @@ export function ConversationOverviewContextMenu({
<div
data-testid={testIdOpen}
className={cn(
- "flex min-w-0 flex-1 items-center gap-2 rounded-l p-2 text-start text-white",
+ "flex min-w-0 flex-1 items-center gap-2 rounded-l p-2 text-start text-contrast",
dropdownInstantColorClassName,
)}
>
diff --git a/src/components/features/conversation/conversation-overview-diffs-row.tsx b/src/components/features/conversation/conversation-overview-diffs-row.tsx
index 625f6e6d8b..dcccdf46cf 100644
--- a/src/components/features/conversation/conversation-overview-diffs-row.tsx
+++ b/src/components/features/conversation/conversation-overview-diffs-row.tsx
@@ -29,13 +29,13 @@ const GIT_ACTION_BUTTON_CLASSNAME = cn(
GIT_ACTION_HOVER_TARGET_CLASSNAME,
"absolute inset-0 inline-flex items-center justify-center",
"rounded-md text-muted transition-opacity",
- "hover:bg-white/10 hover:text-foreground",
+ "hover:bg-contrast/10 hover:text-foreground",
);
/** Full-row hover, cleared while the git commit control itself is hovered. */
const DIFFS_ROW_CLASSNAME = cn(
"flex items-center rounded-md transition-colors",
- "hover:bg-white/5",
+ "hover:bg-contrast/5",
`has-[.${GIT_ACTION_HOVER_TARGET_CLASSNAME}:hover]:bg-transparent`,
);
diff --git a/src/components/features/conversation/conversation-overview-git-items-panel.tsx b/src/components/features/conversation/conversation-overview-git-items-panel.tsx
index 04c1362b70..e5476c230a 100644
--- a/src/components/features/conversation/conversation-overview-git-items-panel.tsx
+++ b/src/components/features/conversation/conversation-overview-git-items-panel.tsx
@@ -123,7 +123,7 @@ export function ConversationOverviewGitItemsPanel({
data-testid={`conversation-overview-${kind}-item-${item.number}`}
className={cn(
"group flex min-w-0 items-center gap-2 rounded-md px-2 py-2",
- "transition-colors hover:bg-white/5",
+ "transition-colors hover:bg-contrast/5",
)}
>
<span className="shrink-0 text-sm tabular-nums text-muted">
diff --git a/src/components/features/conversation/conversation-overview-git-section.tsx b/src/components/features/conversation/conversation-overview-git-section.tsx
index 36c23005a9..1fc05db1bc 100644
--- a/src/components/features/conversation/conversation-overview-git-section.tsx
+++ b/src/components/features/conversation/conversation-overview-git-section.tsx
@@ -118,7 +118,7 @@ export function ConversationOverviewGitSection() {
data-testid="conversation-overview-git-repo"
className={cn(
"group flex min-w-0 items-center gap-2 rounded-md px-2 py-1.5",
- "transition-colors hover:bg-white/5",
+ "transition-colors hover:bg-contrast/5",
)}
>
<GitProviderIcon
@@ -143,7 +143,7 @@ export function ConversationOverviewGitSection() {
data-testid="conversation-overview-git-branch"
className={cn(
"group flex min-w-0 items-center gap-2 rounded-md px-2 py-1.5",
- "transition-colors hover:bg-white/5",
+ "transition-colors hover:bg-contrast/5",
)}
>
<FaCodeBranch
@@ -192,7 +192,7 @@ export function ConversationOverviewGitSection() {
onClick={openCommits}
className={cn(
"flex w-full min-w-0 items-center gap-2 rounded-md px-2 py-1.5",
- "cursor-pointer bg-transparent text-left transition-colors hover:bg-white/5",
+ "cursor-pointer bg-transparent text-left transition-colors hover:bg-contrast/5",
)}
>
<GitCommitHorizontal
@@ -223,7 +223,7 @@ export function ConversationOverviewGitSection() {
onClick={openPullRequests}
className={cn(
"flex w-full min-w-0 items-center gap-2 rounded-md px-2 py-1.5",
- "cursor-pointer bg-transparent text-left transition-colors hover:bg-white/5",
+ "cursor-pointer bg-transparent text-left transition-colors hover:bg-contrast/5",
)}
>
<PrIcon className={ROW_ICON_CLASSNAME} aria-hidden />
diff --git a/src/components/features/conversation/conversation-overview-panel.tsx b/src/components/features/conversation/conversation-overview-panel.tsx
index 569943033e..1a0cad048f 100644
--- a/src/components/features/conversation/conversation-overview-panel.tsx
+++ b/src/components/features/conversation/conversation-overview-panel.tsx
@@ -28,7 +28,7 @@ const PANEL_CLASSNAME = cn(
const ROW_CLASSNAME = cn(
"flex items-center gap-2 rounded-md px-2 py-1.5",
- "transition-colors hover:bg-white/5",
+ "transition-colors hover:bg-contrast/5",
);
const ROW_ICON_CLASSNAME = "size-4 shrink-0 text-muted";
diff --git a/src/components/features/conversation/conversation-overview-secrets-panel.tsx b/src/components/features/conversation/conversation-overview-secrets-panel.tsx
index ce3f907b80..2da57c02da 100644
--- a/src/components/features/conversation/conversation-overview-secrets-panel.tsx
+++ b/src/components/features/conversation/conversation-overview-secrets-panel.tsx
@@ -79,7 +79,7 @@ export function ConversationOverviewSecretsPanel({
<li
key={secret.name}
data-testid="conversation-overview-secret-item"
- className="group flex items-center gap-2 rounded-md px-2 py-2 hover:bg-white/5"
+ className="group flex items-center gap-2 rounded-md px-2 py-2 hover:bg-contrast/5"
>
<div className="min-w-0 flex-1">
<p className="truncate text-sm text-foreground">
@@ -99,7 +99,7 @@ export function ConversationOverviewSecretsPanel({
className={cn(
"shrink-0 rounded-md p-1 text-muted",
"opacity-0 transition-opacity group-hover:opacity-100",
- "hover:bg-white/10 hover:text-foreground",
+ "hover:bg-contrast/10 hover:text-foreground",
)}
>
<Trash2 className="size-3.5" aria-hidden />
diff --git a/src/components/features/conversation/conversation-overview-toggle.tsx b/src/components/features/conversation/conversation-overview-toggle.tsx
index 34b287238b..93d5dddd4d 100644
--- a/src/components/features/conversation/conversation-overview-toggle.tsx
+++ b/src/components/features/conversation/conversation-overview-toggle.tsx
@@ -163,7 +163,7 @@ export function ConversationOverviewToggle({
// keeping the smaller Info glyph.
mobileTopBarIconButtonClassName,
"size-7",
- isOverviewVisible && "bg-white/10 text-foreground",
+ isOverviewVisible && "bg-contrast/10 text-foreground",
isArchivedConversation &&
"cursor-not-allowed opacity-50 hover:bg-transparent hover:text-muted",
className,
diff --git a/src/components/features/conversation/conversation-secondary-drawer.classes.ts b/src/components/features/conversation/conversation-secondary-drawer.classes.ts
index b8c03b4c0f..c4962c45f3 100644
--- a/src/components/features/conversation/conversation-secondary-drawer.classes.ts
+++ b/src/components/features/conversation/conversation-secondary-drawer.classes.ts
@@ -12,5 +12,5 @@ export const CONVERSATION_SECONDARY_DRAWER_HEADER_ACTION_CLASSNAME = cn(
export const CONVERSATION_SECONDARY_DRAWER_CLOSE_BUTTON_CLASSNAME = cn(
"inline-flex size-7 shrink-0 cursor-pointer items-center justify-center rounded-md",
- "text-muted transition-colors hover:bg-white/10 hover:text-white",
+ "text-muted transition-colors hover:bg-contrast/10 hover:text-contrast",
);
diff --git a/src/components/features/conversation/conversation-tabs/conversation-tab-nav.tsx b/src/components/features/conversation/conversation-tabs/conversation-tab-nav.tsx
index d5677c6564..0a84ef6ddb 100644
--- a/src/components/features/conversation/conversation-tabs/conversation-tab-nav.tsx
+++ b/src/components/features/conversation/conversation-tabs/conversation-tab-nav.tsx
@@ -41,11 +41,11 @@ export function ConversationTabNav({
"flex items-center rounded-md cursor-pointer",
"pl-1.5 pr-2 py-1 lg:py-1.5",
"text-muted bg-transparent",
- isActive && "bg-interactive-active text-white",
+ isActive && "bg-interactive-active text-contrast",
isActive
- ? "hover:text-white hover:bg-interactive-hover"
- : "hover:text-white hover:bg-white/5",
- isActive ? "focus-within:text-white" : "focus-within:text-muted",
+ ? "hover:text-contrast hover:bg-interactive-hover"
+ : "hover:text-contrast hover:bg-contrast/5",
+ isActive ? "focus-within:text-contrast" : "focus-within:text-muted",
className,
);
diff --git a/src/components/features/conversation/conversation-tabs/conversation-tabs-context-menu.tsx b/src/components/features/conversation/conversation-tabs/conversation-tabs-context-menu.tsx
index 0a256cc713..dbccf66690 100644
--- a/src/components/features/conversation/conversation-tabs/conversation-tabs-context-menu.tsx
+++ b/src/components/features/conversation/conversation-tabs/conversation-tabs-context-menu.tsx
@@ -183,7 +183,7 @@ export function ConversationTabsContextMenu({
data-testid={`conversation-tabs-menu-open-${tab}`}
disabled={isArchivedConversation}
className={cn(
- "flex min-w-0 flex-1 items-center gap-2 rounded-l p-2 text-start text-white",
+ "flex min-w-0 flex-1 items-center gap-2 rounded-l p-2 text-start text-contrast",
dropdownInstantColorClassName,
isArchivedConversation
? "cursor-not-allowed"
@@ -204,11 +204,11 @@ export function ConversationTabsContextMenu({
data-testid={`conversation-tabs-menu-pin-${tab}`}
disabled={isArchivedConversation}
className={cn(
- "flex shrink-0 items-center justify-center rounded-r px-2 text-white",
+ "flex shrink-0 items-center justify-center rounded-r px-2 text-contrast",
dropdownInstantColorClassName,
isArchivedConversation
? "cursor-not-allowed"
- : "cursor-pointer hover:bg-white/10",
+ : "cursor-pointer hover:bg-contrast/10",
)}
aria-pressed={pinned}
aria-label={
diff --git a/src/components/features/conversation/conversation-tabs/conversation-tabs.tsx b/src/components/features/conversation/conversation-tabs/conversation-tabs.tsx
index 59da13a4b4..dd148bec38 100644
--- a/src/components/features/conversation/conversation-tabs/conversation-tabs.tsx
+++ b/src/components/features/conversation/conversation-tabs/conversation-tabs.tsx
@@ -379,14 +379,14 @@ export function ConversationTabs({
onClick={handleBuildPlanClick}
disabled={isBuildDisabled}
className={cn(
- "flex h-5 min-w-17 items-center justify-center rounded bg-white px-2 transition-opacity",
+ "flex h-5 min-w-17 items-center justify-center rounded bg-contrast px-2 transition-opacity",
isBuildDisabled
? "cursor-not-allowed opacity-50"
: "cursor-pointer hover:opacity-90",
)}
data-testid="planner-tab-build-button"
>
- <Typography.Text className="text-[11px] font-normal leading-5 text-black">
+ <Typography.Text className="text-[11px] font-normal leading-5 text-contrast-foreground">
{/* eslint-disable-next-line i18next/no-literal-string */}
{t(I18nKey.COMMON$BUILD)} βŒ˜β†©
</Typography.Text>
diff --git a/src/components/features/conversation/conversation-tabs/drawer-vscode-link.tsx b/src/components/features/conversation/conversation-tabs/drawer-vscode-link.tsx
index 05058f951f..12cb652fda 100644
--- a/src/components/features/conversation/conversation-tabs/drawer-vscode-link.tsx
+++ b/src/components/features/conversation/conversation-tabs/drawer-vscode-link.tsx
@@ -43,7 +43,7 @@ export function DrawerVSCodeLink() {
data-testid="drawer-vscode-link"
className={cn(
"inline-flex items-center gap-1.5 rounded-[7px] border border-border bg-base-secondary px-2 py-1 text-xs",
- "text-muted transition-colors hover:enabled:bg-surface-raised hover:enabled:text-white",
+ "text-muted transition-colors hover:enabled:bg-surface-raised hover:enabled:text-contrast",
"cursor-pointer disabled:opacity-50 disabled:cursor-not-allowed",
)}
>
diff --git a/src/components/features/conversation/transcript-export-modal.tsx b/src/components/features/conversation/transcript-export-modal.tsx
index 2b3dc96eda..0adaa24d8e 100644
--- a/src/components/features/conversation/transcript-export-modal.tsx
+++ b/src/components/features/conversation/transcript-export-modal.tsx
@@ -152,10 +152,10 @@ export function TranscriptExportModal({
</div>
<fieldset className="flex w-full flex-col gap-2">
- <legend className="mb-2 text-sm font-medium text-white">
+ <legend className="mb-2 text-sm font-medium text-contrast">
{t(I18nKey.TRANSCRIPT_EXPORT$FORMAT)}
</legend>
- <label className="flex cursor-pointer items-center gap-3 rounded-md border border-border px-3 py-2 text-sm text-white">
+ <label className="flex cursor-pointer items-center gap-3 rounded-md border border-border px-3 py-2 text-sm text-contrast">
<input
type="radio"
name={TRANSCRIPT_FORMAT_RADIO_NAME}
@@ -166,7 +166,7 @@ export function TranscriptExportModal({
/>
{t(I18nKey.TRANSCRIPT_EXPORT$MARKDOWN)}
</label>
- <label className="flex cursor-pointer items-center gap-3 rounded-md border border-border px-3 py-2 text-sm text-white">
+ <label className="flex cursor-pointer items-center gap-3 rounded-md border border-border px-3 py-2 text-sm text-contrast">
<input
type="radio"
name={TRANSCRIPT_FORMAT_RADIO_NAME}
@@ -179,7 +179,7 @@ export function TranscriptExportModal({
</label>
</fieldset>
- <div className="flex w-full flex-col gap-3 text-sm text-white">
+ <div className="flex w-full flex-col gap-3 text-sm text-contrast">
<label className="flex cursor-pointer items-center gap-3">
<input
type="checkbox"
diff --git a/src/components/features/diff-viewer/file-diff-viewer.tsx b/src/components/features/diff-viewer/file-diff-viewer.tsx
index e3596fdbb6..3c28135051 100644
--- a/src/components/features/diff-viewer/file-diff-viewer.tsx
+++ b/src/components/features/diff-viewer/file-diff-viewer.tsx
@@ -17,7 +17,9 @@ import { getLanguageFromPath } from "#/utils/get-language-from-path";
import { cn } from "#/utils/utils";
import { ChevronDown, ChevronRight } from "lucide-react";
import { useUnifiedGitDiff } from "#/hooks/query/use-unified-git-diff";
+import { useColorTheme } from "#/hooks/use-color-theme";
import { MarkdownRenderer } from "#/components/features/markdown/markdown-renderer";
+import { COLOR_THEMES, type ColorThemeKey } from "#/themes/color-themes";
import { Typography } from "#/ui/typography";
import { LoadingSpinner } from "./loading-spinner";
import { EditorContainer } from "./editor-container";
@@ -55,8 +57,16 @@ const STATUS_MAP: Record<GitChangeStatus, string | IconType> = {
U: "Untracked",
};
+const MONACO_THEME_NAMES: Record<ColorThemeKey, string> = {
+ "openhands-deepsea": "openhands-diff-dark",
+ "openhands-neutral": "openhands-diff-dark",
+ "openhands-neo": "openhands-diff-dark",
+ "light-plus": "openhands-diff-light-plus",
+ "solarized-light": "openhands-diff-solarized-light",
+};
+
const beforeMount = (monaco: Monaco) => {
- monaco.editor.defineTheme("custom-diff-theme", {
+ monaco.editor.defineTheme("openhands-diff-dark", {
base: "vs-dark",
inherit: true,
rules: [
@@ -75,6 +85,50 @@ const beforeMount = (monaco: Monaco) => {
"editorUnnecessaryCode.opacity": "rgba(0, 0, 0, 0.467)",
},
});
+
+ monaco.editor.defineTheme("openhands-diff-light-plus", {
+ base: "vs",
+ inherit: true,
+ rules: [
+ { token: "comment", foreground: "008000" },
+ { token: "keyword", foreground: "0000FF" },
+ { token: "string", foreground: "A31515" },
+ { token: "number", foreground: "098658" },
+ ],
+ colors: {
+ "editor.background": "#FFFFFF",
+ "editor.foreground": "#1F1F1F",
+ "diffEditor.insertedTextBackground": "#9BB95566",
+ "diffEditor.removedTextBackground": "#FF818266",
+ "diffEditor.insertedLineBackground": "#E9F5DD",
+ "diffEditor.removedLineBackground": "#FFEBE9",
+ "diffEditor.border": "#D4D4D4",
+ "editorUnnecessaryCode.border": "#00000000",
+ "editorUnnecessaryCode.opacity": "rgba(31, 31, 31, 0.45)",
+ },
+ });
+
+ monaco.editor.defineTheme("openhands-diff-solarized-light", {
+ base: "vs",
+ inherit: true,
+ rules: [
+ { token: "comment", foreground: "93A1A1" },
+ { token: "keyword", foreground: "859900" },
+ { token: "string", foreground: "2AA198" },
+ { token: "number", foreground: "D33682" },
+ ],
+ colors: {
+ "editor.background": "#FDF6E3",
+ "editor.foreground": "#657B83",
+ "diffEditor.insertedTextBackground": "#85990044",
+ "diffEditor.removedTextBackground": "#DC322F3D",
+ "diffEditor.insertedLineBackground": "#E7E8C9",
+ "diffEditor.removedLineBackground": "#F5D5C8",
+ "diffEditor.border": "#D7D0BC",
+ "editorUnnecessaryCode.border": "#00000000",
+ "editorUnnecessaryCode.opacity": "rgba(88, 110, 117, 0.5)",
+ },
+ });
};
export interface FileDiffViewerProps {
@@ -103,6 +157,9 @@ export function FileDiffViewer({
onToggle,
}: FileDiffViewerProps) {
const { t } = useTranslation("openhands");
+ const colorTheme = useColorTheme();
+ const monacoTheme = MONACO_THEME_NAMES[colorTheme];
+ const isLightTheme = COLOR_THEMES[colorTheme].appearance === "light";
const [uncontrolledExpanded, setUncontrolledExpanded] = React.useState(false);
const isControlled = controlledExpanded !== undefined;
const isExpanded = isControlled ? controlledExpanded : uncontrolledExpanded;
@@ -238,7 +295,7 @@ export function FileDiffViewer({
language={language}
original={isAdded ? "" : (diff?.original ?? "")}
modified={isDeleted ? "" : (diff?.modified ?? "")}
- theme="custom-diff-theme"
+ theme={monacoTheme}
onMount={handleDiffEditorMount}
beforeMount={beforeMount}
options={{
@@ -253,7 +310,10 @@ export function FileDiffViewer({
if (isMarkdownFile) {
return (
<div
- className="w-full border-b border-border overflow-auto p-4 bg-base prose prose-invert max-w-none"
+ className={cn(
+ "w-full border-b border-border overflow-auto p-4 bg-base prose max-w-none",
+ !isLightTheme && "prose-invert",
+ )}
data-testid="markdown-preview"
style={{ maxHeight: MAX_DIFF_EDITOR_HEIGHT_PX }}
>
@@ -272,7 +332,7 @@ export function FileDiffViewer({
className="w-full h-full"
language={language}
value={singleViewContent}
- theme="custom-diff-theme"
+ theme={monacoTheme}
beforeMount={beforeMount}
onMount={handleSingleEditorMount}
options={SHARED_EDITOR_OPTIONS}
@@ -317,8 +377,8 @@ export function FileDiffViewer({
className={cn(
"p-1 rounded transition-colors cursor-pointer",
viewMode === mode
- ? "bg-interactive-hover text-white"
- : "text-muted hover:bg-interactive-hover hover:text-white",
+ ? "bg-interactive-hover text-contrast"
+ : "text-muted hover:bg-interactive-hover hover:text-contrast",
)}
>
<Icon className="w-4 h-4" />
diff --git a/src/components/features/diff-viewer/loading-spinner.tsx b/src/components/features/diff-viewer/loading-spinner.tsx
index f20e170f24..e3e35db126 100644
--- a/src/components/features/diff-viewer/loading-spinner.tsx
+++ b/src/components/features/diff-viewer/loading-spinner.tsx
@@ -13,7 +13,7 @@ export function LoadingSpinner({ className }: LoadingSpinnerProps) {
<div className="flex items-center justify-center">
<div
className={cn(
- "animate-spin rounded-full border-4 border-transparent border-t-white",
+ "animate-spin rounded-full border-4 border-transparent border-t-contrast",
className,
)}
role="status"
diff --git a/src/components/features/files-tab/file-content-viewer.tsx b/src/components/features/files-tab/file-content-viewer.tsx
index 3fbb420396..a558c354b0 100644
--- a/src/components/features/files-tab/file-content-viewer.tsx
+++ b/src/components/features/files-tab/file-content-viewer.tsx
@@ -1,6 +1,7 @@
import { useTranslation } from "react-i18next";
import { I18nKey } from "#/i18n/declaration";
+import { useColorTheme } from "#/hooks/use-color-theme";
import { useWorkspaceFileContent } from "#/hooks/query/use-workspace-file-content";
import {
useWorkspaceMutationCounter,
@@ -8,6 +9,8 @@ import {
} from "#/stores/use-workspace-mutation-counter";
import { MarkdownRenderer } from "#/components/features/markdown/markdown-renderer";
import { isMarkdownFilePath } from "#/utils/is-markdown-file-path";
+import { COLOR_THEMES } from "#/themes/color-themes";
+import { cn } from "#/utils/utils";
import { HighlightedSourceView } from "./highlighted-source-view";
import type { ViewMode } from "./view-mode";
@@ -68,6 +71,8 @@ function UnpreviewableFallback({ path }: { path: string }) {
*/
export function FileContentViewer({ path, viewMode }: FileContentViewerProps) {
const { t } = useTranslation("openhands");
+ const colorTheme = useColorTheme();
+ const isLightTheme = COLOR_THEMES[colorTheme].appearance === "light";
const query = useWorkspaceFileContent(path);
// Subscribe to the workspace mutation counter so the iframe / <img> src
// changes after every agent-side edit, forcing a fresh fetch even when
@@ -186,18 +191,18 @@ export function FileContentViewer({ path, viewMode }: FileContentViewerProps) {
// blends with the surrounding files tab instead of painting a stark
// white card. `--oh-scroll-fade-from` keeps wide-table edge fades on
// the same surface (otherwise they default to `--oh-color-base`).
- // We use `prose-invert` (typography plugin's dark-theme variant) and
- // then layer arbitrary CSS-variable overrides on top to pin body /
- // bold / quote text to pure white β€” the user specifically asked for
- // every text element (not just headings) to read as white. The custom
- // heading components in `markdown/headings.tsx` already hard-code
- // `text-white`, so headers stay white through this change.
return (
<div
data-testid="file-content-viewer-markdown"
- className="h-full w-full overflow-auto bg-surface text-white custom-scrollbar-always [--oh-scroll-fade-from:var(--oh-surface)]"
+ className="h-full w-full overflow-auto bg-surface text-foreground custom-scrollbar-always [--oh-scroll-fade-from:var(--oh-surface)]"
>
- <div className="prose prose-sm prose-invert max-w-none p-6 [--tw-prose-body:#fff] [--tw-prose-bold:#fff] [--tw-prose-headings:#fff] [--tw-prose-lead:#fff] [--tw-prose-counters:#fff] [--tw-prose-quotes:#fff] [--tw-prose-quote-borders:var(--oh-border-subtle)] [--tw-prose-bullets:var(--oh-muted)] [--tw-prose-hr:var(--oh-border-subtle)] [--tw-prose-captions:var(--oh-muted)] [--tw-prose-kbd:#fff]">
+ <div
+ className={cn(
+ "prose prose-sm max-w-none p-6",
+ "[--tw-prose-body:var(--oh-foreground)] [--tw-prose-bold:var(--oh-foreground)] [--tw-prose-headings:var(--oh-foreground)] [--tw-prose-lead:var(--oh-text-secondary)] [--tw-prose-counters:var(--oh-text-secondary)] [--tw-prose-quotes:var(--oh-foreground)] [--tw-prose-quote-borders:var(--oh-border-subtle)] [--tw-prose-bullets:var(--oh-muted)] [--tw-prose-hr:var(--oh-border-subtle)] [--tw-prose-captions:var(--oh-muted)] [--tw-prose-kbd:var(--oh-foreground)]",
+ !isLightTheme && "prose-invert",
+ )}
+ >
<MarkdownRenderer
content={text ?? ""}
includeStandard
diff --git a/src/components/features/files-tab/file-quick-row.tsx b/src/components/features/files-tab/file-quick-row.tsx
index da0069ed5f..33ba9b769d 100644
--- a/src/components/features/files-tab/file-quick-row.tsx
+++ b/src/components/features/files-tab/file-quick-row.tsx
@@ -88,8 +88,8 @@ export function FileQuickRow({
index === 0 && "border-l border-l-border",
"border-b-2 -mb-px transition-colors",
isSelected
- ? "border-b-white text-white"
- : "border-b-transparent text-muted hover:text-white hover:border-b-white/25",
+ ? "border-b-contrast text-contrast"
+ : "border-b-transparent text-muted hover:text-contrast hover:border-b-contrast/25",
)}
>
<button
@@ -110,7 +110,7 @@ export function FileQuickRow({
title={t(I18nKey.FILES$CLOSE_TAB, { path })}
className={cn(
"inline-flex items-center justify-center size-5 self-center mr-1 rounded-sm shrink-0 cursor-pointer",
- "text-inherit hover:bg-white/10",
+ "text-inherit hover:bg-contrast/10",
// Always visible on small / touch-first viewports; hover to
// reveal on fine pointers (desktop).
"opacity-100 transition-opacity",
diff --git a/src/components/features/files-tab/highlighted-source-view.tsx b/src/components/features/files-tab/highlighted-source-view.tsx
index 2ce8ecb7d8..bbee1189e3 100644
--- a/src/components/features/files-tab/highlighted-source-view.tsx
+++ b/src/components/features/files-tab/highlighted-source-view.tsx
@@ -1,6 +1,6 @@
-import { vscDarkPlus } from "react-syntax-highlighter/dist/esm/styles/prism";
-
import { SyntaxHighlighter } from "#/components/features/markdown/syntax-highlighter";
+import { useColorTheme } from "#/hooks/use-color-theme";
+import { getSyntaxHighlighterTheme } from "#/themes/syntax-highlighter-themes";
import { getPrismLanguageForFile } from "#/utils/file-language";
interface HighlightedSourceViewProps {
@@ -28,13 +28,14 @@ export function HighlightedSourceView({
text,
mimeType,
}: HighlightedSourceViewProps) {
+ const colorTheme = useColorTheme();
const language = getPrismLanguageForFile(path, mimeType);
if (!language) {
return (
<pre
data-testid="file-content-viewer-plain"
- className="h-full w-full overflow-auto whitespace-pre-wrap break-words bg-surface p-4 text-xs leading-5 text-white custom-scrollbar-always"
+ className="h-full w-full overflow-auto whitespace-pre-wrap break-words bg-surface p-4 text-xs leading-5 text-contrast custom-scrollbar-always"
>
{text}
</pre>
@@ -49,7 +50,7 @@ export function HighlightedSourceView({
>
<SyntaxHighlighter
language={language}
- style={vscDarkPlus}
+ style={getSyntaxHighlighterTheme(colorTheme)}
showLineNumbers
wrapLongLines={false}
// Override the theme's hard-coded background so the highlighter
diff --git a/src/components/features/files-tab/segmented-toggle.tsx b/src/components/features/files-tab/segmented-toggle.tsx
index 82aaf2a5da..15a89806c8 100644
--- a/src/components/features/files-tab/segmented-toggle.tsx
+++ b/src/components/features/files-tab/segmented-toggle.tsx
@@ -58,8 +58,8 @@ export function SegmentedToggle<T extends string>({
"inline-flex items-center gap-1.5 px-2 py-0.5 rounded cursor-pointer transition-colors",
equalWidth && "flex-1 justify-center text-center",
isActive
- ? "bg-interactive-hover text-white"
- : "text-muted hover:text-white",
+ ? "bg-interactive-hover text-contrast"
+ : "text-muted hover:text-contrast",
)}
>
{option.icon}
diff --git a/src/components/features/files-tab/tree-node.tsx b/src/components/features/files-tab/tree-node.tsx
index 6004549510..c45f9980c4 100644
--- a/src/components/features/files-tab/tree-node.tsx
+++ b/src/components/features/files-tab/tree-node.tsx
@@ -31,7 +31,7 @@ export function TreeNode({
aria-expanded={isOpen}
data-testid={`file-tree-dir-${node.path}`}
className={cn(
- "flex w-full items-center gap-1.5 py-1 pr-2 text-left text-sm text-white",
+ "flex w-full items-center gap-1.5 py-1 pr-2 text-left text-sm text-contrast",
"hover:bg-tertiary cursor-pointer",
)}
// per-row indentation computed from tree depth at runtime
@@ -77,7 +77,9 @@ export function TreeNode({
className={cn(
"flex w-full items-center gap-1.5 py-1 pr-2 text-left text-sm",
"hover:bg-tertiary cursor-pointer",
- isSelected ? "bg-interactive-hover text-white" : "text-text-tertiary",
+ isSelected
+ ? "bg-interactive-hover text-contrast"
+ : "text-text-tertiary",
)}
// per-row indentation computed from tree depth at runtime
style={{ paddingLeft: `${indentPx + 16}px` }}
diff --git a/src/components/features/files/file-item.tsx b/src/components/features/files/file-item.tsx
index bf587bc6f1..d5cf31e222 100644
--- a/src/components/features/files/file-item.tsx
+++ b/src/components/features/files/file-item.tsx
@@ -13,7 +13,7 @@ export function FileItem({ filename, onRemove }: FileItemProps) {
className="flex flex-row gap-x-1 items-center justify-start py-1"
>
<FaFile className="h-4 w-4" />
- <code className="text-sm flex-1 text-white truncate">{filename}</code>
+ <code className="text-sm flex-1 text-contrast truncate">{filename}</code>
{onRemove && <RemoveButton onClick={onRemove} />}
</div>
);
diff --git a/src/components/features/home/featured-automations/automation-run-activity-sparkline.tsx b/src/components/features/home/featured-automations/automation-run-activity-sparkline.tsx
index 474e63791f..386f35ec98 100644
--- a/src/components/features/home/featured-automations/automation-run-activity-sparkline.tsx
+++ b/src/components/features/home/featured-automations/automation-run-activity-sparkline.tsx
@@ -36,7 +36,9 @@ function TooltipRow({
return (
<div className="flex items-start gap-2 text-xs">
<span className="w-16 shrink-0 text-muted">{label}</span>
- <span className="min-w-0 flex-1 break-words text-white">{children}</span>
+ <span className="min-w-0 flex-1 break-words text-contrast">
+ {children}
+ </span>
</div>
);
}
@@ -68,7 +70,7 @@ function RunActivityBarTooltip({
barColorClassForStatus(display.badgeStatus),
)}
/>
- <span className="text-sm font-medium text-white">{statusLabel}</span>
+ <span className="text-sm font-medium text-contrast">{statusLabel}</span>
</div>
<div className="flex flex-col gap-1">
@@ -116,7 +118,7 @@ function RunActivityBar({
closeDelay={80}
delay={200}
disableAnimation={disableAnimation}
- className="rounded-xl border border-border bg-base-secondary p-0 text-white shadow-xl"
+ className="rounded-xl border border-border bg-base-secondary p-0 text-contrast shadow-xl"
>
{/* Wider hit target than the 4px bar so cancelled/skipped greys are easy to inspect. */}
<NavigationLink
diff --git a/src/components/features/home/featured-automations/home-automation-run-tooltip.tsx b/src/components/features/home/featured-automations/home-automation-run-tooltip.tsx
index d9ee099fda..e6d90d2ccc 100644
--- a/src/components/features/home/featured-automations/home-automation-run-tooltip.tsx
+++ b/src/components/features/home/featured-automations/home-automation-run-tooltip.tsx
@@ -109,7 +109,7 @@ export function HomeAutomationRunTooltip({
return (
<div className="flex w-70 flex-col gap-3 p-3">
- <span className="break-words text-sm font-medium text-white">
+ <span className="break-words text-sm font-medium text-contrast">
{automation.name}
</span>
diff --git a/src/components/features/home/featured-automations/pinned-automation-card.tsx b/src/components/features/home/featured-automations/pinned-automation-card.tsx
index a543d56fb6..16c4745114 100644
--- a/src/components/features/home/featured-automations/pinned-automation-card.tsx
+++ b/src/components/features/home/featured-automations/pinned-automation-card.tsx
@@ -305,7 +305,7 @@ export function PinnedAutomationCard({
placement="top"
closeDelay={100}
disableAnimation={disableAnimation}
- className="rounded-xl border border-border bg-base-secondary p-0 text-white shadow-xl"
+ className="rounded-xl border border-border bg-base-secondary p-0 text-contrast shadow-xl"
>
<span className="min-w-0 flex-1 cursor-default truncate text-text-secondary">
{shortSummary}
diff --git a/src/components/features/home/featured-automations/running-automations-list.tsx b/src/components/features/home/featured-automations/running-automations-list.tsx
index 255ae0b7a7..657ae8bbad 100644
--- a/src/components/features/home/featured-automations/running-automations-list.tsx
+++ b/src/components/features/home/featured-automations/running-automations-list.tsx
@@ -108,7 +108,7 @@ function RunningAutomationRow({
placement="top-start"
closeDelay={100}
disableAnimation={disableAnimation}
- className="rounded-xl border border-border bg-base-secondary p-0 text-white shadow-xl"
+ className="rounded-xl border border-border bg-base-secondary p-0 text-contrast shadow-xl"
>
<NavigationLink
to={hrefForActivityItem(item)}
diff --git a/src/components/features/home/git-branch-dropdown/git-branch-dropdown.tsx b/src/components/features/home/git-branch-dropdown/git-branch-dropdown.tsx
index 122cce420d..245d565c84 100644
--- a/src/components/features/home/git-branch-dropdown/git-branch-dropdown.tsx
+++ b/src/components/features/home/git-branch-dropdown/git-branch-dropdown.tsx
@@ -187,10 +187,10 @@ export function GitBranchDropdown({
return (
<div className={cn("relative", className)}>
- <div className="group relative text-muted hover:text-white">
+ <div className="group relative text-muted hover:text-contrast">
<div className="absolute left-2 top-1/2 transform -translate-y-1/2 z-10">
{isLoadingState ? (
- <div className="animate-spin h-4 w-4 border-2 border-transparent border-t-white rounded-full" />
+ <div className="animate-spin h-4 w-4 border-2 border-transparent border-t-contrast rounded-full" />
) : (
<BranchIcon width={16} height={16} />
)}
diff --git a/src/components/features/home/git-provider-dropdown/git-provider-dropdown.tsx b/src/components/features/home/git-provider-dropdown/git-provider-dropdown.tsx
index 49289ee358..f9052efc8e 100644
--- a/src/components/features/home/git-provider-dropdown/git-provider-dropdown.tsx
+++ b/src/components/features/home/git-provider-dropdown/git-provider-dropdown.tsx
@@ -159,7 +159,7 @@ export function GitProviderDropdown({
return (
<div className={cn("relative", className)}>
- <div className="group relative text-muted hover:text-white">
+ <div className="group relative text-muted hover:text-contrast">
{/* Provider icon */}
{selectedItem && (
<div className="absolute left-2 top-1/2 transform -translate-y-1/2 z-10">
diff --git a/src/components/features/home/git-repo-dropdown/git-repo-dropdown.tsx b/src/components/features/home/git-repo-dropdown/git-repo-dropdown.tsx
index 46495ffad9..b60be9df5e 100644
--- a/src/components/features/home/git-repo-dropdown/git-repo-dropdown.tsx
+++ b/src/components/features/home/git-repo-dropdown/git-repo-dropdown.tsx
@@ -287,10 +287,10 @@ export function GitRepoDropdown({
return (
<div className={cn("relative", className)}>
- <div className="group relative text-muted hover:text-white">
+ <div className="group relative text-muted hover:text-contrast">
<div className="absolute left-2 top-1/2 transform -translate-y-1/2 z-10">
{isLoadingState ? (
- <div className="animate-spin h-4 w-4 border-2 border-transparent border-t-white rounded-full" />
+ <div className="animate-spin h-4 w-4 border-2 border-transparent border-t-contrast rounded-full" />
) : (
<RepoIcon width={16} height={16} />
)}
diff --git a/src/components/features/home/open-launcher-button.tsx b/src/components/features/home/open-launcher-button.tsx
index 83086aaba1..e468f8cfb3 100644
--- a/src/components/features/home/open-launcher-button.tsx
+++ b/src/components/features/home/open-launcher-button.tsx
@@ -38,7 +38,7 @@ export function OpenLauncherButton({
onClick={onClick}
disabled={disabled}
className={cn(
- "flex flex-row items-center gap-2 rounded-full px-2.5 py-1 text-white",
+ "flex flex-row items-center gap-2 rounded-full px-2.5 py-1 text-contrast",
formControlBorderClassName,
formControlSurfaceClassName,
formControlTransitionClassName,
diff --git a/src/components/features/home/repo-selection-form.tsx b/src/components/features/home/repo-selection-form.tsx
index 781eee1025..ea95086e79 100644
--- a/src/components/features/home/repo-selection-form.tsx
+++ b/src/components/features/home/repo-selection-form.tsx
@@ -180,7 +180,7 @@ export function RepositorySelectionForm({
<div className="flex items-center justify-between">
<div className="flex items-center gap-2.5 pb-4">
<RepoForkedIcon width={24} height={24} />
- <span className="leading-5 font-bold text-base text-white">
+ <span className="leading-5 font-bold text-base text-contrast">
{t(I18nKey.COMMON$OPEN_REPOSITORY)}
</span>
</div>
@@ -189,7 +189,7 @@ export function RepositorySelectionForm({
<div className="flex flex-col gap-2.5 pb-4">
<div className="flex items-center justify-between">
- <span className="text-sm text-white font-normal leading-5.5">
+ <span className="text-sm text-contrast font-normal leading-5.5">
{t(I18nKey.HOME$SELECT_OR_INSERT_URL)}
</span>
{renderProviderSelector()}
diff --git a/src/components/features/home/shared/dropdown-item.tsx b/src/components/features/home/shared/dropdown-item.tsx
index d2e2c5a3e9..c38d4b95ff 100644
--- a/src/components/features/home/shared/dropdown-item.tsx
+++ b/src/components/features/home/shared/dropdown-item.tsx
@@ -44,10 +44,10 @@ export function DropdownItem<T>({
isProviderDropdown
? "group px-2 py-0 cursor-pointer text-xs rounded-md mx-0 my-0 h-6 flex items-center"
: "group px-2 py-2 cursor-pointer text-sm rounded-md mx-0 my-0.5",
- "text-white focus:outline-none font-normal",
+ "text-contrast focus:outline-none font-normal",
dropdownInstantColorClassName,
{
- "bg-interactive-selected text-white": isSelected,
+ "bg-interactive-selected text-contrast": isSelected,
"hover:bg-interactive-hover": !isSelected,
},
itemClassName,
diff --git a/src/components/features/home/shared/loading-spinner.tsx b/src/components/features/home/shared/loading-spinner.tsx
index d6c32f8113..434c772873 100644
--- a/src/components/features/home/shared/loading-spinner.tsx
+++ b/src/components/features/home/shared/loading-spinner.tsx
@@ -18,7 +18,7 @@ export function LoadingSpinner({
)}
>
<div
- className="animate-spin h-4 w-4 border-2 border-transparent border-t-white rounded-full"
+ className="animate-spin h-4 w-4 border-2 border-transparent border-t-contrast rounded-full"
data-testid={testId}
/>
</div>
diff --git a/src/components/features/home/workspace-dropdown/folder-browser-modal.tsx b/src/components/features/home/workspace-dropdown/folder-browser-modal.tsx
index e51bda13ce..be20ec9ec5 100644
--- a/src/components/features/home/workspace-dropdown/folder-browser-modal.tsx
+++ b/src/components/features/home/workspace-dropdown/folder-browser-modal.tsx
@@ -66,7 +66,7 @@ function SidebarSection({
className={cn(
"flex items-center gap-2 w-full px-2 py-1 rounded text-sm cursor-pointer",
isActive
- ? "bg-tertiary text-white"
+ ? "bg-tertiary text-contrast"
: "text-text-tertiary hover:bg-surface-raised",
)}
>
@@ -277,7 +277,7 @@ export function FolderBrowserModal({
onClick={() => parent && setCurrentPath(parent)}
disabled={!parent}
aria-label={t(I18nKey.COMMON$UP)}
- className="p-1 rounded hover:bg-interactive-hover text-white disabled:opacity-40 disabled:cursor-not-allowed cursor-pointer"
+ className="p-1 rounded hover:bg-interactive-hover text-contrast disabled:opacity-40 disabled:cursor-not-allowed cursor-pointer"
>
<ChevronLeft width={16} height={16} />
</button>
@@ -333,7 +333,7 @@ export function FolderBrowserModal({
<button
type="button"
onClick={() => setCurrentPath(entry.path)}
- className="grid grid-cols-[1fr_120px] items-center w-full text-left px-4 py-1.5 text-sm text-white hover:bg-interactive-hover cursor-pointer"
+ className="grid grid-cols-[1fr_120px] items-center w-full text-left px-4 py-1.5 text-sm text-contrast hover:bg-interactive-hover cursor-pointer"
data-testid={`folder-browser-entry-${entry.name}`}
>
<span className="flex items-center gap-2 min-w-0">
diff --git a/src/components/features/home/workspace-dropdown/manage-workspaces-modal.tsx b/src/components/features/home/workspace-dropdown/manage-workspaces-modal.tsx
index 1c7a5f38ea..de9cc33fde 100644
--- a/src/components/features/home/workspace-dropdown/manage-workspaces-modal.tsx
+++ b/src/components/features/home/workspace-dropdown/manage-workspaces-modal.tsx
@@ -109,7 +109,7 @@ export function ManageWorkspacesModal({
>
<FolderIcon width={16} height={16} className="shrink-0" />
<div className="flex flex-col min-w-0 flex-1">
- <span className="text-sm text-white truncate">
+ <span className="text-sm text-contrast truncate">
{workspace.name}
</span>
<span className="text-xs text-muted truncate">
@@ -129,7 +129,7 @@ export function ManageWorkspacesModal({
}
aria-label={t(I18nKey.HOME$REMOVE_WORKSPACE)}
data-testid={`manage-workspaces-remove-${workspace.name}`}
- className="flex items-center gap-1 px-2 py-1 rounded text-xs text-text-tertiary hover:bg-interactive-hover hover:text-white cursor-pointer"
+ className="flex items-center gap-1 px-2 py-1 rounded text-xs text-text-tertiary hover:bg-interactive-hover hover:text-contrast cursor-pointer"
>
<CloseIcon width={12} height={12} />
<span>{t(I18nKey.HOME$REMOVE_WORKSPACE)}</span>
@@ -161,7 +161,7 @@ export function ManageWorkspacesModal({
className="shrink-0"
/>
<div className="flex flex-col min-w-0 flex-1">
- <span className="text-sm text-white truncate">
+ <span className="text-sm text-contrast truncate">
{parent.name}
</span>
<span className="text-xs text-muted truncate">
@@ -188,7 +188,7 @@ export function ManageWorkspacesModal({
I18nKey.HOME$REMOVE_WORKSPACE_PARENT,
)}
data-testid={`manage-workspaces-remove-parent-${parent.name}`}
- className="flex items-center gap-1 px-2 py-1 rounded text-xs text-text-tertiary hover:bg-interactive-hover hover:text-white cursor-pointer"
+ className="flex items-center gap-1 px-2 py-1 rounded text-xs text-text-tertiary hover:bg-interactive-hover hover:text-contrast cursor-pointer"
>
<CloseIcon width={12} height={12} />
<span>
diff --git a/src/components/features/home/workspace-dropdown/workspace-dropdown.tsx b/src/components/features/home/workspace-dropdown/workspace-dropdown.tsx
index a170af1434..8641b879f8 100644
--- a/src/components/features/home/workspace-dropdown/workspace-dropdown.tsx
+++ b/src/components/features/home/workspace-dropdown/workspace-dropdown.tsx
@@ -317,7 +317,7 @@ export function WorkspaceDropdown({
const control = (
<div className={cn("relative", className)}>
- <div className="group relative text-muted hover:text-white">
+ <div className="group relative text-muted hover:text-contrast">
<div className="absolute left-2 top-1/2 transform -translate-y-1/2 z-10">
<RepoIcon width={16} height={16} />
</div>
diff --git a/src/components/features/home/workspace-selection-form.tsx b/src/components/features/home/workspace-selection-form.tsx
index ac31005df8..5cdf6df0f1 100644
--- a/src/components/features/home/workspace-selection-form.tsx
+++ b/src/components/features/home/workspace-selection-form.tsx
@@ -175,7 +175,7 @@ export function WorkspaceSelectionForm({
{!onConfirm && (
<div className="flex items-center gap-2.5 pb-4">
<FolderIcon width={24} height={24} />
- <span className="leading-5 font-bold text-base text-white">
+ <span className="leading-5 font-bold text-base text-contrast">
{t(I18nKey.HOME$WORKSPACES_TAB)}
</span>
</div>
diff --git a/src/components/features/launch/plugin-launch-modal.tsx b/src/components/features/launch/plugin-launch-modal.tsx
index 7c859b4af6..8925eaa4a3 100644
--- a/src/components/features/launch/plugin-launch-modal.tsx
+++ b/src/components/features/launch/plugin-launch-modal.tsx
@@ -141,7 +141,7 @@ export function PluginLaunchModal({
{t(I18nKey.LAUNCH$MODAL_TITLE)} {modalTitle}
</Typography.H2>
- {message && <p className="text-sm text-white">{message}</p>}
+ {message && <p className="text-sm text-contrast">{message}</p>}
<div className="flex-1 overflow-y-auto custom-scrollbar">
{pluginsWithParams.length > 0 && (
@@ -162,7 +162,7 @@ export function PluginLaunchModal({
{pluginsWithoutParams.length > 0 && (
<div className={cn(pluginsWithParams.length > 0 && "mt-4")}>
- <Typography.H3 className="mb-2 text-white">
+ <Typography.H3 className="mb-2 text-contrast">
{pluginsWithParams.length > 0
? t(I18nKey.LAUNCH$ADDITIONAL_PLUGINS)
: t(I18nKey.LAUNCH$PLUGINS)}
@@ -176,7 +176,7 @@ export function PluginLaunchModal({
<div className="font-medium">
{getPluginDisplayName(plugin)}
</div>
- <div className="text-xs text-white mt-1">
+ <div className="text-xs text-contrast mt-1">
{getPluginSourceInfo(plugin)}
{plugin.repo_path && (
<span className="ml-1">/ {plugin.repo_path}</span>
@@ -202,7 +202,7 @@ export function PluginLaunchModal({
onChange={(e) => setTrustConfirmed(e.target.checked)}
className="mt-1 h-4 w-4 flex-shrink-0"
/>
- <label htmlFor="trust-checkbox" className="text-sm text-white">
+ <label htmlFor="trust-checkbox" className="text-sm text-contrast">
{t(I18nKey.LAUNCH$TRUST_SKILL_CHECKBOX, {
sources: getUniqueSources().join(", "),
interpolation: { escapeValue: false },
diff --git a/src/components/features/launch/plugin-launch-plugin-section.tsx b/src/components/features/launch/plugin-launch-plugin-section.tsx
index 5c491f1525..76607dc12a 100644
--- a/src/components/features/launch/plugin-launch-plugin-section.tsx
+++ b/src/components/features/launch/plugin-launch-plugin-section.tsx
@@ -46,21 +46,21 @@ export function PluginLaunchPluginSection({
{getPluginDisplayName(plugin)}
</Typography.Text>
{isExpanded ? (
- <IoChevronDown className="h-5 w-5 text-white" />
+ <IoChevronDown className="h-5 w-5 text-contrast" />
) : (
- <IoChevronForward className="h-5 w-5 text-white" />
+ <IoChevronForward className="h-5 w-5 text-contrast" />
)}
</button>
{isExpanded && (
<div className="border-t border-border-subtle px-4 pb-3">
{plugin.ref && (
- <div className="mb-2 text-sm text-white">
+ <div className="mb-2 text-sm text-contrast">
{t(I18nKey.LAUNCH$PLUGIN_REF)} {plugin.ref}
</div>
)}
{plugin.repo_path && (
- <div className="mb-2 text-sm text-white">
+ <div className="mb-2 text-sm text-contrast">
{t(I18nKey.LAUNCH$PLUGIN_PATH)} {plugin.repo_path}
</div>
)}
diff --git a/src/components/features/manifest/manifest-subpage-layout.tsx b/src/components/features/manifest/manifest-subpage-layout.tsx
index 6340575fb1..529d3317c6 100644
--- a/src/components/features/manifest/manifest-subpage-layout.tsx
+++ b/src/components/features/manifest/manifest-subpage-layout.tsx
@@ -65,7 +65,9 @@ export function ManifestSubpageLayout({
data-testid={`${navTestIdBase}-desktop`}
className="hidden md:flex md:w-65 md:shrink-0 md:flex-col md:gap-2 md:sticky md:top-8 md:self-start"
>
- <span className="px-2 text-sm font-normal text-white">{heading}</span>
+ <span className="px-2 text-sm font-normal text-contrast">
+ {heading}
+ </span>
<div className="flex flex-col gap-0.5 pt-0.5">
{items.map((item) => (
<SubPageNavLink key={item.to} item={item} />
diff --git a/src/components/features/markdown/code.tsx b/src/components/features/markdown/code.tsx
index 7a53fa9038..42fc4acf53 100644
--- a/src/components/features/markdown/code.tsx
+++ b/src/components/features/markdown/code.tsx
@@ -1,7 +1,8 @@
import React from "react";
import { ExtraProps } from "react-markdown";
-import { vscDarkPlus } from "react-syntax-highlighter/dist/esm/styles/prism";
import { CopyableContentWrapper } from "#/components/shared/buttons/copyable-content-wrapper";
+import { useColorTheme } from "#/hooks/use-color-theme";
+import { getSyntaxHighlighterTheme } from "#/themes/syntax-highlighter-themes";
import { cn } from "#/utils/utils";
import { SyntaxHighlighter } from "./syntax-highlighter";
@@ -9,13 +10,19 @@ import { SyntaxHighlighter } from "./syntax-highlighter";
/**
* Component to render code blocks in markdown.
+ *
+ * Named `Code` rather than lowercase like its sibling markdown components
+ * because it calls a hook (`useColorTheme`), and `react-hooks/rules-of-hooks`
+ * only treats capitalized functions as components. It is exported as `code`
+ * so the `components` map in markdown-renderer reads like the others.
*/
-export function code({
+function Code({
children,
className,
}: React.ClassAttributes<HTMLElement> &
React.HTMLAttributes<HTMLElement> &
ExtraProps) {
+ const colorTheme = useColorTheme();
const match = /language-(\w+)/.exec(className || ""); // get the language
const codeString = String(children).replace(/\n$/, "");
@@ -48,7 +55,7 @@ export function code({
<CopyableContentWrapper text={codeString}>
<SyntaxHighlighter
className="rounded-lg"
- style={vscDarkPlus}
+ style={getSyntaxHighlighterTheme(colorTheme)}
language={match?.[1]}
PreTag="div"
>
@@ -57,3 +64,5 @@ export function code({
</CopyableContentWrapper>
);
}
+
+export { Code as code };
diff --git a/src/components/features/markdown/headings.tsx b/src/components/features/markdown/headings.tsx
index def225400d..d9bdf3a61e 100644
--- a/src/components/features/markdown/headings.tsx
+++ b/src/components/features/markdown/headings.tsx
@@ -8,7 +8,7 @@ export function h1({
React.HTMLAttributes<HTMLHeadingElement> &
ExtraProps) {
return (
- <h1 className="text-xl text-white font-medium leading-7 mb-3 mt-4 first:mt-0">
+ <h1 className="text-xl text-contrast font-medium leading-7 mb-3 mt-4 first:mt-0">
{children}
</h1>
);
@@ -21,7 +21,7 @@ export function h2({
React.HTMLAttributes<HTMLHeadingElement> &
ExtraProps) {
return (
- <h2 className="text-lg font-medium leading-6 -tracking-[0.01em] text-white mb-2.5 mt-4 first:mt-0">
+ <h2 className="text-lg font-medium leading-6 -tracking-[0.01em] text-contrast mb-2.5 mt-4 first:mt-0">
{children}
</h2>
);
@@ -34,7 +34,7 @@ export function h3({
React.HTMLAttributes<HTMLHeadingElement> &
ExtraProps) {
return (
- <h3 className="text-base font-medium text-white mb-2 mt-3 first:mt-0">
+ <h3 className="text-base font-medium text-contrast mb-2 mt-3 first:mt-0">
{children}
</h3>
);
@@ -47,7 +47,7 @@ export function h4({
React.HTMLAttributes<HTMLHeadingElement> &
ExtraProps) {
return (
- <h4 className="text-sm font-medium text-white mb-1.5 mt-3 first:mt-0">
+ <h4 className="text-sm font-medium text-contrast mb-1.5 mt-3 first:mt-0">
{children}
</h4>
);
diff --git a/src/components/features/markdown/plan-components.tsx b/src/components/features/markdown/plan-components.tsx
index 761c1732de..7034ae6d3f 100644
--- a/src/components/features/markdown/plan-components.tsx
+++ b/src/components/features/markdown/plan-components.tsx
@@ -23,7 +23,7 @@ export function createPlanComponents(extraClassName?: string) {
h1: ({ children, className }: ElementProps) => (
<h1
className={cn(
- "text-lg text-white font-bold leading-6 mb-1.5 mt-3 first:mt-0",
+ "text-lg text-contrast font-bold leading-6 mb-1.5 mt-3 first:mt-0",
className,
extraClassName,
)}
@@ -34,7 +34,7 @@ export function createPlanComponents(extraClassName?: string) {
h2: ({ children, className }: ElementProps) => (
<h2
className={cn(
- "text-base font-semibold leading-5 text-white mb-1 mt-2.5 first:mt-0",
+ "text-base font-semibold leading-5 text-contrast mb-1 mt-2.5 first:mt-0",
className,
extraClassName,
)}
@@ -45,7 +45,7 @@ export function createPlanComponents(extraClassName?: string) {
h3: ({ children, className }: ElementProps) => (
<h3
className={cn(
- "text-sm font-semibold text-white mb-1 mt-2 first:mt-0",
+ "text-sm font-semibold text-contrast mb-1 mt-2 first:mt-0",
className,
extraClassName,
)}
@@ -56,7 +56,7 @@ export function createPlanComponents(extraClassName?: string) {
h4: ({ children, className }: ElementProps) => (
<h4
className={cn(
- "text-sm font-semibold text-white mb-1 mt-2 first:mt-0",
+ "text-sm font-semibold text-contrast mb-1 mt-2 first:mt-0",
className,
extraClassName,
)}
@@ -67,7 +67,7 @@ export function createPlanComponents(extraClassName?: string) {
h5: ({ children, className }: ElementProps) => (
<h5
className={cn(
- "text-xs font-semibold text-white mb-0.5 mt-1.5 first:mt-0",
+ "text-xs font-semibold text-contrast mb-0.5 mt-1.5 first:mt-0",
className,
extraClassName,
)}
diff --git a/src/components/features/markdown/table.tsx b/src/components/features/markdown/table.tsx
index c52b1321a5..33e15b5799 100644
--- a/src/components/features/markdown/table.tsx
+++ b/src/components/features/markdown/table.tsx
@@ -31,7 +31,7 @@ export function th({
React.ThHTMLAttributes<HTMLTableCellElement> &
ExtraProps) {
return (
- <th className="whitespace-nowrap border-border bg-surface px-3 py-2 text-left font-semibold text-white">
+ <th className="whitespace-nowrap border-border bg-surface px-3 py-2 text-left font-semibold text-contrast">
{children}
</th>
);
diff --git a/src/components/features/mcp-logo-badge.tsx b/src/components/features/mcp-logo-badge.tsx
index 302fa54c38..e8bc93f1ea 100644
--- a/src/components/features/mcp-logo-badge.tsx
+++ b/src/components/features/mcp-logo-badge.tsx
@@ -51,13 +51,15 @@ export function McpLogoBadge({
data-testid={testId}
className={cn(
"inline-flex shrink-0 items-center justify-center overflow-hidden",
- "border border-white/10 shadow-[inset_0_1px_0_rgba(255,255,255,0.18)]",
+ "border border-contrast/10 shadow-[inset_0_1px_0_color-mix(in_srgb,var(--oh-contrast)_18%,transparent)]",
sizeClassNames[size],
className,
)}
style={{
backgroundColor: entry?.iconBg ?? "var(--oh-color-tertiary)",
- color: entry?.iconColor ?? "#FFFFFF",
+ color:
+ entry?.iconColor ??
+ (entry?.iconBg ? "#FFFFFF" : "var(--oh-contrast)"),
}}
>
{LocalLogoIcon ? (
diff --git a/src/components/features/mcp-page/install-server-modal.tsx b/src/components/features/mcp-page/install-server-modal.tsx
index 60532808f5..817b920f30 100644
--- a/src/components/features/mcp-page/install-server-modal.tsx
+++ b/src/components/features/mcp-page/install-server-modal.tsx
@@ -51,7 +51,7 @@ function renderHelperText(text: string): React.ReactNode {
href={/^https?:\/\//i.test(match[2]) ? match[2] : "#"}
target="_blank"
rel="noreferrer"
- className="underline hover:text-white transition-colors"
+ className="underline hover:text-contrast transition-colors"
>
{match[1]}
</a>,
@@ -690,7 +690,7 @@ export function InstallServerModal({
href={entry.docsUrl}
target="_blank"
rel="noreferrer"
- className="text-xs text-muted hover:text-white hover:underline self-start transition-colors"
+ className="text-xs text-muted hover:text-contrast hover:underline self-start transition-colors"
>
{t(I18nKey.MCP$VIEW_DOCS)}
</a>
diff --git a/src/components/features/mcp-page/installed-servers-section.tsx b/src/components/features/mcp-page/installed-servers-section.tsx
index 755c3df489..076a60cdc9 100644
--- a/src/components/features/mcp-page/installed-servers-section.tsx
+++ b/src/components/features/mcp-page/installed-servers-section.tsx
@@ -55,7 +55,7 @@ export function InstalledServersSection({
data-testid="mcp-installed-empty"
className={extensionModuleEmptyStateClassName}
>
- <p className="text-sm text-white">
+ <p className="text-sm text-contrast">
{t(I18nKey.MCP$INSTALLED_EMPTY_TITLE)}
</p>
<p className="text-xs text-tertiary-light mt-1">
diff --git a/src/components/features/mcp-page/mcp-logo-stack-badge.tsx b/src/components/features/mcp-page/mcp-logo-stack-badge.tsx
index 2c7d173225..6dc18586af 100644
--- a/src/components/features/mcp-page/mcp-logo-stack-badge.tsx
+++ b/src/components/features/mcp-page/mcp-logo-stack-badge.tsx
@@ -5,7 +5,7 @@ import {
import { cn } from "#/utils/utils";
const STACK_CONTAINER_CLASS_NAME =
- "inline-flex h-10 w-10 shrink-0 overflow-hidden rounded-lg border border-white/10 bg-surface-raised shadow-[inset_0_1px_0_rgba(255,255,255,0.18)]";
+ "inline-flex h-10 w-10 shrink-0 overflow-hidden rounded-lg border border-contrast/10 bg-surface-raised shadow-[inset_0_1px_0_color-mix(in_srgb,var(--oh-contrast)_18%,transparent)]";
interface McpLogoStackBadgeProps {
entries: McpLogoEntry[];
diff --git a/src/components/features/mcp-page/mcp-server-health.tsx b/src/components/features/mcp-page/mcp-server-health.tsx
index 8ea6185a5b..9ba2ba9269 100644
--- a/src/components/features/mcp-page/mcp-server-health.tsx
+++ b/src/components/features/mcp-page/mcp-server-health.tsx
@@ -29,7 +29,7 @@ const DOT_CLASS_BY_STATUS: Record<McpServerHealth["status"], string> = {
};
const actionClassName =
- "text-xs text-muted underline transition-colors hover:text-white disabled:cursor-not-allowed disabled:opacity-60";
+ "text-xs text-muted underline transition-colors hover:text-contrast disabled:cursor-not-allowed disabled:opacity-60";
function getDotStatus(health: McpServerHealth): string {
if (health.status === "healthy") {
diff --git a/src/components/features/mcp-page/mcp-toolbar.tsx b/src/components/features/mcp-page/mcp-toolbar.tsx
index 32d041250b..253508838e 100644
--- a/src/components/features/mcp-page/mcp-toolbar.tsx
+++ b/src/components/features/mcp-page/mcp-toolbar.tsx
@@ -31,7 +31,7 @@ export function McpToolbar({
className={cn(
"relative flex flex-1 min-w-0 items-center",
"rounded-lg border border-border bg-base-secondary",
- "focus-within:border-white/40 focus-within:ring-1 focus-within:ring-white/20",
+ "focus-within:border-contrast/40 focus-within:ring-1 focus-within:ring-contrast/20",
"transition-colors",
)}
>
diff --git a/src/components/features/mcp-page/save-as-secret-toggle.tsx b/src/components/features/mcp-page/save-as-secret-toggle.tsx
index 64463438f4..fa591420e1 100644
--- a/src/components/features/mcp-page/save-as-secret-toggle.tsx
+++ b/src/components/features/mcp-page/save-as-secret-toggle.tsx
@@ -23,7 +23,7 @@ export function SaveAsSecretToggle({
"flex items-center gap-2 px-3 py-2 mt-0.5 rounded-lg border cursor-pointer transition-colors",
checked
? "border-green-500/35 bg-green-500/10"
- : "border-border bg-transparent hover:bg-white/[0.03]",
+ : "border-border bg-transparent hover:bg-contrast/[0.03]",
)}
>
{/* sr-only keeps the real checkbox in the accessibility tree so AT
@@ -57,7 +57,7 @@ export function SaveAsSecretToggle({
className={cn(
"ml-auto text-[11px] font-mono tracking-tight border rounded px-1.5 py-0.5",
checked
- ? "text-green-500 border-green-500/35 bg-white/[0.04]"
+ ? "text-green-500 border-green-500/35 bg-contrast/[0.04]"
: "text-tertiary-alt border-border",
)}
>
diff --git a/src/components/features/onboarding/onboarding-modal.tsx b/src/components/features/onboarding/onboarding-modal.tsx
index 96fe283357..6b4d6604fb 100644
--- a/src/components/features/onboarding/onboarding-modal.tsx
+++ b/src/components/features/onboarding/onboarding-modal.tsx
@@ -313,7 +313,7 @@ export function OnboardingModal({
data-current-step={currentStep}
data-preview={isPreview ? "true" : undefined}
className={cn(
- "flex flex-col gap-6 overflow-hidden rounded-2xl border border-white/10 bg-base-secondary shadow-2xl",
+ "flex flex-col gap-6 overflow-hidden rounded-2xl border border-contrast/10 bg-base-secondary shadow-2xl",
modalWidthClassName("lg"),
MODAL_MAX_WIDTH_VIEWPORT,
"max-h-[90vh]",
@@ -388,7 +388,7 @@ export function OnboardingModal({
type="button"
data-testid="onboarding-skip"
onClick={handleSkipOrDismiss}
- className="rounded-md px-3 py-2 text-sm text-muted transition-colors hover:bg-white/5 hover:text-white cursor-pointer"
+ className="rounded-md px-3 py-2 text-sm text-muted transition-colors hover:bg-contrast/5 hover:text-contrast cursor-pointer"
>
{t(I18nKey.ONBOARDING$SKIP)}
</button>
diff --git a/src/components/features/onboarding/onboarding-progress-bar.tsx b/src/components/features/onboarding/onboarding-progress-bar.tsx
index 3db5e4bc10..c7252c21ac 100644
--- a/src/components/features/onboarding/onboarding-progress-bar.tsx
+++ b/src/components/features/onboarding/onboarding-progress-bar.tsx
@@ -39,7 +39,7 @@ export function OnboardingProgressBar({
}
className={cn(
"h-1.5 flex-1 rounded-full transition-colors duration-300",
- isCompleted || isCurrent ? "bg-white" : "bg-white/15",
+ isCompleted || isCurrent ? "bg-contrast" : "bg-contrast/15",
)}
/>
);
diff --git a/src/components/features/onboarding/steps/check-backend-step.tsx b/src/components/features/onboarding/steps/check-backend-step.tsx
index 4d4617bb85..96487a2409 100644
--- a/src/components/features/onboarding/steps/check-backend-step.tsx
+++ b/src/components/features/onboarding/steps/check-backend-step.tsx
@@ -99,7 +99,7 @@ function ConnectionBanner({
<div
role="status"
data-testid="onboarding-backend-checking"
- className="flex items-start gap-3 rounded-xl border border-white/10 bg-white/5 px-4 py-3"
+ className="flex items-start gap-3 rounded-xl border border-contrast/10 bg-contrast/5 px-4 py-3"
>
<Loader2 className="mt-0.5 size-5 shrink-0 animate-spin text-text-tertiary" />
<span className="text-sm text-text-tertiary">
@@ -239,7 +239,7 @@ export function CheckBackendStep({
className="flex flex-col gap-6"
>
<header className="flex flex-col gap-2">
- <h2 className="text-2xl font-medium text-white">{t(titleKey)}</h2>
+ <h2 className="text-2xl font-medium text-contrast">{t(titleKey)}</h2>
{treatAsNoBackend ? null : (
<p
data-testid="onboarding-backend-subtitle"
diff --git a/src/components/features/onboarding/steps/choose-agent-step.tsx b/src/components/features/onboarding/steps/choose-agent-step.tsx
index 00dc80a835..040de71521 100644
--- a/src/components/features/onboarding/steps/choose-agent-step.tsx
+++ b/src/components/features/onboarding/steps/choose-agent-step.tsx
@@ -47,7 +47,7 @@ export function AgentOptionIcon({ id, muted }: { id: string; muted: boolean }) {
<AgentBrandIcon
kind="openhands"
size={16}
- className={cn("text-white", muted && "opacity-55")}
+ className={cn("text-contrast", muted && "opacity-55")}
data-testid="onboarding-agent-icon-openhands"
/>
);
@@ -57,7 +57,7 @@ export function AgentOptionIcon({ id, muted }: { id: string; muted: boolean }) {
<AgentBrandIcon
kind={icon}
size={18}
- className={muted ? "text-muted" : "text-white"}
+ className={muted ? "text-muted" : "text-contrast"}
data-testid={`onboarding-agent-icon-${icon}`}
/>
);
@@ -137,7 +137,7 @@ export function ChooseAgentStep({
className="flex flex-col gap-6"
>
<header className="flex flex-col gap-2">
- <h2 className="text-2xl font-medium text-white">
+ <h2 className="text-2xl font-medium text-contrast">
{t(I18nKey.ONBOARDING$AGENT_TITLE)}
</h2>
<p className="text-sm text-muted">
@@ -164,14 +164,14 @@ export function ChooseAgentStep({
className={cn(
"flex items-start justify-between gap-4 rounded-xl border px-4 py-3 text-left transition-colors cursor-pointer",
isSelected
- ? "border-white/45 bg-white/[0.09] shadow-none hover:border-white/45 hover:bg-white/[0.09]"
- : "border-white/30 bg-white/5 hover:border-white/40 hover:bg-white/[0.08]",
+ ? "border-contrast/45 bg-contrast/[0.09] shadow-none hover:border-contrast/45 hover:bg-contrast/[0.09]"
+ : "border-contrast/30 bg-contrast/5 hover:border-contrast/40 hover:bg-contrast/[0.08]",
)}
>
<div className="flex min-w-0 flex-1 flex-col gap-1">
<div className="flex min-w-0 items-center gap-2">
<AgentOptionIcon id={option.id} muted={false} />
- <span className="truncate text-base font-normal text-white">
+ <span className="truncate text-base font-normal text-contrast">
{option.label}
</span>
</div>
@@ -184,7 +184,7 @@ export function ChooseAgentStep({
<Check
width={18}
height={18}
- className="mt-1 shrink-0 text-white"
+ className="mt-1 shrink-0 text-contrast"
aria-hidden
/>
) : null}
diff --git a/src/components/features/onboarding/steps/say-hello-step.tsx b/src/components/features/onboarding/steps/say-hello-step.tsx
index 2ed725a86f..765aa111ee 100644
--- a/src/components/features/onboarding/steps/say-hello-step.tsx
+++ b/src/components/features/onboarding/steps/say-hello-step.tsx
@@ -78,7 +78,7 @@ export function SayHelloStep({
className="flex max-h-[calc(90vh-7rem)] flex-col"
>
<header className="flex shrink-0 flex-col gap-2">
- <h2 className="text-2xl font-medium text-white">
+ <h2 className="text-2xl font-medium text-contrast">
{t(I18nKey.ONBOARDING$HELLO_TITLE)}
</h2>
<p className="text-sm text-muted">
@@ -109,7 +109,7 @@ export function SayHelloStep({
disabled={isLaunching}
// `text-base` is a color utility in this theme (--color-base), not 16px.
// eslint-disable-next-line shadcn/no-arbitrary-values
- className="min-h-5 w-full flex-1 bg-transparent text-[16px] font-normal leading-5 text-white outline-none placeholder:text-text-tertiary disabled:cursor-not-allowed disabled:opacity-50"
+ className="min-h-5 w-full flex-1 bg-transparent text-[16px] font-normal leading-5 text-contrast outline-none placeholder:text-text-tertiary disabled:cursor-not-allowed disabled:opacity-50"
/>
</div>
</div>
diff --git a/src/components/features/onboarding/steps/setup-acp-secrets-step.tsx b/src/components/features/onboarding/steps/setup-acp-secrets-step.tsx
index b7b8d91c33..7f8dbb1f76 100644
--- a/src/components/features/onboarding/steps/setup-acp-secrets-step.tsx
+++ b/src/components/features/onboarding/steps/setup-acp-secrets-step.tsx
@@ -140,7 +140,7 @@ export function SetupAcpSecretsStep({
className="flex flex-col gap-6"
>
<header className="flex flex-col gap-2">
- <h2 className="text-2xl font-medium text-white">
+ <h2 className="text-2xl font-medium text-contrast">
{t(I18nKey.ONBOARDING$ACP_SECRETS_TITLE)}
</h2>
<p className="text-sm text-muted">
diff --git a/src/components/features/onboarding/steps/setup-llm-step.tsx b/src/components/features/onboarding/steps/setup-llm-step.tsx
index c08d448518..d3d6528e73 100644
--- a/src/components/features/onboarding/steps/setup-llm-step.tsx
+++ b/src/components/features/onboarding/steps/setup-llm-step.tsx
@@ -143,7 +143,7 @@ export function SetupLlmStep({ onBack, onNext }: SetupLlmStepProps) {
className="flex flex-col gap-6 max-h-[calc(90vh-7rem)]"
>
<header className="flex flex-col gap-2">
- <h2 className="text-2xl font-medium text-white">
+ <h2 className="text-2xl font-medium text-contrast">
{t(I18nKey.ONBOARDING$LLM_TITLE)}
</h2>
<p className="text-sm text-muted">
diff --git a/src/components/features/plugins/plugin-card.tsx b/src/components/features/plugins/plugin-card.tsx
index 1152eca5f8..ff61c1014d 100644
--- a/src/components/features/plugins/plugin-card.tsx
+++ b/src/components/features/plugins/plugin-card.tsx
@@ -61,7 +61,7 @@ export function PluginCard({
<div className="min-w-0 flex-1">
<h3
data-testid={`plugin-name-${plugin.name}`}
- className="truncate text-sm font-semibold text-white"
+ className="truncate text-sm font-semibold text-contrast"
>
{plugin.name}
</h3>
diff --git a/src/components/features/plugins/plugin-detail-modal.tsx b/src/components/features/plugins/plugin-detail-modal.tsx
index 702c33d9ba..b308f291e9 100644
--- a/src/components/features/plugins/plugin-detail-modal.tsx
+++ b/src/components/features/plugins/plugin-detail-modal.tsx
@@ -108,7 +108,7 @@ export function PluginDetailModal({
{plugin.skills?.length ? (
<section className="flex min-w-0 flex-col gap-2">
- <h3 className="text-sm font-medium text-white">
+ <h3 className="text-sm font-medium text-contrast">
{t(I18nKey.SETTINGS$PLUGINS_SKILLS_IN_BUNDLE)}
</h3>
<ul className="flex min-w-0 flex-col gap-2">
@@ -116,11 +116,11 @@ export function PluginDetailModal({
<li
key={skill.name}
data-testid={`plugin-bundled-skill-${skill.name}`}
- className="flex items-start gap-3 rounded-lg border border-border bg-[rgba(255,255,255,0.04)] px-3 py-2.5"
+ className="flex items-start gap-3 rounded-lg border border-border bg-contrast/[0.04] px-3 py-2.5"
>
<SkillIconBadge skillName={skill.name} />
<div className="min-w-0 flex-1">
- <p className="truncate text-sm font-semibold text-white">
+ <p className="truncate text-sm font-semibold text-contrast">
{skill.name}
</p>
{skill.description ? (
diff --git a/src/components/features/plugins/plugin-files-section.tsx b/src/components/features/plugins/plugin-files-section.tsx
index 6051c17326..787a806d8e 100644
--- a/src/components/features/plugins/plugin-files-section.tsx
+++ b/src/components/features/plugins/plugin-files-section.tsx
@@ -41,10 +41,10 @@ export function PluginFilesSection({
data-testid="plugin-files-section"
className="flex min-w-0 flex-col gap-2"
>
- <h3 className="text-sm font-medium text-white">
+ <h3 className="text-sm font-medium text-contrast">
{t(I18nKey.COMMON$FILES)}
</h3>
- <div className="min-w-0 rounded-lg border border-border bg-[rgba(255,255,255,0.04)]">
+ <div className="min-w-0 rounded-lg border border-border bg-contrast/[0.04]">
<div className="max-h-48 overflow-y-auto custom-scrollbar">
<FileTreeView
paths={files}
diff --git a/src/components/features/plugins/plugin-picker-card.tsx b/src/components/features/plugins/plugin-picker-card.tsx
index 981b6e2f19..889b15443d 100644
--- a/src/components/features/plugins/plugin-picker-card.tsx
+++ b/src/components/features/plugins/plugin-picker-card.tsx
@@ -28,7 +28,7 @@ export function PluginPickerCard({
<div className="min-w-0 flex-1">
<h3
data-testid={`plugin-picker-name-${plugin.name}`}
- className="truncate text-sm font-semibold text-white"
+ className="truncate text-sm font-semibold text-contrast"
>
{plugin.name}
</h3>
diff --git a/src/components/features/plugins/plugin-picker-trigger.tsx b/src/components/features/plugins/plugin-picker-trigger.tsx
index 5964064616..1c5259ae5c 100644
--- a/src/components/features/plugins/plugin-picker-trigger.tsx
+++ b/src/components/features/plugins/plugin-picker-trigger.tsx
@@ -30,7 +30,7 @@ export function PluginPickerTrigger({
onClick={onClick}
disabled={disabled}
className={cn(
- "flex flex-row items-center gap-2 rounded-full px-2.5 py-1 text-white",
+ "flex flex-row items-center gap-2 rounded-full px-2.5 py-1 text-contrast",
formControlBorderClassName,
formControlSurfaceClassName,
formControlTransitionClassName,
@@ -48,7 +48,7 @@ export function PluginPickerTrigger({
{count > 0 ? (
<span
data-testid="plugin-picker-count"
- className="inline-flex h-4 min-w-4 items-center justify-center rounded-full bg-white px-1 text-[11px] font-semibold leading-none text-black"
+ className="inline-flex h-4 min-w-4 items-center justify-center rounded-full bg-contrast px-1 text-[11px] font-semibold leading-none text-contrast-foreground"
>
{count}
</span>
diff --git a/src/components/features/plugins/plugin-picker.tsx b/src/components/features/plugins/plugin-picker.tsx
index c6c74f1d83..d12ce3a6fc 100644
--- a/src/components/features/plugins/plugin-picker.tsx
+++ b/src/components/features/plugins/plugin-picker.tsx
@@ -99,7 +99,7 @@ export function PluginPicker({
className={cn(
"relative flex min-w-0 items-center",
"rounded-lg border border-border bg-base-secondary",
- "transition-colors focus-within:border-white/40 focus-within:ring-1 focus-within:ring-white/20",
+ "transition-colors focus-within:border-contrast/40 focus-within:ring-1 focus-within:ring-contrast/20",
)}
>
<Search
@@ -124,7 +124,7 @@ export function PluginPicker({
type="button"
onClick={() => setSearch("")}
aria-label={t(I18nKey.MCP$SEARCH_CLEAR)}
- className="mr-2 cursor-pointer rounded p-1 text-tertiary-alt hover:text-white"
+ className="mr-2 cursor-pointer rounded p-1 text-tertiary-alt hover:text-contrast"
>
<X className="h-4 w-4" aria-hidden />
</button>
diff --git a/src/components/features/plugins/plugins-toolbar.tsx b/src/components/features/plugins/plugins-toolbar.tsx
index c294554a24..4887040083 100644
--- a/src/components/features/plugins/plugins-toolbar.tsx
+++ b/src/components/features/plugins/plugins-toolbar.tsx
@@ -35,7 +35,7 @@ export function PluginsToolbar({
className={cn(
"relative flex flex-1 min-w-0 items-center",
"rounded-lg border border-border bg-base-secondary",
- "focus-within:border-white/40 focus-within:ring-1 focus-within:ring-white/20",
+ "focus-within:border-contrast/40 focus-within:ring-1 focus-within:ring-contrast/20",
"transition-colors",
)}
>
@@ -61,7 +61,7 @@ export function PluginsToolbar({
type="button"
onClick={() => onSearchChange("")}
aria-label={t(I18nKey.MCP$SEARCH_CLEAR)}
- className="mr-2 p-1 rounded text-tertiary-alt hover:text-white cursor-pointer"
+ className="mr-2 p-1 rounded text-tertiary-alt hover:text-contrast cursor-pointer"
>
<X className="h-4 w-4" aria-hidden />
</button>
@@ -82,8 +82,8 @@ export function PluginsToolbar({
className={cn(
"cursor-pointer rounded-md px-3 py-1 text-xs transition-colors",
statusFilter === filter.value
- ? "bg-surface-raised text-white"
- : "text-tertiary-alt hover:text-white",
+ ? "bg-surface-raised text-contrast"
+ : "text-tertiary-alt hover:text-contrast",
)}
>
{t(filter.labelKey)}
diff --git a/src/components/features/settings/acp-credentials-section.tsx b/src/components/features/settings/acp-credentials-section.tsx
index c11075471a..6da74b7bb3 100644
--- a/src/components/features/settings/acp-credentials-section.tsx
+++ b/src/components/features/settings/acp-credentials-section.tsx
@@ -40,7 +40,7 @@ export function AcpCredentialsSection({
return (
<div className="flex flex-col gap-4">
<div className="flex flex-col gap-1">
- <Typography.Text className="text-sm font-medium text-white">
+ <Typography.Text className="text-sm font-medium text-contrast">
{t(I18nKey.SETTINGS$ACP_CREDENTIALS_TITLE)}
</Typography.Text>
<Typography.Text className="text-xs text-[#717888]">
diff --git a/src/components/features/settings/acp-secret-field.tsx b/src/components/features/settings/acp-secret-field.tsx
index 7844aef321..6e87ed0b8d 100644
--- a/src/components/features/settings/acp-secret-field.tsx
+++ b/src/components/features/settings/acp-secret-field.tsx
@@ -40,7 +40,9 @@ export function AcpSecretField({
{field.multiline ? (
<label className="flex flex-col gap-2.5">
<span className="flex items-center gap-2">
- <span className="text-sm font-mono text-white">{field.name}</span>
+ <span className="text-sm font-mono text-contrast">
+ {field.name}
+ </span>
{showOptionalTag && <OptionalTag />}
</span>
<textarea
diff --git a/src/components/features/settings/agent-canvas-update-card.tsx b/src/components/features/settings/agent-canvas-update-card.tsx
index 16cd65f160..02349d5f48 100644
--- a/src/components/features/settings/agent-canvas-update-card.tsx
+++ b/src/components/features/settings/agent-canvas-update-card.tsx
@@ -95,8 +95,8 @@ function UpdateCommandTabs() {
className={cn(
"inline-flex items-center gap-1.5 px-3 pb-2 text-sm font-medium",
selectedTab === tab
- ? "border-b border-white text-white"
- : "text-muted hover:text-white",
+ ? "border-b border-contrast text-contrast"
+ : "text-muted hover:text-contrast",
)}
>
<UpdateCommandTabIcon tab={tab} />
@@ -111,7 +111,7 @@ function UpdateCommandTabs() {
? "agent-canvas-update-command-npm"
: "agent-canvas-update-command-docker"
}
- className="min-w-0 flex-1 overflow-visible whitespace-nowrap font-mono text-sm text-white"
+ className="min-w-0 flex-1 overflow-visible whitespace-nowrap font-mono text-sm text-contrast"
>
{command}
</code>
@@ -125,7 +125,7 @@ function UpdateCommandTabs() {
: I18nKey.SETTINGS$VERSION_COPY_COMMAND,
)}
disabled={copied}
- className="shrink-0 text-muted hover:text-white disabled:hover:text-muted"
+ className="shrink-0 text-muted hover:text-contrast disabled:hover:text-muted"
>
{copied ? (
<Check className="size-4 text-status-success" aria-hidden />
@@ -176,7 +176,7 @@ function AgentCanvasUpdateModal({
<span className="text-text-dim">
{t(I18nKey.SETTINGS$APP_UPDATE_VERSION_LABEL)}
</span>
- <span className="text-white">{AGENT_CANVAS_CLIENT_VERSION}</span>
+ <span className="text-contrast">{AGENT_CANVAS_CLIENT_VERSION}</span>
</div>
</div>
@@ -216,7 +216,7 @@ function AgentCanvasUpdateModal({
href={AGENT_CANVAS_RELEASE_NOTES_URL}
target="_blank"
rel="noopener noreferrer"
- className="inline-flex items-center gap-1.5 whitespace-nowrap font-medium text-white hover:text-[var(--oh-text)]"
+ className="inline-flex items-center gap-1.5 whitespace-nowrap font-medium text-contrast hover:text-[var(--oh-text)]"
>
{t(I18nKey.SETTINGS$VERSION_RELEASE_NOTES)}
<ExternalLink className="size-3.5 shrink-0" aria-hidden />
@@ -233,7 +233,7 @@ function AgentCanvasUpdateModal({
href={AGENT_CANVAS_RELEASE_NOTES_URL}
target="_blank"
rel="noopener noreferrer"
- className="inline-flex items-center gap-1.5 whitespace-nowrap font-medium text-white hover:text-[var(--oh-text)]"
+ className="inline-flex items-center gap-1.5 whitespace-nowrap font-medium text-contrast hover:text-[var(--oh-text)]"
>
{t(I18nKey.SETTINGS$VERSION_RELEASE_NOTES)}
<ExternalLink className="size-3.5 shrink-0" aria-hidden />
@@ -249,7 +249,7 @@ function AgentCanvasUpdateModal({
{updateAvailable ? (
<div className="flex w-full flex-col border-t border-border pt-3">
- <span className="text-sm font-medium text-white">
+ <span className="text-sm font-medium text-contrast">
{t(I18nKey.SETTINGS$APP_UPDATE_HOW_TO_UPDATE)}
</span>
<span className="mt-1 mb-4 text-sm text-text-dim">
@@ -309,7 +309,7 @@ export function AgentCanvasUpdateCard({
className="flex w-full cursor-pointer flex-col gap-1 rounded-md border border-border bg-base-secondary px-3 py-2 text-left hover:bg-surface-raised"
>
<span className="flex w-full items-center gap-2">
- <span className="flex-1 truncate text-sm font-semibold leading-5 text-white">
+ <span className="flex-1 truncate text-sm font-semibold leading-5 text-contrast">
{t(I18nKey.SETTINGS$APP_UPDATE_CARD_TITLE)}
</span>
{comparison !== null && (
@@ -338,7 +338,7 @@ export function AgentCanvasUpdateCard({
<span className="flex items-center gap-1.5 text-xs leading-5 text-muted">
<span>{t(I18nKey.SETTINGS$APP_UPDATE_VERSION_LABEL)}</span>
- <span className="text-white">{AGENT_CANVAS_CLIENT_VERSION}</span>
+ <span className="text-contrast">{AGENT_CANVAS_CLIENT_VERSION}</span>
</span>
</button>
</section>
diff --git a/src/components/features/settings/agent-canvas-version-modal.tsx b/src/components/features/settings/agent-canvas-version-modal.tsx
index cc38e404a7..d8b61f5c94 100644
--- a/src/components/features/settings/agent-canvas-version-modal.tsx
+++ b/src/components/features/settings/agent-canvas-version-modal.tsx
@@ -116,7 +116,7 @@ export function AgentCanvasVersionModal({
aria-hidden
/>
)}
- <h2 className="text-base font-semibold leading-6 text-white">
+ <h2 className="text-base font-semibold leading-6 text-contrast">
{t(
updateAvailable
? I18nKey.SETTINGS$VERSION_UPDATE_AVAILABLE
@@ -141,7 +141,7 @@ export function AgentCanvasVersionModal({
href={AGENT_CANVAS_RELEASE_NOTES_URL}
target="_blank"
rel="noopener noreferrer"
- className="inline-flex items-center gap-1.5 whitespace-nowrap font-medium text-white hover:text-[var(--oh-text)]"
+ className="inline-flex items-center gap-1.5 whitespace-nowrap font-medium text-contrast hover:text-[var(--oh-text)]"
>
{t(I18nKey.SETTINGS$VERSION_RELEASE_NOTES)}
<ExternalLink className="size-4 shrink-0" aria-hidden />
@@ -161,7 +161,7 @@ export function AgentCanvasVersionModal({
href={AGENT_CANVAS_RELEASE_NOTES_URL}
target="_blank"
rel="noopener noreferrer"
- className="inline-flex items-center gap-1.5 font-medium text-white hover:text-[var(--oh-text)]"
+ className="inline-flex items-center gap-1.5 font-medium text-contrast hover:text-[var(--oh-text)]"
>
{t(I18nKey.SETTINGS$VERSION_RELEASE_NOTES)}
<ExternalLink className="size-4 shrink-0" aria-hidden />
@@ -187,8 +187,8 @@ export function AgentCanvasVersionModal({
className={cn(
"inline-flex items-center gap-1.5 px-3 pb-2 text-sm font-medium",
selectedTab === tab
- ? "border-b border-white text-white"
- : "text-muted hover:text-white",
+ ? "border-b border-contrast text-contrast"
+ : "text-muted hover:text-contrast",
)}
>
<UpdateCommandTabIcon tab={tab} />
@@ -197,7 +197,7 @@ export function AgentCanvasVersionModal({
))}
</div>
<div className="flex items-center gap-3 rounded-lg border border-border bg-surface-deep px-4 py-3">
- <code className="min-w-0 flex-1 overflow-visible whitespace-nowrap font-mono text-sm text-white">
+ <code className="min-w-0 flex-1 overflow-visible whitespace-nowrap font-mono text-sm text-contrast">
{command}
</code>
<button
@@ -209,7 +209,7 @@ export function AgentCanvasVersionModal({
: I18nKey.SETTINGS$VERSION_COPY_COMMAND,
)}
disabled={copied}
- className="shrink-0 text-muted hover:text-white disabled:hover:text-muted"
+ className="shrink-0 text-muted hover:text-contrast disabled:hover:text-muted"
>
{copied ? (
<Check className="size-4 text-status-success" aria-hidden />
@@ -226,7 +226,7 @@ export function AgentCanvasVersionModal({
<button
type="button"
onClick={onCheckForUpdates}
- className="inline-flex items-center gap-2 text-sm font-medium text-white hover:text-[var(--oh-text)] disabled:cursor-wait disabled:text-muted"
+ className="inline-flex items-center gap-2 text-sm font-medium text-contrast hover:text-[var(--oh-text)] disabled:cursor-wait disabled:text-muted"
disabled={isChecking}
>
{t(I18nKey.SETTINGS$VERSION_CHECK_FOR_UPDATES)}
diff --git a/src/components/features/settings/agent-canvas-version-tile.tsx b/src/components/features/settings/agent-canvas-version-tile.tsx
index 57b4e33adc..1955c5a789 100644
--- a/src/components/features/settings/agent-canvas-version-tile.tsx
+++ b/src/components/features/settings/agent-canvas-version-tile.tsx
@@ -56,7 +56,7 @@ export function AgentCanvasVersionTile({
)}
>
<span className="min-w-0 flex-1">
- <span className="block truncate text-sm font-semibold leading-5 text-white">
+ <span className="block truncate text-sm font-semibold leading-5 text-contrast">
{updateAvailable
? t(I18nKey.SETTINGS$VERSION_TILE_NEW_VERSION)
: t(I18nKey.SETTINGS$VERSION_PRODUCT_NAME)}
@@ -65,7 +65,7 @@ export function AgentCanvasVersionTile({
<span className="text-muted">
{t(I18nKey.SETTINGS$APP_UPDATE_VERSION_LABEL)}
</span>
- <span className="truncate text-white">
+ <span className="truncate text-contrast">
{updateAvailable && latestVersion
? latestVersion
: installedVersion}
diff --git a/src/components/features/settings/agent-profiles/agent-profile-row.tsx b/src/components/features/settings/agent-profiles/agent-profile-row.tsx
index 503de41039..cbcfdc31a7 100644
--- a/src/components/features/settings/agent-profiles/agent-profile-row.tsx
+++ b/src/components/features/settings/agent-profiles/agent-profile-row.tsx
@@ -48,7 +48,7 @@ export function AgentProfileRow({
>
<div className="flex min-w-0 flex-1 items-center gap-3">
<span
- className="min-w-0 max-w-full truncate text-sm font-medium text-white"
+ className="min-w-0 max-w-full truncate text-sm font-medium text-contrast"
title={profile.name}
>
{profile.name}
diff --git a/src/components/features/settings/agent-profiles/agent-profiles-manager.tsx b/src/components/features/settings/agent-profiles/agent-profiles-manager.tsx
index 70d211c285..304dfd077b 100644
--- a/src/components/features/settings/agent-profiles/agent-profiles-manager.tsx
+++ b/src/components/features/settings/agent-profiles/agent-profiles-manager.tsx
@@ -49,7 +49,7 @@ export function AgentProfilesManager({
<>
<div className="flex flex-col gap-4">
<div className="flex flex-wrap items-center justify-between gap-3">
- <h2 className="text-base font-medium text-white">
+ <h2 className="text-base font-medium text-contrast">
{t(I18nKey.SETTINGS$AVAILABLE_PROFILES)}
</h2>
{onAddProfile && canManage ? (
diff --git a/src/components/features/settings/app-settings/theme-input.tsx b/src/components/features/settings/app-settings/theme-input.tsx
index 9ecaa05752..0663af9747 100644
--- a/src/components/features/settings/app-settings/theme-input.tsx
+++ b/src/components/features/settings/app-settings/theme-input.tsx
@@ -5,9 +5,8 @@ import { SettingsDropdownInput } from "../settings-dropdown-input";
import {
AVAILABLE_COLOR_THEMES,
type ColorThemeKey,
- applyColorTheme,
- persistColorTheme,
readPersistedColorTheme,
+ setColorTheme,
} from "#/themes/color-themes";
export function ThemeInput() {
@@ -16,8 +15,7 @@ export function ThemeInput() {
const handleSelectionChange = React.useCallback((key: React.Key | null) => {
if (!key) return;
const next = key as ColorThemeKey;
- applyColorTheme(next);
- persistColorTheme(next);
+ setColorTheme(next);
}, []);
return (
diff --git a/src/components/features/settings/brand-button.tsx b/src/components/features/settings/brand-button.tsx
index 4677013964..768f7ed143 100644
--- a/src/components/features/settings/brand-button.tsx
+++ b/src/components/features/settings/brand-button.tsx
@@ -57,11 +57,11 @@ export const BrandButton = forwardRef<
className={cn(
formControlButtonClassName,
variant === "primary" &&
- "bg-primary text-on-primary hover:opacity-80 disabled:bg-interactive-hover disabled:text-muted disabled:opacity-100",
+ "bg-primary text-[var(--oh-accent-foreground)] hover:opacity-80 disabled:bg-interactive-hover disabled:text-muted disabled:opacity-100",
variant === "secondary" &&
- "border border-border bg-base-secondary text-white hover:bg-surface-raised",
+ "border border-border bg-base-secondary text-contrast hover:bg-surface-raised",
variant === "tertiary" &&
- "bg-interactive-hover text-white hover:opacity-80",
+ "bg-interactive-hover text-contrast hover:opacity-80",
variant === "danger" && "bg-red-600 text-white hover:bg-red-700",
variant === "ghost-danger" &&
"h-auto min-h-0 bg-transparent px-0 text-red-600 underline hover:text-red-700 hover:no-underline font-normal",
diff --git a/src/components/features/settings/llm-profiles/llm-profiles-manager.tsx b/src/components/features/settings/llm-profiles/llm-profiles-manager.tsx
index f60ef5ca9b..72d2fce1bf 100644
--- a/src/components/features/settings/llm-profiles/llm-profiles-manager.tsx
+++ b/src/components/features/settings/llm-profiles/llm-profiles-manager.tsx
@@ -126,7 +126,7 @@ export function LlmProfilesManager({
<div className="flex flex-col gap-8">
<div className="flex flex-col gap-4">
<div className="flex flex-wrap items-center justify-between gap-3">
- <h2 className="text-base font-medium text-white">
+ <h2 className="text-base font-medium text-contrast">
{t(I18nKey.SETTINGS$AVAILABLE_PROFILES)}
</h2>
{onAddProfile && canManage ? (
diff --git a/src/components/features/settings/llm-profiles/profile-row.tsx b/src/components/features/settings/llm-profiles/profile-row.tsx
index 2ec867ae44..89b6cd0506 100644
--- a/src/components/features/settings/llm-profiles/profile-row.tsx
+++ b/src/components/features/settings/llm-profiles/profile-row.tsx
@@ -51,7 +51,7 @@ export function ProfileRow({
>
<div className="flex min-w-0 flex-1 items-center gap-3">
<span
- className="min-w-0 max-w-full truncate text-sm font-medium text-white"
+ className="min-w-0 max-w-full truncate text-sm font-medium text-contrast"
title={profile.name}
>
{profile.name}
diff --git a/src/components/features/settings/llm-profiles/provider-connection-row.tsx b/src/components/features/settings/llm-profiles/provider-connection-row.tsx
index 9b27525954..808eaaae8a 100644
--- a/src/components/features/settings/llm-profiles/provider-connection-row.tsx
+++ b/src/components/features/settings/llm-profiles/provider-connection-row.tsx
@@ -33,7 +33,7 @@ export function ProviderConnectionRow({
>
<div className="flex min-w-0 flex-1 items-center gap-3">
<span
- className="min-w-0 max-w-full truncate text-sm font-medium text-white"
+ className="min-w-0 max-w-full truncate text-sm font-medium text-contrast"
title={connection.display_name}
>
{connection.display_name}
diff --git a/src/components/features/settings/llm-profiles/provider-connections-manager.tsx b/src/components/features/settings/llm-profiles/provider-connections-manager.tsx
index c024aa1ed3..f1d3e05093 100644
--- a/src/components/features/settings/llm-profiles/provider-connections-manager.tsx
+++ b/src/components/features/settings/llm-profiles/provider-connections-manager.tsx
@@ -93,7 +93,7 @@ export function ProviderConnectionsManager({
<div className="flex flex-col gap-4">
<div className="flex flex-wrap items-center justify-between gap-3">
<div className="flex flex-col gap-1">
- <h2 className="text-base font-medium text-white">
+ <h2 className="text-base font-medium text-contrast">
{t(I18nKey.SETTINGS$PROVIDER_CONNECTIONS_TITLE)}
</h2>
<p className="text-sm text-muted">
diff --git a/src/components/features/settings/llm-settings/openai-subscription-auth-card.tsx b/src/components/features/settings/llm-settings/openai-subscription-auth-card.tsx
index a28670c207..842fcd71e0 100644
--- a/src/components/features/settings/llm-settings/openai-subscription-auth-card.tsx
+++ b/src/components/features/settings/llm-settings/openai-subscription-auth-card.tsx
@@ -201,7 +201,7 @@ export function OpenAISubscriptionAuthCard({
className="flex flex-col gap-2 rounded-lg border border-border-subtle p-3 text-sm"
>
<span>{t(I18nKey.SETTINGS$SUBSCRIPTION_DEVICE_INSTRUCTIONS)}</span>
- <div className="flex items-center gap-2 rounded-lg bg-surface-deep px-3 py-2 font-mono text-base font-semibold text-white">
+ <div className="flex items-center gap-2 rounded-lg bg-surface-deep px-3 py-2 font-mono text-base font-semibold text-contrast">
<span
data-testid="subscription-user-code"
className="flex-1 select-all tracking-[0.08em]"
diff --git a/src/components/features/settings/sdk-settings/view-toggle.tsx b/src/components/features/settings/sdk-settings/view-toggle.tsx
index d2419fd347..b0dc97a40a 100644
--- a/src/components/features/settings/sdk-settings/view-toggle.tsx
+++ b/src/components/features/settings/sdk-settings/view-toggle.tsx
@@ -20,8 +20,8 @@ const tabButtonClass = (isActive: boolean, isDisabled: boolean) =>
formControlTransitionClassName,
"border-b-2 pb-2",
isActive
- ? "text-white border-white"
- : "text-muted border-transparent hover:text-white",
+ ? "text-contrast border-contrast"
+ : "text-muted border-transparent hover:text-contrast",
isDisabled && "pointer-events-none opacity-30 cursor-not-allowed",
);
diff --git a/src/components/features/settings/settings-desktop-sidebar.tsx b/src/components/features/settings/settings-desktop-sidebar.tsx
index aafe253244..f715889f71 100644
--- a/src/components/features/settings/settings-desktop-sidebar.tsx
+++ b/src/components/features/settings/settings-desktop-sidebar.tsx
@@ -35,7 +35,7 @@ export function SettingsDesktopSidebar({
"md:sticky md:top-8 md:self-start md:pl-8",
)}
>
- <Typography.Text className="px-2 text-sm font-normal text-white">
+ <Typography.Text className="px-2 text-sm font-normal text-contrast">
{t(I18nKey.SETTINGS$TITLE)}
</Typography.Text>
<div className="flex flex-col gap-0.5 pt-0.5">
diff --git a/src/components/features/settings/settings-nav-link.tsx b/src/components/features/settings/settings-nav-link.tsx
index 514ebee395..56d7ed4ec5 100644
--- a/src/components/features/settings/settings-nav-link.tsx
+++ b/src/components/features/settings/settings-nav-link.tsx
@@ -25,17 +25,17 @@ export function SettingsNavLink({ item, onClick }: SettingsNavLinkProps) {
"group flex items-center gap-3 p-1 sm:px-3.5 sm:py-2 rounded",
navInteractiveTransitionClassName,
isActive ? "bg-tertiary" : "hover:bg-surface-raised",
- isActive ? "[&_*]:text-white" : "",
+ isActive ? "[&_*]:text-contrast" : "",
)
}
>
- <Typography.Text className="flex h-5 w-5 shrink-0 items-center justify-center text-muted group-hover:text-white">
+ <Typography.Text className="flex h-5 w-5 shrink-0 items-center justify-center text-muted group-hover:text-contrast">
{icon}
</Typography.Text>
<div className="min-w-0 flex-1 overflow-hidden">
<Typography.Text
className={cn(
- "block truncate whitespace-nowrap text-muted group-hover:text-white",
+ "block truncate whitespace-nowrap text-muted group-hover:text-contrast",
"transition-transform duration-300 motion-reduce:transition-none group-hover:translate-x-1",
)}
>
diff --git a/src/components/features/settings/upgrade-button.tsx b/src/components/features/settings/upgrade-button.tsx
index bfaec6db67..33084b985f 100644
--- a/src/components/features/settings/upgrade-button.tsx
+++ b/src/components/features/settings/upgrade-button.tsx
@@ -21,7 +21,7 @@ export function UpgradeButton({
onClick={onClick}
disabled={isDisabled}
className={cn(
- "bg-interactive-selected text-white text-[9px] font-normal w-16 h-4 rounded-[100px] mix-blend-multiply hover:opacity-80 transition-opacity cursor-pointer",
+ "bg-interactive-selected text-contrast text-[9px] font-normal w-16 h-4 rounded-[100px] mix-blend-multiply hover:opacity-80 transition-opacity cursor-pointer",
className,
)}
>
diff --git a/src/components/features/sidebar/sidebar-layout.ts b/src/components/features/sidebar/sidebar-layout.ts
index 249fbe6993..b1bd4d0649 100644
--- a/src/components/features/sidebar/sidebar-layout.ts
+++ b/src/components/features/sidebar/sidebar-layout.ts
@@ -23,8 +23,8 @@ export function sidebarHeaderRowClassName(collapsed: boolean): string {
}
export const SIDEBAR_ROW_INTERACTIVE_CLASS = {
- active: "bg-tertiary text-white font-normal",
- idle: "text-muted hover:text-white hover:bg-surface-raised",
+ active: "bg-tertiary text-contrast font-normal",
+ idle: "text-muted hover:text-contrast hover:bg-surface-raised",
} as const;
export function sidebarNavListClassName(collapsed: boolean): string {
@@ -64,7 +64,9 @@ export function sidebarCollapsedIconGlyphClassName(active: boolean): string {
// Full width inside the 36px-tall slot; `pl-2.5` aligns with expanded `px-2.5` rows.
// Do not set a narrow `w-4.5` here β€” with horizontal padding it shrinks the glyph.
"relative z-[1] flex h-full w-full items-center justify-start pl-2.5 [&_svg]:shrink-0",
- active ? "text-white font-normal" : "text-muted group-hover:text-white",
+ active
+ ? "text-contrast font-normal"
+ : "text-muted group-hover:text-contrast",
);
}
@@ -92,5 +94,5 @@ export const SIDEBAR_COLLAPSE_TOGGLE_OVERLAY_CLASS = cn(
"items-center justify-center rounded-md",
navInteractiveTransitionClassName,
"cursor-pointer",
- "text-muted hover:text-white hover:bg-surface-raised",
+ "text-muted hover:text-contrast hover:bg-surface-raised",
);
diff --git a/src/components/features/sidebar/sidebar-nav-link.tsx b/src/components/features/sidebar/sidebar-nav-link.tsx
index c101f8ff65..2749ed8c55 100644
--- a/src/components/features/sidebar/sidebar-nav-link.tsx
+++ b/src/components/features/sidebar/sidebar-nav-link.tsx
@@ -134,7 +134,7 @@ export function SidebarNavLink({
className={cn(
"absolute right-1.5 top-1/2 -translate-y-1/2",
"flex shrink-0 cursor-pointer items-center justify-center rounded-md p-1",
- "text-muted hover:bg-white/10 hover:text-white",
+ "text-muted hover:bg-contrast/10 hover:text-contrast",
hoverRevealActionClassName(pinAction.pinned),
)}
>
@@ -151,7 +151,9 @@ export function SidebarNavLink({
<StyledTooltip
content={hoverContent ?? label}
placement="right"
- tooltipClassName={hoverContent ? "p-0 bg-tertiary text-white" : undefined}
+ tooltipClassName={
+ hoverContent ? "p-0 bg-tertiary text-contrast" : undefined
+ }
>
{link}
</StyledTooltip>
diff --git a/src/components/features/sidebar/sidebar-onboarding-checklist-item-icon.tsx b/src/components/features/sidebar/sidebar-onboarding-checklist-item-icon.tsx
index 432c258229..9927c8485e 100644
--- a/src/components/features/sidebar/sidebar-onboarding-checklist-item-icon.tsx
+++ b/src/components/features/sidebar/sidebar-onboarding-checklist-item-icon.tsx
@@ -47,7 +47,7 @@ export function SidebarOnboardingChecklistItemIcon({
id,
className,
}: SidebarOnboardingChecklistItemIconProps) {
- const iconClassName = cn("shrink-0 text-white", className);
+ const iconClassName = cn("shrink-0 text-contrast", className);
const testId = `sidebar-onboarding-checklist-icon-${id}`;
switch (id) {
diff --git a/src/components/features/sidebar/sidebar-onboarding-checklist-item-preview.tsx b/src/components/features/sidebar/sidebar-onboarding-checklist-item-preview.tsx
index b19b3bf7b3..9fc87009b5 100644
--- a/src/components/features/sidebar/sidebar-onboarding-checklist-item-preview.tsx
+++ b/src/components/features/sidebar/sidebar-onboarding-checklist-item-preview.tsx
@@ -14,8 +14,8 @@ import {
import { SidebarOnboardingChecklistItemIcon } from "./sidebar-onboarding-checklist-item-icon";
const PREVIEW_ACTION_BUTTON_CLASS = cn(
- "inline-flex shrink-0 items-center rounded-md bg-white px-2.5 py-1",
- "text-xs font-medium text-black transition-colors hover:bg-white/90",
+ "inline-flex shrink-0 items-center rounded-md bg-contrast px-2.5 py-1",
+ "text-xs font-medium text-contrast-foreground transition-colors hover:bg-contrast/90",
);
interface SidebarOnboardingChecklistItemPreviewProps {
@@ -45,7 +45,7 @@ export function SidebarOnboardingChecklistItemPreview({
<span className="mt-0.5 inline-flex shrink-0 items-center justify-center">
<SidebarOnboardingChecklistItemIcon id={id} />
</span>
- <span className="min-w-0 flex-1 text-sm font-medium text-white">
+ <span className="min-w-0 flex-1 text-sm font-medium text-contrast">
{t(titleKey)}
</span>
</div>
@@ -56,7 +56,7 @@ export function SidebarOnboardingChecklistItemPreview({
target="_blank"
rel="noreferrer"
data-testid={`sidebar-onboarding-checklist-preview-docs-${id}`}
- className="inline-flex min-w-0 items-center gap-2 text-xs text-muted transition-colors hover:text-white hover:underline"
+ className="inline-flex min-w-0 items-center gap-2 text-xs text-muted transition-colors hover:text-contrast hover:underline"
onClick={onDocsClick}
>
<BookOpen className="size-3.5 shrink-0" aria-hidden />
diff --git a/src/components/features/sidebar/sidebar-onboarding-checklist.tsx b/src/components/features/sidebar/sidebar-onboarding-checklist.tsx
index b345227076..7ec5d84f1d 100644
--- a/src/components/features/sidebar/sidebar-onboarding-checklist.tsx
+++ b/src/components/features/sidebar/sidebar-onboarding-checklist.tsx
@@ -17,7 +17,7 @@ import { SidebarOnboardingChecklistItemPreview } from "./sidebar-onboarding-chec
import { useSidebarOnboardingChecklist } from "./use-sidebar-onboarding-checklist";
const CHECKLIST_ITEM_TOOLTIP_CLASS =
- "rounded-xl border border-border bg-base-secondary p-0 text-white shadow-xl";
+ "rounded-xl border border-border bg-base-secondary p-0 text-contrast shadow-xl";
const CHECKLIST_ITEM_CLASS = cn(
"flex min-w-0 w-full items-center gap-2.5 rounded-md px-2.5 py-1.5 text-sm",
diff --git a/src/components/features/sidebar/sidebar-rail-body.tsx b/src/components/features/sidebar/sidebar-rail-body.tsx
index d30796e9c2..0b68b70d4b 100644
--- a/src/components/features/sidebar/sidebar-rail-body.tsx
+++ b/src/components/features/sidebar/sidebar-rail-body.tsx
@@ -178,7 +178,7 @@ export function SidebarRailBody({
className={cn(
"hidden md:inline-flex ml-auto",
SIDEBAR_ICON_BUTTON_CLASS,
- "text-muted hover:text-white hover:bg-surface-raised",
+ "text-muted hover:text-contrast hover:bg-surface-raised",
)}
>
<ChevronLeft width={14} height={14} />
@@ -193,7 +193,7 @@ export function SidebarRailBody({
className={cn(
"inline-flex ml-auto",
SIDEBAR_ICON_BUTTON_CLASS,
- "text-muted hover:text-white hover:bg-surface-raised",
+ "text-muted hover:text-contrast hover:bg-surface-raised",
)}
>
<ChevronLeft width={14} height={14} />
diff --git a/src/components/features/skills/add-skill-modal.tsx b/src/components/features/skills/add-skill-modal.tsx
index 7d5011a014..b250326713 100644
--- a/src/components/features/skills/add-skill-modal.tsx
+++ b/src/components/features/skills/add-skill-modal.tsx
@@ -36,7 +36,7 @@ function InlineCodeChip({ children }: { children?: React.ReactNode }) {
<code
className={cn(
"mx-0.5 inline-block rounded-sm border border-border-subtle",
- "bg-surface-raised px-1.5 py-0.5 align-baseline font-mono text-[11px] text-white",
+ "bg-surface-raised px-1.5 py-0.5 align-baseline font-mono text-[11px] text-contrast",
)}
>
{children}
@@ -65,7 +65,7 @@ function AddSkillExampleBlock() {
data-testid="add-skill-modal-example"
className={cn(
"overflow-x-auto rounded-sm border border-border-subtle",
- "bg-surface-raised p-2 pr-10 text-xs text-white",
+ "bg-surface-raised p-2 pr-10 text-xs text-contrast",
)}
>
{ADD_SKILL_EXAMPLE_COMMAND}
@@ -79,7 +79,7 @@ function AddSkillExampleBlock() {
className={cn(
"absolute right-2 top-2 cursor-pointer rounded-sm border border-border-subtle",
"bg-base-secondary p-1 text-tertiary-alt transition-colors",
- "hover:bg-surface hover:text-white disabled:cursor-default [&_path]:fill-current",
+ "hover:bg-surface hover:text-contrast disabled:cursor-default [&_path]:fill-current",
)}
>
{copied ? (
@@ -189,7 +189,7 @@ export function AddSkillModal({ onClose }: AddSkillModalProps) {
target="_blank"
rel="noreferrer"
data-testid="add-skill-modal-docs-link"
- className="self-start text-xs text-muted transition-colors hover:text-white hover:underline"
+ className="self-start text-xs text-muted transition-colors hover:text-contrast hover:underline"
>
{t(I18nKey.SETTINGS$SKILLS_ADD_MODAL_VIEW_DOCS)}
</a>
diff --git a/src/components/features/skills/extensions-navigation.tsx b/src/components/features/skills/extensions-navigation.tsx
index 3b5ee7b2ea..86a3241cd9 100644
--- a/src/components/features/skills/extensions-navigation.tsx
+++ b/src/components/features/skills/extensions-navigation.tsx
@@ -81,7 +81,7 @@ export function ExtensionsNavigation() {
data-testid="extensions-navbar-desktop"
className="hidden md:flex md:w-65 md:shrink-0 md:flex-col md:gap-2 md:sticky md:top-8 md:self-start"
>
- <span className="px-2 text-sm font-normal text-white">
+ <span className="px-2 text-sm font-normal text-contrast">
{t(I18nKey.NAV$CUSTOMIZE)}
</span>
<div className="flex flex-col gap-0.5 pt-0.5">
@@ -104,7 +104,7 @@ export function ExtensionsNavigation() {
</span>
);
const comingSoonBadge = item.comingSoon && (
- <span className="ml-auto shrink-0 rounded-full border border-white/20 bg-white/5 px-1.5 py-0.5 text-[10px] font-medium text-text-dim">
+ <span className="ml-auto shrink-0 rounded-full border border-contrast/20 bg-contrast/5 px-1.5 py-0.5 text-[10px] font-medium text-text-dim">
{t(I18nKey.NAV$COMING_SOON)}
</span>
);
diff --git a/src/components/features/skills/skill-card-pill-row.tsx b/src/components/features/skills/skill-card-pill-row.tsx
index f1e92de69f..410f4b85c7 100644
--- a/src/components/features/skills/skill-card-pill-row.tsx
+++ b/src/components/features/skills/skill-card-pill-row.tsx
@@ -222,7 +222,7 @@ export function SkillCardPillRow({ pills, testId }: SkillCardPillRowProps) {
onKeyDown={stopCardActivation}
className={cn(
extensionModuleCardPillClassName,
- "cursor-pointer font-medium text-tertiary-alt hover:text-white",
+ "cursor-pointer font-medium text-tertiary-alt hover:text-contrast",
)}
>
{t(I18nKey.SETTINGS$SKILLS_PILLS_MORE, { count: hiddenCount })}
diff --git a/src/components/features/skills/skill-card.tsx b/src/components/features/skills/skill-card.tsx
index 45282ae3cb..2a692092a5 100644
--- a/src/components/features/skills/skill-card.tsx
+++ b/src/components/features/skills/skill-card.tsx
@@ -82,7 +82,7 @@ export function SkillCard({
<div className="min-w-0 flex-1">
<h3
data-testid={`skill-name-${skill.name}`}
- className="truncate text-sm font-semibold text-white"
+ className="truncate text-sm font-semibold text-contrast"
>
{skill.name}
</h3>
@@ -106,7 +106,7 @@ export function SkillCard({
)}
disabled={sourceCopied}
onClick={handleCopySource}
- className="shrink-0 cursor-pointer border-0 bg-transparent p-0.5 text-tertiary-alt hover:text-white disabled:cursor-default [&_path]:fill-current"
+ className="shrink-0 cursor-pointer border-0 bg-transparent p-0.5 text-tertiary-alt hover:text-contrast disabled:cursor-default [&_path]:fill-current"
>
{sourceCopied ? (
<CheckmarkIcon width={12} height={12} />
diff --git a/src/components/features/skills/skill-detail-modal.tsx b/src/components/features/skills/skill-detail-modal.tsx
index ee46099e34..ffe54c7fe8 100644
--- a/src/components/features/skills/skill-detail-modal.tsx
+++ b/src/components/features/skills/skill-detail-modal.tsx
@@ -132,7 +132,7 @@ export function SkillDetailModal({
)}
disabled={sourceCopied}
onClick={handleCopySource}
- className="shrink-0 cursor-pointer border-0 bg-transparent p-0.5 text-tertiary-alt hover:text-white disabled:cursor-default [&_path]:fill-current"
+ className="shrink-0 cursor-pointer border-0 bg-transparent p-0.5 text-tertiary-alt hover:text-contrast disabled:cursor-default [&_path]:fill-current"
>
{sourceCopied ? (
<CheckmarkIcon width={12} height={12} />
@@ -152,7 +152,7 @@ export function SkillDetailModal({
>
<div
data-testid={`skill-modal-enable-row-${skill.name}`}
- className="flex w-full items-center rounded-lg border border-border bg-[rgba(255,255,255,0.04)] px-3 py-2.5"
+ className="flex w-full items-center rounded-lg border border-border bg-contrast/[0.04] px-3 py-2.5"
>
<SettingsSwitch
testId={`skill-modal-toggle-${skill.name}`}
diff --git a/src/components/features/skills/skill-facet-row.tsx b/src/components/features/skills/skill-facet-row.tsx
index c82c68d5b6..8cda9b80ad 100644
--- a/src/components/features/skills/skill-facet-row.tsx
+++ b/src/components/features/skills/skill-facet-row.tsx
@@ -39,15 +39,17 @@ export function SkillFacetRow({
? "cursor-default text-tertiary-alt/40"
: // Same hover pair as the extensions nav links: a raised surface the
// label brightens against, rather than a light fill it sinks into.
- "cursor-pointer hover:bg-surface-raised hover:text-white",
- checked ? "text-white" : "text-tertiary-light",
+ "cursor-pointer hover:bg-surface-raised hover:text-contrast",
+ checked ? "text-contrast" : "text-tertiary-light",
)}
>
<span
aria-hidden
className={cn(
"flex size-3.5 shrink-0 items-center justify-center rounded-[3px] border",
- checked ? "border-white bg-white text-black" : "border-border",
+ checked
+ ? "border-contrast bg-contrast text-contrast-foreground"
+ : "border-border",
)}
>
{checked ? <Check className="size-2.5" strokeWidth={3} /> : null}
diff --git a/src/components/features/skills/skill-icon-badge.tsx b/src/components/features/skills/skill-icon-badge.tsx
index 0291bd7f46..e2f31e6ee7 100644
--- a/src/components/features/skills/skill-icon-badge.tsx
+++ b/src/components/features/skills/skill-icon-badge.tsx
@@ -14,8 +14,8 @@ export function SkillIconBadge({ skillName, className }: SkillIconBadgeProps) {
data-testid={`skill-icon-${skillName}`}
className={cn(
"inline-flex h-10 w-10 shrink-0 items-center justify-center overflow-hidden",
- "rounded-lg border border-white/10 bg-surface-raised text-white",
- "shadow-[inset_0_1px_0_rgba(255,255,255,0.18)]",
+ "rounded-lg border border-contrast/10 bg-surface-raised text-contrast",
+ "shadow-[inset_0_1px_0_color-mix(in_srgb,var(--oh-contrast)_18%,transparent)]",
"[&>svg]:h-5 [&>svg]:w-5",
className,
)}
diff --git a/src/components/features/skills/skills-toolbar.tsx b/src/components/features/skills/skills-toolbar.tsx
index d17c6c064f..dcbdadf800 100644
--- a/src/components/features/skills/skills-toolbar.tsx
+++ b/src/components/features/skills/skills-toolbar.tsx
@@ -24,7 +24,7 @@ export function SkillsToolbar({
className={cn(
"relative flex flex-1 min-w-0 items-center",
"rounded-lg border border-border bg-base-secondary",
- "focus-within:border-white/40 focus-within:ring-1 focus-within:ring-white/20",
+ "focus-within:border-contrast/40 focus-within:ring-1 focus-within:ring-contrast/20",
"transition-colors",
)}
>
@@ -50,7 +50,7 @@ export function SkillsToolbar({
type="button"
onClick={() => onSearchChange("")}
aria-label={t(I18nKey.MCP$SEARCH_CLEAR)}
- className="mr-2 p-1 rounded text-tertiary-alt hover:text-white cursor-pointer"
+ className="mr-2 p-1 rounded text-tertiary-alt hover:text-contrast cursor-pointer"
>
<X className="h-4 w-4" aria-hidden />
</button>
@@ -64,14 +64,14 @@ export function SkillsToolbar({
onClick={onOpenFilters}
className={cn(
"flex shrink-0 items-center gap-2 rounded-lg px-3 py-2 text-sm md:hidden",
- "border border-border bg-base-secondary text-white",
+ "border border-border bg-base-secondary text-contrast",
"cursor-pointer hover:bg-interactive-hover",
)}
>
<ListFilter className="size-4 shrink-0" aria-hidden />
{t(I18nKey.SETTINGS$SKILLS_FILTERS_BUTTON)}
{activeFilterCount > 0 ? (
- <span className="rounded-full bg-white px-1.5 text-[11px] font-medium text-black">
+ <span className="rounded-full bg-contrast px-1.5 text-[11px] font-medium text-contrast-foreground">
{activeFilterCount}
</span>
) : null}
diff --git a/src/components/features/suggestions/suggestion-item.tsx b/src/components/features/suggestions/suggestion-item.tsx
index 6d9e64411a..450340cb8e 100644
--- a/src/components/features/suggestions/suggestion-item.tsx
+++ b/src/components/features/suggestions/suggestion-item.tsx
@@ -40,7 +40,7 @@ export function SuggestionItem({ suggestion, onClick }: SuggestionItemProps) {
{itemIcon}
<span
data-testid="suggestion"
- className="text-[15px] font-normal leading-5 text-white text-center cursor-pointer"
+ className="text-[15px] font-normal leading-5 text-contrast text-center cursor-pointer"
>
{t(suggestion.label)}
</span>
diff --git a/src/components/providers/agent-server-ui-root.tsx b/src/components/providers/agent-server-ui-root.tsx
index d31727a0dc..fe185f2cbd 100644
--- a/src/components/providers/agent-server-ui-root.tsx
+++ b/src/components/providers/agent-server-ui-root.tsx
@@ -1,11 +1,11 @@
import React from "react";
import { cn } from "#/utils/utils";
import {
- AGENT_SERVER_UI_DEFAULT_CSS_VARIABLES,
- AGENT_SERVER_UI_DEFAULT_THEME,
type AgentServerUIStyleOverrides,
type AgentServerUITheme,
} from "#/styles/agent-server-ui-style-scope";
+import { useColorTheme } from "#/hooks/use-color-theme";
+import { COLOR_THEMES } from "#/themes/color-themes";
export interface AgentServerUIRootProps extends Omit<
React.HTMLAttributes<HTMLDivElement>,
@@ -20,17 +20,18 @@ export interface AgentServerUIRootProps extends Omit<
export function AgentServerUIRoot({
children,
- theme = AGENT_SERVER_UI_DEFAULT_THEME,
+ theme,
className,
style,
styleOverrides,
contentClassName,
...divProps
}: AgentServerUIRootProps) {
+ const colorTheme = useColorTheme();
+ const appearance = theme ?? COLOR_THEMES[colorTheme].appearance;
const scopedStyle = React.useMemo(
() =>
({
- ...AGENT_SERVER_UI_DEFAULT_CSS_VARIABLES,
...styleOverrides,
...style,
}) as React.CSSProperties,
@@ -40,14 +41,16 @@ export function AgentServerUIRoot({
return (
<div
data-agent-server-ui=""
+ data-color-theme={colorTheme}
+ data-color-scheme={appearance}
{...divProps}
className={className}
- // CSS custom properties injected onto the scope root so descendants can resolve var(--oh-*)
+ // Only consumer overrides are inline; theme defaults belong to CSS.
style={scopedStyle}
>
<div
- className={cn(theme, contentClassName, "text-foreground")}
- data-theme={theme}
+ className={cn(appearance, contentClassName, "text-foreground")}
+ data-theme={appearance}
>
{children}
</div>
diff --git a/src/components/shared/action-tooltip.tsx b/src/components/shared/action-tooltip.tsx
index a72413284f..e380480ff6 100644
--- a/src/components/shared/action-tooltip.tsx
+++ b/src/components/shared/action-tooltip.tsx
@@ -33,7 +33,9 @@ export function ActionTooltip({ type, onClick }: ActionTooltipProps) {
aria-label={ariaLabel}
className={cn(
"rounded px-2 h-6.5 text-sm font-normal leading-5 cursor-pointer hover:opacity-80",
- type === "confirm" ? "bg-tertiary text-white" : "bg-white text-base",
+ type === "confirm"
+ ? "bg-tertiary text-contrast"
+ : "bg-contrast text-base",
)}
onClick={onClick}
>
diff --git a/src/components/shared/badge.tsx b/src/components/shared/badge.tsx
index 8c915b8c79..1799b50103 100644
--- a/src/components/shared/badge.tsx
+++ b/src/components/shared/badge.tsx
@@ -8,7 +8,7 @@ export function BrandBadge({
return (
<span
className={cn(
- "text-sm leading-4 text-black font-semibold tracking-tighter bg-primary p-1 rounded-full",
+ "text-sm leading-4 text-[var(--oh-accent-foreground)] font-semibold tracking-tighter bg-primary p-1 rounded-full",
className,
)}
{...rest}
diff --git a/src/components/shared/buttons/circle-plus-check-toggle.tsx b/src/components/shared/buttons/circle-plus-check-toggle.tsx
index 5d037a3428..58dccbc86f 100644
--- a/src/components/shared/buttons/circle-plus-check-toggle.tsx
+++ b/src/components/shared/buttons/circle-plus-check-toggle.tsx
@@ -37,7 +37,7 @@ export function CirclePlusBadge({
aria-hidden="true"
data-testid={testId}
className={cn(
- "inline-flex size-7 shrink-0 items-center justify-center rounded-full bg-surface-raised text-white transition-colors hover:bg-interactive-hover",
+ "inline-flex size-7 shrink-0 items-center justify-center rounded-full bg-surface-raised text-contrast transition-colors hover:bg-interactive-hover",
className,
)}
>
@@ -94,9 +94,9 @@ export function CirclePlusCheckToggle({
isSelected &&
(showRemoveIcon
? "border-0 bg-[rgba(248,113,113,0.14)] text-[#ef4444] hover:bg-[rgba(248,113,113,0.24)]"
- : "border border-white bg-transparent text-white [&_path]:fill-current"),
+ : "border border-contrast bg-transparent text-contrast [&_path]:fill-current"),
!isSelected &&
- "border-0 bg-surface-raised text-white hover:bg-interactive-hover",
+ "border-0 bg-surface-raised text-contrast hover:bg-interactive-hover",
isDisabled && "cursor-not-allowed opacity-50",
className,
)}
diff --git a/src/components/shared/buttons/conversation-confirmation-buttons.tsx b/src/components/shared/buttons/conversation-confirmation-buttons.tsx
index 860985863d..0c6a12cf00 100644
--- a/src/components/shared/buttons/conversation-confirmation-buttons.tsx
+++ b/src/components/shared/buttons/conversation-confirmation-buttons.tsx
@@ -117,7 +117,7 @@ export function ConversationConfirmationButtons() {
/>
)}
<div className="flex justify-between items-center">
- <p className="text-sm font-normal text-white">
+ <p className="text-sm font-normal text-contrast">
{t(I18nKey.CHAT_INTERFACE$USER_ASK_CONFIRMATION)}
</p>
<div className="flex items-center gap-3">
diff --git a/src/components/shared/buttons/openhands-logo-button.tsx b/src/components/shared/buttons/openhands-logo-button.tsx
index 17a41aaf47..717888685d 100644
--- a/src/components/shared/buttons/openhands-logo-button.tsx
+++ b/src/components/shared/buttons/openhands-logo-button.tsx
@@ -34,7 +34,10 @@ export function OpenHandsLogoButton({
<OpenHandsLogo
width={logoWidth}
height={logoHeight}
- className={cn("shrink-0", logoClassName)}
+ className={cn(
+ "shrink-0 text-contrast [&_path[fill=white]]:fill-current",
+ logoClassName,
+ )}
/>
</NavigationLink>
);
diff --git a/src/components/shared/buttons/scroll-to-bottom-button.tsx b/src/components/shared/buttons/scroll-to-bottom-button.tsx
index f57b9b8565..15464b8ba0 100644
--- a/src/components/shared/buttons/scroll-to-bottom-button.tsx
+++ b/src/components/shared/buttons/scroll-to-bottom-button.tsx
@@ -10,7 +10,7 @@ export function ScrollToBottomButton({ onClick }: ScrollToBottomButtonProps) {
type="button"
onClick={onClick}
data-testid="scroll-to-bottom"
- className="flex items-center justify-center size-8 rounded-full bg-surface text-muted hover:bg-tertiary hover:text-white rotate-180 cursor-pointer transition-colors"
+ className="flex items-center justify-center size-8 rounded-full bg-surface text-muted hover:bg-tertiary hover:text-contrast rotate-180 cursor-pointer transition-colors"
>
<ArrowSendIcon width={15} height={15} />
</button>
diff --git a/src/components/shared/buttons/styled-tooltip.tsx b/src/components/shared/buttons/styled-tooltip.tsx
index 6b8a37fe6a..484327b044 100644
--- a/src/components/shared/buttons/styled-tooltip.tsx
+++ b/src/components/shared/buttons/styled-tooltip.tsx
@@ -42,13 +42,13 @@ export function StyledTooltip({
offset={offset}
shouldFlip={shouldFlip}
isOpen={isOpen}
- className={cn("bg-white text-black", tooltipClassName)}
+ className={cn("bg-contrast text-contrast-foreground", tooltipClassName)}
showArrow={showArrow}
disableAnimation={disableAnimation}
classNames={{
content: cn(
"z-[9999] rounded-md px-2 py-1 text-xs font-medium shadow-md",
- "!bg-white !text-black",
+ "!bg-contrast !text-contrast-foreground",
tooltipClassName,
),
}}
diff --git a/src/components/shared/filters/enum-filter-dropdown.tsx b/src/components/shared/filters/enum-filter-dropdown.tsx
index a212ee83e0..b12618bd38 100644
--- a/src/components/shared/filters/enum-filter-dropdown.tsx
+++ b/src/components/shared/filters/enum-filter-dropdown.tsx
@@ -79,7 +79,7 @@ export function EnumFilterDropdown<T extends string>({
emphasizeNonDefault &&
defaultOption &&
value !== defaultOption &&
- "border-white/60 bg-white/10",
+ "border-contrast/60 bg-contrast/10",
triggerClassName,
)}
>
diff --git a/src/components/shared/modals/modal-close-button.tsx b/src/components/shared/modals/modal-close-button.tsx
index 0f48b0ad30..9f831f5160 100644
--- a/src/components/shared/modals/modal-close-button.tsx
+++ b/src/components/shared/modals/modal-close-button.tsx
@@ -26,7 +26,7 @@ export function ModalCloseButton({
disabled={disabled}
aria-label={t(I18nKey.BUTTON$CLOSE)}
className={cn(
- "absolute right-4 top-4 z-10 flex cursor-pointer items-center justify-center rounded-sm border-0 bg-transparent p-1 text-tertiary-alt transition-colors hover:bg-surface-raised hover:text-white disabled:cursor-not-allowed disabled:opacity-50",
+ "absolute right-4 top-4 z-10 flex cursor-pointer items-center justify-center rounded-sm border-0 bg-transparent p-1 text-tertiary-alt transition-colors hover:bg-surface-raised hover:text-contrast disabled:cursor-not-allowed disabled:opacity-50",
className,
)}
>
diff --git a/src/components/shared/modals/settings/settings-modal.tsx b/src/components/shared/modals/settings/settings-modal.tsx
index e9436e1fd8..219273f7c0 100644
--- a/src/components/shared/modals/settings/settings-modal.tsx
+++ b/src/components/shared/modals/settings/settings-modal.tsx
@@ -39,7 +39,7 @@ export function SettingsModal({ onClose, settings }: SettingsModalProps) {
suffix="."
size="settings"
linkColor="white"
- suffixClassName="text-white"
+ suffixClassName="text-contrast"
/>
<SettingsForm
diff --git a/src/components/ui/resize-handle.tsx b/src/components/ui/resize-handle.tsx
index 5ced250b91..18e29fe0c8 100644
--- a/src/components/ui/resize-handle.tsx
+++ b/src/components/ui/resize-handle.tsx
@@ -33,7 +33,7 @@ export function ResizeHandle({
<div
className={cn(
"pointer-events-none absolute inset-y-0 left-1/2 w-px -translate-x-1/2 transition-colors",
- lineActive ? "bg-white" : "bg-transparent",
+ lineActive ? "bg-contrast" : "bg-transparent",
)}
aria-hidden
/>
diff --git a/src/hooks/use-color-theme.ts b/src/hooks/use-color-theme.ts
new file mode 100644
index 0000000000..3e6c21733c
--- /dev/null
+++ b/src/hooks/use-color-theme.ts
@@ -0,0 +1,14 @@
+import React from "react";
+import {
+ DEFAULT_COLOR_THEME,
+ getActiveColorTheme,
+ subscribeColorTheme,
+} from "#/themes/color-themes";
+
+export function useColorTheme() {
+ return React.useSyncExternalStore(
+ subscribeColorTheme,
+ getActiveColorTheme,
+ () => DEFAULT_COLOR_THEME,
+ );
+}
diff --git a/src/hooks/use-terminal.ts b/src/hooks/use-terminal.ts
index 5960dfc471..f2dd6c66fe 100644
--- a/src/hooks/use-terminal.ts
+++ b/src/hooks/use-terminal.ts
@@ -1,6 +1,8 @@
import { FitAddon } from "@xterm/addon-fit";
import { Terminal } from "@xterm/xterm";
import React from "react";
+import { useColorTheme } from "#/hooks/use-color-theme";
+import { getTerminalTheme } from "#/themes/terminal-themes";
import { Command, useCommandStore } from "#/stores/command-store";
import { parseTerminalOutput } from "#/utils/parse-terminal-output";
@@ -90,6 +92,7 @@ function resolveTerminalForeground(host: HTMLElement): string {
const persistentLastCommandIndex = { current: 0 };
export const useTerminal = () => {
+ const colorTheme = useColorTheme();
const commands = useCommandStore((state) => state.commands);
const terminal = React.useRef<Terminal | null>(null);
const fitAddon = React.useRef<FitAddon | null>(null);
@@ -108,10 +111,7 @@ export const useTerminal = () => {
// Canvas fillStyle does not resolve CSS variables; use transparency so
// the host / panel background shows through (`allowTransparency` required).
allowTransparency: true,
- theme: {
- background: "rgba(0, 0, 0, 0)",
- foreground: resolveTerminalForeground(host),
- },
+ theme: getTerminalTheme(colorTheme, resolveTerminalForeground(host)),
});
const fitTerminalSafely = React.useCallback(() => {
@@ -171,6 +171,15 @@ export const useTerminal = () => {
};
}, []);
+ React.useEffect(() => {
+ const host = ref.current;
+ if (!terminal.current?.options || !host) return;
+ terminal.current.options.theme = getTerminalTheme(
+ colorTheme,
+ resolveTerminalForeground(host),
+ );
+ }, [colorTheme]);
+
React.useEffect(() => {
if (
terminal.current &&
diff --git a/src/root.tsx b/src/root.tsx
index 7d3cecdd3a..4ad349dcd4 100644
--- a/src/root.tsx
+++ b/src/root.tsx
@@ -49,12 +49,13 @@ import { useOnboardingCompletion } from "#/components/features/onboarding/use-on
import { NavigationProvider } from "#/context/navigation-context";
import {
applyColorTheme,
+ COLOR_THEME_BOOTSTRAP_SCRIPT,
readPersistedColorTheme,
} from "#/themes/color-themes";
-/** Applies the persisted color-theme palette to document.body on mount. */
+/** Applies the persisted palette before paint; useEffect lands a frame late. */
function ColorThemeApplier() {
- React.useEffect(() => {
+ React.useLayoutEffect(() => {
applyColorTheme(readPersistedColorTheme());
}, []);
return null;
@@ -91,12 +92,15 @@ const BackendFormModal = React.lazy(() =>
export function Layout({ children }: { children: React.ReactNode }) {
return (
- <html lang="en">
+ <html lang="en" suppressHydrationWarning>
<head>
<meta charSet="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<Meta />
<Links />
+ <script
+ dangerouslySetInnerHTML={{ __html: COLOR_THEME_BOOTSTRAP_SCRIPT }}
+ />
</head>
<body data-agent-server-ui="" className="m-0">
<AgentServerUIRoot contentClassName="min-h-screen">
@@ -114,9 +118,9 @@ export function Layout({ children }: { children: React.ReactNode }) {
function AgentServerBootstrapLoading() {
return (
- <main className="min-h-screen bg-base px-6 py-10 text-white">
+ <main className="min-h-screen bg-base px-6 py-10 text-contrast">
<div className="mx-auto flex min-h-screen max-w-6xl items-center justify-center">
- <div className="rounded-3xl border border-white/10 bg-base/80 px-8 py-10 shadow-2xl">
+ <div className="rounded-3xl border border-contrast/10 bg-base/80 px-8 py-10 shadow-2xl">
<LoadingSpinner size="large" />
</div>
</div>
diff --git a/src/routes/agent-settings.tsx b/src/routes/agent-settings.tsx
index b94b1f19cc..f1d8a30146 100644
--- a/src/routes/agent-settings.tsx
+++ b/src/routes/agent-settings.tsx
@@ -1182,7 +1182,7 @@ export function AgentSettingsScreen({
</Typography.Text>
<textarea
data-testid="agent-command-input"
- className="bg-tertiary border border-[#717888] rounded-sm p-2 text-sm font-mono text-white placeholder:text-[#717888] min-h-15 resize-y focus:outline-none focus:border-white"
+ className="bg-tertiary border border-[#717888] rounded-sm p-2 text-sm font-mono text-contrast placeholder:text-[#717888] min-h-15 resize-y focus:outline-none focus:border-contrast"
value={commandText}
placeholder={commandPlaceholder}
onChange={(e) => {
diff --git a/src/routes/automations-list.tsx b/src/routes/automations-list.tsx
index 1245b30ced..17d8ab7fda 100644
--- a/src/routes/automations-list.tsx
+++ b/src/routes/automations-list.tsx
@@ -491,7 +491,7 @@ export default function AutomationsList() {
<button
type="button"
onClick={() => setLimit((prev) => prev + PAGE_SIZE)}
- className="self-center rounded-lg border border-border px-6 py-2 text-sm text-white hover:bg-surface-raised"
+ className="self-center rounded-lg border border-border px-6 py-2 text-sm text-contrast hover:bg-surface-raised"
>
{t(I18nKey.AUTOMATIONS$LOAD_MORE)}
</button>
diff --git a/src/routes/canvas-extension-page.tsx b/src/routes/canvas-extension-page.tsx
index 684d1019f2..4521d972bb 100644
--- a/src/routes/canvas-extension-page.tsx
+++ b/src/routes/canvas-extension-page.tsx
@@ -87,7 +87,7 @@ export default function CanvasExtensionPage() {
return (
<main className="flex h-full items-center justify-center p-8">
<div className="max-w-lg rounded-xl border border-border bg-base-secondary p-6 text-center">
- <h1 className="text-lg font-semibold text-white">
+ <h1 className="text-lg font-semibold text-contrast">
{t(I18nKey.SETUP$UNAVAILABLE_TITLE)}
</h1>
<p className="mt-2 text-sm text-tertiary-light">
diff --git a/src/routes/canvas-extensions.tsx b/src/routes/canvas-extensions.tsx
index c9e07475df..b3db58b308 100644
--- a/src/routes/canvas-extensions.tsx
+++ b/src/routes/canvas-extensions.tsx
@@ -128,7 +128,7 @@ export default function CanvasExtensionsScreen() {
{unsupported ? (
<div className={extensionModuleEmptyStateClassName}>
- <h3 className="text-sm font-semibold text-white">
+ <h3 className="text-sm font-semibold text-contrast">
{t(I18nKey.SETUP$UNAVAILABLE_TITLE)}
</h3>
<p className="mt-2 text-sm text-tertiary-light">
diff --git a/src/routes/device-verify.tsx b/src/routes/device-verify.tsx
index 6dec9807bc..cffb468e4f 100644
--- a/src/routes/device-verify.tsx
+++ b/src/routes/device-verify.tsx
@@ -130,7 +130,7 @@ export default function DeviceVerify() {
<div className="min-h-screen flex items-center justify-center bg-background">
<div className="max-w-md w-full mx-auto p-6 bg-card rounded-lg shadow-lg">
<div className="text-center">
- <div className="animate-spin rounded-full h-8 w-8 border-b-2 border-white mx-auto mb-4" />
+ <div className="animate-spin rounded-full h-8 w-8 border-b-2 border-contrast mx-auto mb-4" />
<p className="text-muted-foreground">
{t(I18nKey.DEVICE$PROCESSING)}
</p>
@@ -232,7 +232,7 @@ export default function DeviceVerify() {
return (
<div className="min-h-screen flex items-center justify-center bg-background">
<div className="text-center">
- <div className="animate-spin rounded-full h-8 w-8 border-b-2 border-white mx-auto mb-4" />
+ <div className="animate-spin rounded-full h-8 w-8 border-b-2 border-contrast mx-auto mb-4" />
<p className="text-muted-foreground">
{t(I18nKey.DEVICE$PROCESSING)}
</p>
diff --git a/src/routes/files-tab.tsx b/src/routes/files-tab.tsx
index 87a832bc4e..bc92f05f9f 100644
--- a/src/routes/files-tab.tsx
+++ b/src/routes/files-tab.tsx
@@ -231,7 +231,7 @@ function FilesTab() {
aria-label={t(I18nKey.FILES$OPEN_IN_NEW_WINDOW)}
title={t(I18nKey.FILES$OPEN_IN_NEW_WINDOW)}
data-testid="files-tab-open-in-new-window"
- className="ml-auto flex items-center justify-center w-6.5 py-1 rounded-[7px] hover:bg-interactive-hover cursor-pointer text-white"
+ className="ml-auto flex items-center justify-center w-6.5 py-1 rounded-[7px] hover:bg-interactive-hover cursor-pointer text-contrast"
>
<LinkExternalIcon width={14} height={14} />
</a>
diff --git a/src/routes/mcp.tsx b/src/routes/mcp.tsx
index 60f2c61ff6..283646396f 100644
--- a/src/routes/mcp.tsx
+++ b/src/routes/mcp.tsx
@@ -99,7 +99,7 @@ export default function MCPPage() {
>
<ExtensionsNavigation />
<div className="flex h-full flex-1 items-center justify-center px-4 md:px-0">
- <div className="h-8 w-8 rounded-full border-2 border-transparent border-t-white animate-spin" />
+ <div className="h-8 w-8 rounded-full border-2 border-transparent border-t-contrast animate-spin" />
</div>
</div>
);
diff --git a/src/routes/shared-conversation.tsx b/src/routes/shared-conversation.tsx
index 9a31d28e70..bd59a1838e 100644
--- a/src/routes/shared-conversation.tsx
+++ b/src/routes/shared-conversation.tsx
@@ -69,13 +69,13 @@ export default function SharedConversation() {
if (error || !conversation) {
return (
<div className="flex items-center justify-center h-screen bg-base">
- <div className="text-white">{t(I18nKey.CONVERSATION$NOT_FOUND)}</div>
+ <div className="text-contrast">{t(I18nKey.CONVERSATION$NOT_FOUND)}</div>
</div>
);
}
return (
- <div className="h-screen bg-base text-white flex flex-col">
+ <div className="h-screen bg-base text-contrast flex flex-col">
{/* Header with logo, conversation title and branch info */}
<div className="border-b border-border-subtle p-4 flex-shrink-0">
<div className="max-w-4xl mx-auto flex items-start gap-4">
@@ -84,7 +84,11 @@ export default function SharedConversation() {
className="flex-shrink-0"
aria-label={t(I18nKey.BRANDING$OPENHANDS_LOGO)}
>
- <OpenHandsLogo width={46} height={30} />
+ <OpenHandsLogo
+ width={46}
+ height={30}
+ className="text-contrast [&_path:not([fill=transparent])]:fill-current"
+ />
</Link>
<div className="flex-1 min-w-0">
<h1 className="text-xl font-medium mb-2">
diff --git a/src/routes/skills-settings.tsx b/src/routes/skills-settings.tsx
index 9abc9c05f9..e490f40947 100644
--- a/src/routes/skills-settings.tsx
+++ b/src/routes/skills-settings.tsx
@@ -216,7 +216,7 @@ function SkillsSettingsScreen() {
type="button"
data-testid="skills-clear-filters"
onClick={handleClearFacets}
- className="cursor-pointer underline hover:text-white"
+ className="cursor-pointer underline hover:text-contrast"
>
{t(I18nKey.SETTINGS$SKILLS_CLEAR_FILTERS)}
</button>
diff --git a/src/styles/agent-server-ui-style-scope.ts b/src/styles/agent-server-ui-style-scope.ts
index 469becbf93..a0bb0ffeb8 100644
--- a/src/styles/agent-server-ui-style-scope.ts
+++ b/src/styles/agent-server-ui-style-scope.ts
@@ -14,6 +14,7 @@ export const AGENT_SERVER_UI_THEMEABLE_BRAND_VARIABLES = [
export type AgentServerUIThemeableBrandVariable =
(typeof AGENT_SERVER_UI_THEMEABLE_BRAND_VARIABLES)[number];
+/** Public token reference; defaults are applied by CSS, never inlined by the root. */
export const AGENT_SERVER_UI_DEFAULT_CSS_VARIABLES = {
// Brand/button colors (--oh-color-primary, --oh-accent, --oh-warning) live in
// tailwind.css and are overridden at runtime by applyColorTheme(); keep them
@@ -30,12 +31,15 @@ export const AGENT_SERVER_UI_DEFAULT_CSS_VARIABLES = {
"--oh-color-content-2": "var(--cool-grey-50)",
"--oh-background": "var(--cool-grey-950)",
"--oh-foreground": "var(--cool-grey-100)",
+ "--oh-contrast": "#ffffff",
+ "--oh-contrast-foreground": "#000000",
"--oh-surface": "var(--cool-grey-925)",
"--oh-surface-foreground": "var(--cool-grey-100)",
"--oh-surface-raised": "var(--cool-grey-900)",
"--oh-surface-deep": "var(--cool-grey-975)",
"--oh-overlay": "var(--cool-grey-925)",
"--oh-overlay-foreground": "var(--cool-grey-100)",
+ "--oh-modal-title-foreground": "#ffffff",
"--oh-muted": "var(--cool-grey-400)",
"--oh-text-secondary": "var(--cool-grey-300)",
"--oh-text-tertiary": "var(--cool-grey-200)",
@@ -45,6 +49,8 @@ export const AGENT_SERVER_UI_DEFAULT_CSS_VARIABLES = {
"--oh-interactive-hover-low": "var(--cool-grey-900)",
"--oh-interactive-active": "var(--cool-grey-800)",
"--oh-interactive-selected": "var(--cool-grey-600)",
+ "--oh-context-window-foreground": "var(--oh-foreground)",
+ "--oh-context-window-track-weight": "42%",
"--oh-scrollbar": "color-mix(in srgb, var(--cool-grey-400) 30%, transparent)",
"--oh-scrollbar-hover":
"color-mix(in srgb, var(--cool-grey-400) 50%, transparent)",
diff --git a/src/tailwind.css b/src/tailwind.css
index 1660110063..ce6c9a6040 100644
--- a/src/tailwind.css
+++ b/src/tailwind.css
@@ -32,6 +32,8 @@
/* Semantic text aliases */
--color-foreground: var(--oh-foreground);
+ --color-contrast: var(--oh-contrast);
+ --color-contrast-foreground: var(--oh-contrast-foreground);
--color-text-secondary: var(--oh-text-secondary);
--color-text-tertiary: var(--oh-text-tertiary);
--color-muted: var(--oh-muted);
@@ -90,6 +92,8 @@
--oh-color-content-2: var(--cool-grey-50);
--oh-background: var(--cool-grey-950);
--oh-foreground: var(--cool-grey-100);
+ --oh-contrast: #ffffff;
+ --oh-contrast-foreground: #000000;
--oh-surface: var(--cool-grey-925);
--oh-surface-foreground: var(--cool-grey-100);
--oh-surface-raised: var(--cool-grey-900); /* elevated within a panel */
@@ -106,6 +110,8 @@
--oh-interactive-hover-low: var(--cool-grey-900); /* hover on dark base (950 bg) */
--oh-interactive-active: var(--cool-grey-800); /* selected/active on dark base */
--oh-interactive-selected: var(--cool-grey-600); /* selected within a panel (on 800/925 bg) */
+ --oh-context-window-foreground: var(--oh-foreground);
+ --oh-context-window-track-weight: 42%;
--oh-scrollbar: color-mix(in srgb, var(--cool-grey-400) 30%, transparent);
--oh-scrollbar-hover: color-mix(in srgb, var(--cool-grey-400) 50%, transparent);
--oh-default: var(--cool-grey-800);
@@ -192,7 +198,7 @@ button.extension-module-card-interactive {
}
.extension-module-card-interactive:hover {
- border-color: rgb(255 255 255 / 0.4);
+ border-color: color-mix(in srgb, var(--oh-foreground) 40%, transparent);
}
.extension-module-card-interactive:focus {
@@ -206,7 +212,7 @@ button.extension-module-card-interactive {
.extension-module-card-interactive:focus-visible {
outline: none;
- border-color: rgb(255 255 255 / 0.4);
+ border-color: color-mix(in srgb, var(--oh-foreground) 40%, transparent);
}
.button-base {
@@ -354,7 +360,7 @@ button.extension-module-card-interactive {
/* Drag and drop styles */
.drag-over {
backdrop-filter: blur(2px);
- background: rgba(255, 255, 255, 0.5);
+ background: color-mix(in srgb, var(--oh-contrast) 50%, transparent);
border-radius: 15px;
height: 100%;
left: 0;
diff --git a/src/themes/README.md b/src/themes/README.md
new file mode 100644
index 0000000000..9a5635d28d
--- /dev/null
+++ b/src/themes/README.md
@@ -0,0 +1,47 @@
+# Canvas color themes
+
+Canvas has three rendering systems: scoped CSS/HeroUI for the interface, Prism
+and Monaco for code, and xterm for terminal output. A palette must cover all of
+them; changing the page background alone is not a complete theme.
+
+## Adding a palette
+
+1. Add a definition under `color-theme/definitions/`, including its appearance,
+ grey scale, HeroUI HSL channels, and semantic token overrides.
+2. Add the key to `ColorThemeKey` and register the definition in
+ `color-theme/definitions/index.ts`. The settings menu is generated from this
+ registry.
+3. Select a Prism palette in `syntax-highlighter-themes.ts`, a Monaco palette in
+ `file-diff-viewer.tsx`, and all 16 ANSI colors in `terminal-themes.ts`.
+ These mappings are exhaustive so new themes cannot silently inherit a dark
+ code or terminal palette.
+4. Run the theme tests and inspect settings, portalled menus/modals, chat
+ Markdown, inline code, diffs, and ANSI output. Check disabled, selected,
+ hover, and keyboard-focus states, then switch back to every dark palette.
+
+## Ownership and component colors
+
+- `setColorTheme` is the selection/persistence entry point. React consumers use
+ `useColorTheme`; do not keep another copy of selected-theme state.
+- The stylesheet owns theme defaults. `AgentServerUIRoot` owns its React
+ attributes and preserves caller `styleOverrides` / `style` inline. The
+ runtime must never erase or rewrite those caller-owned properties.
+- Runtime CSS includes only palette overrides, not a second copy of base
+ defaults. Omitted tokens continue to resolve from the base/host stylesheet.
+- Embedded roots use the default appearance until a palette has actually been
+ applied; a stored Canvas preference alone must not select an unstyled light
+ wrapper. The application owns loading and applying its saved preference.
+- The head bootstrap uses the same CSS generator before hydration, including
+ when storage is unavailable or contains an obsolete key.
+- Use surface/foreground tokens for ordinary content. `contrast` is the
+ high-emphasis ink (white in dark palettes, dark in light palettes); its
+ paired `contrast-foreground` is for inverse pills and tooltips. Opacity and
+ state variants such as `hover:bg-contrast/10` retain their stated values.
+- Literal white is reserved for fixed-color surfaces (for example the blue
+ Plan control, an image-lightbox scrim, or a document preview). Do not globally
+ redefine white or add theme-specific selectors that reinterpret utilities.
+- SVG recoloring must preserve transparent negative-space paths.
+
+CSS custom properties cannot be passed as colors to Monaco or xterm. Those
+renderers require concrete colors; xterm's main foreground is resolved from
+the mounted scope so embedding overrides still work.
diff --git a/src/themes/color-theme/definitions/index.ts b/src/themes/color-theme/definitions/index.ts
new file mode 100644
index 0000000000..d41b859b97
--- /dev/null
+++ b/src/themes/color-theme/definitions/index.ts
@@ -0,0 +1,26 @@
+import type { ColorThemeDefinition, ColorThemeKey } from "../types";
+import { openhandsDeepsea } from "./openhands-deepsea";
+import { openhandsNeutral } from "./openhands-neutral";
+import { openhandsNeo } from "./openhands-neo";
+import { lightPlus } from "./light-plus";
+import { solarizedLight } from "./solarized-light";
+
+/**
+ * The theme registry.
+ *
+ * To add a theme: create a sibling module exporting a `ColorThemeDefinition`,
+ * add its key to `ColorThemeKey` in `../types.ts`, and register it below.
+ */
+export const COLOR_THEMES: Record<ColorThemeKey, ColorThemeDefinition> = {
+ "openhands-deepsea": openhandsDeepsea,
+ "openhands-neutral": openhandsNeutral,
+ "openhands-neo": openhandsNeo,
+ "light-plus": lightPlus,
+ "solarized-light": solarizedLight,
+};
+
+export const DEFAULT_COLOR_THEME: ColorThemeKey = "openhands-neutral";
+
+export const AVAILABLE_COLOR_THEMES = Object.entries(COLOR_THEMES).map(
+ ([key, def]) => ({ key: key as ColorThemeKey, label: def.label }),
+);
diff --git a/src/themes/color-theme/definitions/light-plus.ts b/src/themes/color-theme/definitions/light-plus.ts
new file mode 100644
index 0000000000..3cc0519609
--- /dev/null
+++ b/src/themes/color-theme/definitions/light-plus.ts
@@ -0,0 +1,132 @@
+import type { AgentServerUICssVariableName } from "#/styles/agent-server-ui-style-scope";
+import type { ColorThemeDefinition } from "../types";
+
+const LIGHT_PLUS_SCALE = {
+ "--cool-grey-50": "#181818",
+ "--cool-grey-100": "#1F1F1F",
+ "--cool-grey-200": "#424242",
+ "--cool-grey-300": "#4D4D4D",
+ "--cool-grey-400": "#616161",
+ "--cool-grey-500": "#767676",
+ "--cool-grey-600": "#8A8A8A",
+ "--cool-grey-700": "#D4D4D4",
+ "--cool-grey-800": "#E5E5E5",
+ "--cool-grey-900": "#EDEDED",
+ "--cool-grey-925": "#F3F3F3",
+ "--cool-grey-950": "#FFFFFF",
+ "--cool-grey-975": "#F8F8F8",
+};
+
+const LIGHT_PLUS_HEROUI = {
+ "--heroui-background": "0 0% 100%",
+ "--heroui-background-foreground": "0 0% 12.16%",
+ "--heroui-foreground-50": "0 0% 98%",
+ "--heroui-foreground-100": "0 0% 95.29%",
+ "--heroui-foreground-200": "0 0% 90.98%",
+ "--heroui-foreground-300": "0 0% 83.14%",
+ "--heroui-foreground-400": "0 0% 64%",
+ "--heroui-foreground-500": "0 0% 46.27%",
+ "--heroui-foreground-600": "0 0% 38.04%",
+ "--heroui-foreground-700": "0 0% 25.88%",
+ "--heroui-foreground-800": "0 0% 18%",
+ "--heroui-foreground-900": "0 0% 12.16%",
+ "--heroui-foreground": "0 0% 12.16%",
+ "--heroui-content1": "0 0% 100%",
+ "--heroui-content1-foreground": "0 0% 12.16%",
+ "--heroui-content2": "0 0% 97%",
+ "--heroui-content2-foreground": "0 0% 12.16%",
+ "--heroui-content3": "0 0% 95.29%",
+ "--heroui-content3-foreground": "0 0% 12.16%",
+ "--heroui-content4": "0 0% 90.98%",
+ "--heroui-content4-foreground": "0 0% 12.16%",
+ "--heroui-default-50": "0 0% 98%",
+ "--heroui-default-100": "0 0% 95.29%",
+ "--heroui-default-200": "0 0% 90.98%",
+ "--heroui-default-300": "0 0% 83.14%",
+ "--heroui-default-400": "0 0% 64%",
+ "--heroui-default-500": "0 0% 46.27%",
+ "--heroui-default-600": "0 0% 38.04%",
+ "--heroui-default-700": "0 0% 25.88%",
+ "--heroui-default-800": "0 0% 18%",
+ "--heroui-default-900": "0 0% 12.16%",
+ "--heroui-default-foreground": "0 0% 12.16%",
+ "--heroui-default": "0 0% 90.98%",
+};
+
+export const LIGHT_PLUS_TOKENS: Partial<
+ Record<AgentServerUICssVariableName, string>
+> = {
+ "--oh-color-primary": "#007ACC",
+ "--oh-color-logo": "#6B5700",
+ "--oh-color-base": "#FFFFFF",
+ "--oh-color-base-secondary": "#F3F3F3",
+ "--oh-color-danger": "#D13438",
+ "--oh-color-success": "#16825D",
+ "--oh-color-basic": "#616161",
+ "--oh-color-tertiary": "#E5E5E5",
+ "--oh-color-tertiary-light": "#4D4D4D",
+ "--oh-color-content": "#242424",
+ "--oh-color-content-2": "#181818",
+ "--oh-background": "#FFFFFF",
+ "--oh-foreground": "#1F1F1F",
+ "--oh-contrast": "#1F1F1F",
+ "--oh-contrast-foreground": "#FFFFFF",
+ "--oh-surface": "#F3F3F3",
+ "--oh-surface-foreground": "#1F1F1F",
+ "--oh-surface-raised": "#EEEEEE",
+ "--oh-surface-deep": "#E8E8E8",
+ "--oh-overlay": "#FFFFFF",
+ "--oh-overlay-foreground": "#1F1F1F",
+ "--oh-modal-title-foreground": "#1F1F1F",
+ "--oh-muted": "#616161",
+ "--oh-text-secondary": "#424242",
+ "--oh-text-tertiary": "#4D4D4D",
+ "--oh-text-dim": "#767676",
+ "--oh-text-subtle": "#616161",
+ "--oh-interactive-hover": "#E5E5E5",
+ "--oh-interactive-hover-low": "#F2F2F2",
+ "--oh-interactive-active": "#E8E8E8",
+ "--oh-interactive-selected": "#D6E9F8",
+ "--oh-context-window-foreground": "#1F1F1F",
+ "--oh-context-window-track-weight": "52%",
+ "--oh-scrollbar": "rgba(31, 31, 31, 0.24)",
+ "--oh-scrollbar-hover": "rgba(31, 31, 31, 0.4)",
+ "--oh-default": "#E5E5E5",
+ "--oh-default-foreground": "#1F1F1F",
+ "--oh-accent": "#007ACC",
+ "--oh-accent-foreground": "#FFFFFF",
+ "--oh-success": "#16825D",
+ "--oh-success-foreground": "#FFFFFF",
+ "--oh-warning": "#BF8803",
+ "--oh-warning-foreground": "#1F1F1F",
+ "--oh-danger": "#D13438",
+ "--oh-danger-foreground": "#FFFFFF",
+ "--oh-segment": "#F3F3F3",
+ "--oh-segment-foreground": "#1F1F1F",
+ "--oh-border": "#D4D4D4",
+ "--oh-border-input": "#C8C8C8",
+ "--oh-border-subtle": "#E5E5E5",
+ "--oh-separator": "rgba(31, 31, 31, 0.16)",
+ "--oh-focus": "#007ACC",
+ "--oh-status-success": "#16825D",
+ "--oh-status-error": "#D13438",
+ "--oh-link": "#006AB1",
+ "--oh-bg-dark": "#FFFFFF",
+ "--oh-bg-light": "#F3F3F3",
+ "--oh-bg-input": "#FFFFFF",
+ "--oh-bg-workspace": "#F8F8F8",
+ "--oh-text-editor-base": "#616161",
+ "--oh-text-editor-active": "#1F1F1F",
+ "--oh-bg-editor-sidebar": "#F3F3F3",
+ "--oh-bg-editor-active": "#E8E8E8",
+ "--oh-border-editor-sidebar": "#D4D4D4",
+ "--oh-bg-neutral-muted": "rgba(31, 31, 31, 0.08)",
+};
+
+export const lightPlus: ColorThemeDefinition = {
+ label: "Light+",
+ appearance: "light",
+ scale: LIGHT_PLUS_SCALE,
+ heroui: LIGHT_PLUS_HEROUI,
+ tokens: LIGHT_PLUS_TOKENS,
+};
diff --git a/src/themes/color-theme/definitions/openhands-deepsea.ts b/src/themes/color-theme/definitions/openhands-deepsea.ts
new file mode 100644
index 0000000000..d00926b77d
--- /dev/null
+++ b/src/themes/color-theme/definitions/openhands-deepsea.ts
@@ -0,0 +1,60 @@
+import type { ColorThemeDefinition } from "../types";
+
+export const openhandsDeepsea: ColorThemeDefinition = {
+ label: "OpenHands-DeepSea",
+ appearance: "dark",
+ // Matches the values already set by index.css; included so switching back
+ // from another theme restores the original palette explicitly.
+ scale: {
+ "--cool-grey-50": "#F7F9FC",
+ "--cool-grey-100": "#EEF2F7",
+ "--cool-grey-200": "#DCE3EE",
+ "--cool-grey-300": "#C3CDDC",
+ "--cool-grey-400": "#A3B0C4",
+ "--cool-grey-500": "#7E8A9E",
+ "--cool-grey-600": "#626D82",
+ "--cool-grey-700": "#4B5468",
+ "--cool-grey-800": "#383F50",
+ "--cool-grey-900": "#2C313F",
+ "--cool-grey-925": "#21252F",
+ "--cool-grey-950": "#0B0E14",
+ "--cool-grey-975": "#05070A",
+ },
+ // Values generated by heroui() from hero.ts β€” restore them explicitly when
+ // switching back from another theme.
+ heroui: {
+ "--heroui-background": "220 29.03% 6.08%",
+ "--heroui-background-foreground": "216 45.45% 97.84%",
+ "--heroui-foreground-50": "216 33.33% 2.94%",
+ "--heroui-foreground-100": "220 29.03% 6.08%",
+ "--heroui-foreground-200": "222.86 17.5% 15.69%",
+ "--heroui-foreground-300": "224.21 17.76% 20.98%",
+ "--heroui-foreground-400": "222.5 17.65% 26.67%",
+ "--heroui-foreground-500": "221.38 16.2% 35.1%",
+ "--heroui-foreground-600": "219.38 14.04% 44.71%",
+ "--heroui-foreground-700": "217.5 14.16% 55.69%",
+ "--heroui-foreground-800": "216.36 21.85% 70.39%",
+ "--heroui-foreground-900": "216 26.32% 81.37%",
+ "--heroui-foreground": "216 26.32% 81.37%",
+ "--heroui-content1": "222.86 17.5% 15.69%",
+ "--heroui-content1-foreground": "213.33 36% 95.1%",
+ "--heroui-content2": "224.21 17.76% 20.98%",
+ "--heroui-content2-foreground": "216.67 34.62% 89.8%",
+ "--heroui-content3": "222.5 17.65% 26.67%",
+ "--heroui-content3-foreground": "216 26.32% 81.37%",
+ "--heroui-content4": "221.38 16.2% 35.1%",
+ "--heroui-content4-foreground": "216.36 21.85% 70.39%",
+ "--heroui-default-50": "216 33.33% 2.94%",
+ "--heroui-default-100": "220 29.03% 6.08%",
+ "--heroui-default-200": "222.86 17.5% 15.69%",
+ "--heroui-default-300": "224.21 17.76% 20.98%",
+ "--heroui-default-400": "222.5 17.65% 26.67%",
+ "--heroui-default-500": "221.38 16.2% 35.1%",
+ "--heroui-default-600": "219.38 14.04% 44.71%",
+ "--heroui-default-700": "217.5 14.16% 55.69%",
+ "--heroui-default-800": "216.36 21.85% 70.39%",
+ "--heroui-default-900": "216 26.32% 81.37%",
+ "--heroui-default-foreground": "216 45.45% 97.84%",
+ "--heroui-default": "222.5 17.65% 26.67%",
+ },
+};
diff --git a/src/themes/color-theme/definitions/openhands-neo.ts b/src/themes/color-theme/definitions/openhands-neo.ts
new file mode 100644
index 0000000000..7b539a589b
--- /dev/null
+++ b/src/themes/color-theme/definitions/openhands-neo.ts
@@ -0,0 +1,20 @@
+import type { AgentServerUICssVariableName } from "#/styles/agent-server-ui-style-scope";
+import type { ColorThemeDefinition } from "../types";
+import { NEUTRAL_SCALE, NEUTRAL_HEROUI } from "../palettes/neutral";
+
+/** White primary/accent tokens β€” used by OpenHands-Neo for button surfaces. */
+const NEO_WHITE_BUTTON_TOKENS: Partial<
+ Record<AgentServerUICssVariableName, string>
+> = {
+ "--oh-color-primary": "#ffffff",
+ "--oh-accent": "#ffffff",
+ "--oh-warning": "#ffffff",
+};
+
+export const openhandsNeo: ColorThemeDefinition = {
+ label: "OpenHands-Neo",
+ appearance: "dark",
+ scale: NEUTRAL_SCALE,
+ heroui: NEUTRAL_HEROUI,
+ tokens: NEO_WHITE_BUTTON_TOKENS,
+};
diff --git a/src/themes/color-theme/definitions/openhands-neutral.ts b/src/themes/color-theme/definitions/openhands-neutral.ts
new file mode 100644
index 0000000000..ad3e0a97ea
--- /dev/null
+++ b/src/themes/color-theme/definitions/openhands-neutral.ts
@@ -0,0 +1,13 @@
+import type { ColorThemeDefinition } from "../types";
+import { NEUTRAL_SCALE, NEUTRAL_HEROUI } from "../palettes/neutral";
+
+export const openhandsNeutral: ColorThemeDefinition = {
+ label: "OpenHands-Neutral",
+ appearance: "dark",
+ scale: NEUTRAL_SCALE,
+ // Each stop follows the same positional mapping as hero.ts:
+ // heroui-default-100 ← cool-grey-950 position ← neutral-950 (#181818)
+ // heroui-default-200 ← cool-grey-925 position ← neutral-900 (#202020)
+ // ...etc.
+ heroui: NEUTRAL_HEROUI,
+};
diff --git a/src/themes/color-theme/definitions/solarized-light.ts b/src/themes/color-theme/definitions/solarized-light.ts
new file mode 100644
index 0000000000..e2830c3435
--- /dev/null
+++ b/src/themes/color-theme/definitions/solarized-light.ts
@@ -0,0 +1,135 @@
+import type { AgentServerUICssVariableName } from "#/styles/agent-server-ui-style-scope";
+import type { ColorThemeDefinition } from "../types";
+// Solarized Light inherits Light+ token values, overriding only what differs.
+import { LIGHT_PLUS_TOKENS } from "./light-plus";
+
+const SOLARIZED_LIGHT_SCALE = {
+ "--cool-grey-50": "#002B36",
+ "--cool-grey-100": "#586E75",
+ "--cool-grey-200": "#657B83",
+ "--cool-grey-300": "#657B83",
+ "--cool-grey-400": "#839496",
+ "--cool-grey-500": "#93A1A1",
+ "--cool-grey-600": "#B7B1A1",
+ "--cool-grey-700": "#D7D0BC",
+ "--cool-grey-800": "#E6DFCC",
+ "--cool-grey-900": "#EEE8D5",
+ "--cool-grey-925": "#F7F0DC",
+ "--cool-grey-950": "#FDF6E3",
+ "--cool-grey-975": "#E9E2CF",
+};
+
+const SOLARIZED_LIGHT_HEROUI = {
+ "--heroui-background": "43.85 86.67% 94.12%",
+ "--heroui-background-foreground": "196 12.93% 45.49%",
+ "--heroui-foreground-50": "43.85 86.67% 94.12%",
+ "--heroui-foreground-100": "45.6 42.37% 88.43%",
+ "--heroui-foreground-200": "44 30% 82%",
+ "--heroui-foreground-300": "44 20% 75%",
+ "--heroui-foreground-400": "180 6.93% 60.39%",
+ "--heroui-foreground-500": "186.32 8.3% 55.1%",
+ "--heroui-foreground-600": "196 12.93% 45.49%",
+ "--heroui-foreground-700": "194.48 14.15% 40.2%",
+ "--heroui-foreground-800": "192.2 80.82% 14.31%",
+ "--heroui-foreground-900": "192.22 100% 10.59%",
+ "--heroui-foreground": "196 12.93% 45.49%",
+ "--heroui-content1": "43.85 86.67% 94.12%",
+ "--heroui-content1-foreground": "196 12.93% 45.49%",
+ "--heroui-content2": "45.6 42.37% 88.43%",
+ "--heroui-content2-foreground": "196 12.93% 45.49%",
+ "--heroui-content3": "44 30% 84%",
+ "--heroui-content3-foreground": "194.48 14.15% 40.2%",
+ "--heroui-content4": "44 24% 79%",
+ "--heroui-content4-foreground": "192.2 80.82% 14.31%",
+ "--heroui-default-50": "43.85 86.67% 94.12%",
+ "--heroui-default-100": "45.6 42.37% 88.43%",
+ "--heroui-default-200": "44 30% 82%",
+ "--heroui-default-300": "44 20% 75%",
+ "--heroui-default-400": "180 6.93% 60.39%",
+ "--heroui-default-500": "186.32 8.3% 55.1%",
+ "--heroui-default-600": "196 12.93% 45.49%",
+ "--heroui-default-700": "194.48 14.15% 40.2%",
+ "--heroui-default-800": "192.2 80.82% 14.31%",
+ "--heroui-default-900": "192.22 100% 10.59%",
+ "--heroui-default-foreground": "192.22 100% 10.59%",
+ "--heroui-default": "45.6 42.37% 88.43%",
+};
+
+const SOLARIZED_LIGHT_TOKENS: Partial<
+ Record<AgentServerUICssVariableName, string>
+> = {
+ ...LIGHT_PLUS_TOKENS,
+ "--oh-color-primary": "#268BD2",
+ "--oh-color-logo": "#B58900",
+ "--oh-color-base": "#FDF6E3",
+ "--oh-color-base-secondary": "#EEE8D5",
+ "--oh-color-danger": "#DC322F",
+ "--oh-color-success": "#859900",
+ "--oh-color-basic": "#839496",
+ "--oh-color-tertiary": "#E6DFCC",
+ "--oh-color-tertiary-light": "#657B83",
+ "--oh-color-content": "#657B83",
+ "--oh-color-content-2": "#002B36",
+ "--oh-background": "#FDF6E3",
+ "--oh-foreground": "#657B83",
+ "--oh-contrast": "#002B36",
+ "--oh-contrast-foreground": "#FDF6E3",
+ "--oh-surface": "#EEE8D5",
+ "--oh-surface-foreground": "#586E75",
+ "--oh-surface-raised": "#F0E9D6",
+ "--oh-surface-deep": "#E6DFCC",
+ "--oh-overlay": "#FDF6E3",
+ "--oh-overlay-foreground": "#586E75",
+ "--oh-modal-title-foreground": "#002B36",
+ "--oh-muted": "#839496",
+ "--oh-text-secondary": "#657B83",
+ "--oh-text-tertiary": "#586E75",
+ "--oh-text-dim": "#839496",
+ "--oh-text-subtle": "#657B83",
+ "--oh-interactive-hover": "#E6DFCC",
+ "--oh-interactive-hover-low": "#F5EEDB",
+ "--oh-interactive-active": "#DDD6C3",
+ "--oh-interactive-selected": "#D7E8EA",
+ "--oh-context-window-foreground": "#002B36",
+ "--oh-context-window-track-weight": "54%",
+ "--oh-scrollbar": "rgba(88, 110, 117, 0.28)",
+ "--oh-scrollbar-hover": "rgba(88, 110, 117, 0.45)",
+ "--oh-default": "#E6DFCC",
+ "--oh-default-foreground": "#586E75",
+ "--oh-accent": "#268BD2",
+ "--oh-accent-foreground": "#FFFFFF",
+ "--oh-success": "#859900",
+ "--oh-success-foreground": "#002B36",
+ "--oh-warning": "#B58900",
+ "--oh-warning-foreground": "#002B36",
+ "--oh-danger": "#DC322F",
+ "--oh-danger-foreground": "#FFFFFF",
+ "--oh-segment": "#EEE8D5",
+ "--oh-segment-foreground": "#586E75",
+ "--oh-border": "#D7D0BC",
+ "--oh-border-input": "#C8C1AE",
+ "--oh-border-subtle": "#E6DFCC",
+ "--oh-separator": "rgba(88, 110, 117, 0.22)",
+ "--oh-focus": "#268BD2",
+ "--oh-status-success": "#859900",
+ "--oh-status-error": "#DC322F",
+ "--oh-link": "#268BD2",
+ "--oh-bg-dark": "#FDF6E3",
+ "--oh-bg-light": "#EEE8D5",
+ "--oh-bg-input": "#FDF6E3",
+ "--oh-bg-workspace": "#F7F0DC",
+ "--oh-text-editor-base": "#839496",
+ "--oh-text-editor-active": "#586E75",
+ "--oh-bg-editor-sidebar": "#EEE8D5",
+ "--oh-bg-editor-active": "#E6DFCC",
+ "--oh-border-editor-sidebar": "#D7D0BC",
+ "--oh-bg-neutral-muted": "rgba(88, 110, 117, 0.1)",
+};
+
+export const solarizedLight: ColorThemeDefinition = {
+ label: "Solarized Light",
+ appearance: "light",
+ scale: SOLARIZED_LIGHT_SCALE,
+ heroui: SOLARIZED_LIGHT_HEROUI,
+ tokens: SOLARIZED_LIGHT_TOKENS,
+};
diff --git a/src/themes/color-theme/palettes/neutral.ts b/src/themes/color-theme/palettes/neutral.ts
new file mode 100644
index 0000000000..f58e27799b
--- /dev/null
+++ b/src/themes/color-theme/palettes/neutral.ts
@@ -0,0 +1,71 @@
+// Shared neutral palette used by the OpenHands-Neutral and -Neo themes.
+
+// HSL channel strings for the neutral grey palette (H=0, S=0%, L=hex/255*100)
+// prettier-ignore
+const NEUTRAL_HSL = {
+ 50: "0 0% 96.86%", // #F7F7F7
+ 100: "0 0% 92.55%", // #ECECEC
+ 200: "0 0% 86.27%", // #DCDCDC
+ 300: "0 0% 74.51%", // #BEBEBE
+ 400: "0 0% 59.22%", // #979797
+ 500: "0 0% 45.1%", // #737373
+ 600: "0 0% 33.73%", // #565656
+ 700: "0 0% 25.1%", // #404040
+ 800: "0 0% 19.22%", // #313131
+ 850: "0 0% 15.69%", // #282828
+ 900: "0 0% 12.55%", // #202020
+ 950: "0 0% 9.41%", // #181818
+ 975: "0 0% 6.27%", // #101010
+};
+
+export const NEUTRAL_SCALE = {
+ "--cool-grey-50": "#F7F7F7",
+ "--cool-grey-100": "#ECECEC",
+ "--cool-grey-200": "#DCDCDC",
+ "--cool-grey-300": "#BEBEBE",
+ "--cool-grey-400": "#979797",
+ "--cool-grey-500": "#737373",
+ "--cool-grey-600": "#565656",
+ "--cool-grey-700": "#404040",
+ "--cool-grey-800": "#313131",
+ "--cool-grey-900": "#282828",
+ "--cool-grey-925": "#202020",
+ "--cool-grey-950": "#181818",
+ "--cool-grey-975": "#101010",
+};
+
+export const NEUTRAL_HEROUI = {
+ "--heroui-background": NEUTRAL_HSL[950],
+ "--heroui-background-foreground": NEUTRAL_HSL[50],
+ "--heroui-foreground-50": NEUTRAL_HSL[975],
+ "--heroui-foreground-100": NEUTRAL_HSL[950],
+ "--heroui-foreground-200": NEUTRAL_HSL[900],
+ "--heroui-foreground-300": NEUTRAL_HSL[850],
+ "--heroui-foreground-400": NEUTRAL_HSL[800],
+ "--heroui-foreground-500": NEUTRAL_HSL[700],
+ "--heroui-foreground-600": NEUTRAL_HSL[600],
+ "--heroui-foreground-700": NEUTRAL_HSL[500],
+ "--heroui-foreground-800": NEUTRAL_HSL[400],
+ "--heroui-foreground-900": NEUTRAL_HSL[300],
+ "--heroui-foreground": NEUTRAL_HSL[300],
+ "--heroui-content1": NEUTRAL_HSL[900],
+ "--heroui-content1-foreground": NEUTRAL_HSL[100],
+ "--heroui-content2": NEUTRAL_HSL[850],
+ "--heroui-content2-foreground": NEUTRAL_HSL[200],
+ "--heroui-content3": NEUTRAL_HSL[800],
+ "--heroui-content3-foreground": NEUTRAL_HSL[300],
+ "--heroui-content4": NEUTRAL_HSL[700],
+ "--heroui-content4-foreground": NEUTRAL_HSL[400],
+ "--heroui-default-50": NEUTRAL_HSL[975],
+ "--heroui-default-100": NEUTRAL_HSL[950],
+ "--heroui-default-200": NEUTRAL_HSL[900],
+ "--heroui-default-300": NEUTRAL_HSL[850],
+ "--heroui-default-400": NEUTRAL_HSL[800],
+ "--heroui-default-500": NEUTRAL_HSL[700],
+ "--heroui-default-600": NEUTRAL_HSL[600],
+ "--heroui-default-700": NEUTRAL_HSL[500],
+ "--heroui-default-800": NEUTRAL_HSL[400],
+ "--heroui-default-900": NEUTRAL_HSL[300],
+ "--heroui-default-foreground": NEUTRAL_HSL[50],
+ "--heroui-default": NEUTRAL_HSL[800],
+};
diff --git a/src/themes/color-theme/runtime.ts b/src/themes/color-theme/runtime.ts
new file mode 100644
index 0000000000..50864b0ea4
--- /dev/null
+++ b/src/themes/color-theme/runtime.ts
@@ -0,0 +1,134 @@
+import { type ColorThemeKey } from "./types";
+import { COLOR_THEMES, DEFAULT_COLOR_THEME } from "./definitions";
+
+const STORAGE_KEY = "openhands-color-theme";
+let activeColorTheme: ColorThemeKey | null = null;
+const colorThemeListeners = new Set<() => void>();
+
+/** Read the persisted theme key from localStorage, falling back to the default. */
+export function readPersistedColorTheme(): ColorThemeKey {
+ if (typeof window === "undefined") return DEFAULT_COLOR_THEME;
+ try {
+ const stored = window.localStorage.getItem(STORAGE_KEY);
+ if (stored && Object.hasOwn(COLOR_THEMES, stored))
+ return stored as ColorThemeKey;
+ } catch {
+ // ignore quota / privacy-mode failures
+ }
+ return DEFAULT_COLOR_THEME;
+}
+
+/** Persist the theme key to localStorage. */
+export function persistColorTheme(key: ColorThemeKey): void {
+ try {
+ window.localStorage.setItem(STORAGE_KEY, key);
+ } catch {
+ // ignore
+ }
+}
+
+/** Applied theme only: embedded roots must not adopt unapplied app preferences. */
+export function getActiveColorTheme(): ColorThemeKey {
+ return activeColorTheme ?? DEFAULT_COLOR_THEME;
+}
+
+export function subscribeColorTheme(listener: () => void): () => void {
+ colorThemeListeners.add(listener);
+ return () => colorThemeListeners.delete(listener);
+}
+
+/** Apply and persist a user-selected theme as one atomic operation. */
+export function setColorTheme(key: ColorThemeKey): void {
+ applyColorTheme(key);
+ persistColorTheme(key);
+}
+
+const THEME_STYLE_TAG_ID = "oh-color-theme-override";
+
+/**
+ * Apply a theme by injecting (or replacing) a <style> tag that overrides
+ * both our custom --cool-grey-* primitives and HeroUI's --heroui-* tokens.
+ *
+ * Why a <style> tag:
+ * PostCSS transforms :root / body to [data-agent-server-ui], so --cool-grey-*
+ * is set on EVERY element carrying that attribute. A body inline-style only
+ * overrides body itself β€” inner matching elements keep the stylesheet value.
+ *
+ * Why heroui variables:
+ * HeroUI stores colors as HSL channels in --heroui-* vars on [data-theme=dark].
+ * They reference their own token system and are unaffected by --cool-grey-*
+ * changes, so we override them from the same injected sheet.
+ *
+ * Why doubled selectors + re-append on every call:
+ * "Later sheet wins the tie" cannot be relied on: in the built SPA
+ * (ssr:false, prerendered shell) React 19 re-creates the <head> elements it
+ * manages (<Meta/>/<Links/>) whenever the tree above the router remounts.
+ * That can re-insert the base stylesheet <link> AFTER this tag, allowing its
+ * unlayered [data-agent-server-ui] variable rules (0,1,0) to win every tie.
+ * Doubling the attribute selectors ([x][x], 0,2,0) beats them from any
+ * position in <head>; re-appending on each apply keeps document order
+ * favorable as well.
+ */
+export function getColorThemeCss(key: ColorThemeKey): string {
+ const { appearance, scale, heroui, tokens = {} } = COLOR_THEMES[key];
+
+ const scaleDecls = Object.entries(scale)
+ .map(([p, v]) => ` ${p}: ${v};`)
+ .join("\n");
+
+ const herouiDecls = Object.entries(heroui)
+ .map(([p, v]) => ` ${p}: ${v};`)
+ .join("\n");
+
+ // Omitted tokens fall back to the base/consumer stylesheet. Replacing this
+ // tag on selection removes the previous palette's overrides automatically.
+ const tokenDecls = Object.entries(tokens)
+ .map(([p, v]) => ` ${p}: ${v};`)
+ .join("\n");
+
+ // Target both selectors for heroui vars:
+ // [data-agent-server-ui] β€” covers document.body (portal destination) so
+ // portalled popover/listbox content inherits the overridden values.
+ // scoped [data-theme] β€” also covers the server-rendered wrapper before
+ // React updates its appearance attribute during hydration. Set its
+ // color-scheme too: HeroUI's .dark rule otherwise wins over inheritance.
+ // Both are doubled to out-specify the base sheet regardless of stylesheet
+ // order (see the doc comment above).
+ return [
+ `[data-agent-server-ui][data-agent-server-ui] {\n color-scheme: ${appearance};\n${scaleDecls}\n${herouiDecls}\n${tokenDecls}\n}`,
+ `[data-agent-server-ui] [data-theme][data-theme] {\n color-scheme: ${appearance};\n${herouiDecls}\n}`,
+ ].join("\n");
+}
+
+export function applyColorTheme(key: ColorThemeKey): void {
+ if (typeof document === "undefined") return;
+ const css = getColorThemeCss(key);
+
+ let styleEl = document.getElementById(
+ THEME_STYLE_TAG_ID,
+ ) as HTMLStyleElement | null;
+ if (!styleEl) {
+ styleEl = document.createElement("style");
+ styleEl.id = THEME_STYLE_TAG_ID;
+ }
+ styleEl.textContent = css;
+ // Re-append even when the tag already exists (appendChild relocates a
+ // connected node) so the override also stays after any re-inserted <link>.
+ document.head.appendChild(styleEl);
+
+ activeColorTheme = key;
+ document.documentElement.style.colorScheme = COLOR_THEMES[key].appearance;
+ for (const listener of colorThemeListeners) listener();
+}
+
+/** Runs in the document head before the body paints or React hydrates. */
+export const COLOR_THEME_BOOTSTRAP_SCRIPT = `(() => {
+ const themes = ${JSON.stringify(Object.fromEntries(Object.keys(COLOR_THEMES).map((key) => [key, { css: getColorThemeCss(key as ColorThemeKey), appearance: COLOR_THEMES[key as ColorThemeKey].appearance }]))).replace(/</g, "\\u003c")};
+ let key = ${JSON.stringify(DEFAULT_COLOR_THEME)};
+ try { const stored = localStorage.getItem(${JSON.stringify(STORAGE_KEY)}); if (Object.hasOwn(themes, stored)) key = stored; } catch {}
+ const style = document.createElement('style');
+ style.id = ${JSON.stringify(THEME_STYLE_TAG_ID)};
+ style.textContent = themes[key].css;
+ document.head.appendChild(style);
+ document.documentElement.style.colorScheme = themes[key].appearance;
+})();`;
diff --git a/src/themes/color-theme/types.ts b/src/themes/color-theme/types.ts
new file mode 100644
index 0000000000..b68a9eb2f9
--- /dev/null
+++ b/src/themes/color-theme/types.ts
@@ -0,0 +1,28 @@
+import type { AgentServerUICssVariableName } from "#/styles/agent-server-ui-style-scope";
+
+export type ColorThemeKey =
+ | "openhands-deepsea"
+ | "openhands-neutral"
+ | "openhands-neo"
+ | "light-plus"
+ | "solarized-light";
+
+export type ColorThemeAppearance = "dark" | "light";
+
+export interface ColorThemeDefinition {
+ label: string;
+ appearance: ColorThemeAppearance;
+ /** Overrides for --cool-grey-* CSS custom properties (our semantic scale) */
+ scale: Record<string, string>;
+ /**
+ * Overrides for --heroui-* CSS custom properties.
+ * HeroUI stores colors as space-separated HSL channels ("H S% L%") so Tailwind
+ * utilities like bg-default-200 resolve to hsl(var(--heroui-default-200)).
+ * These vars are set by the heroui() plugin on :root, [data-theme=dark] at
+ * build time, so they must be overridden at the same or lower specificity
+ * from a later stylesheet to pick up theme changes at runtime.
+ */
+ heroui: Record<string, string>;
+ /** Overrides for --oh-* semantic tokens such as brand / button colors. */
+ tokens?: Partial<Record<AgentServerUICssVariableName, string>>;
+}
diff --git a/src/themes/color-themes.ts b/src/themes/color-themes.ts
index fb9e470818..284d3525cb 100644
--- a/src/themes/color-themes.ts
+++ b/src/themes/color-themes.ts
@@ -1,299 +1,31 @@
-export type ColorThemeKey =
- | "openhands-deepsea"
- | "openhands-neutral"
- | "openhands-neo";
-
-export interface ColorThemeDefinition {
- label: string;
- /** Overrides for --cool-grey-* CSS custom properties (our semantic scale) */
- scale: Record<string, string>;
- /**
- * Overrides for --heroui-* CSS custom properties.
- * HeroUI stores colors as space-separated HSL channels ("H S% L%") so Tailwind
- * utilities like bg-default-200 resolve to hsl(var(--heroui-default-200)).
- * These vars are set by the heroui() plugin on :root, [data-theme=dark] at
- * build time, so they must be overridden at the same or lower specificity
- * from a later stylesheet to pick up theme changes at runtime.
- */
- heroui: Record<string, string>;
- /** Overrides for --oh-* semantic tokens such as brand / button colors. */
- tokens?: Record<string, string>;
-}
-
-// HSL channel strings for the neutral grey palette (H=0, S=0%, L=hex/255*100)
-// prettier-ignore
-const NEUTRAL_HSL = {
- 50: "0 0% 96.86%", // #F7F7F7
- 100: "0 0% 92.55%", // #ECECEC
- 200: "0 0% 86.27%", // #DCDCDC
- 300: "0 0% 74.51%", // #BEBEBE
- 400: "0 0% 59.22%", // #979797
- 500: "0 0% 45.1%", // #737373
- 600: "0 0% 33.73%", // #565656
- 700: "0 0% 25.1%", // #404040
- 800: "0 0% 19.22%", // #313131
- 850: "0 0% 15.69%", // #282828
- 900: "0 0% 12.55%", // #202020
- 950: "0 0% 9.41%", // #181818
- 975: "0 0% 6.27%", // #101010
-};
-
-const NEUTRAL_SCALE = {
- "--cool-grey-50": "#F7F7F7",
- "--cool-grey-100": "#ECECEC",
- "--cool-grey-200": "#DCDCDC",
- "--cool-grey-300": "#BEBEBE",
- "--cool-grey-400": "#979797",
- "--cool-grey-500": "#737373",
- "--cool-grey-600": "#565656",
- "--cool-grey-700": "#404040",
- "--cool-grey-800": "#313131",
- "--cool-grey-900": "#282828",
- "--cool-grey-925": "#202020",
- "--cool-grey-950": "#181818",
- "--cool-grey-975": "#101010",
-};
-
-const NEUTRAL_HEROUI = {
- "--heroui-background": NEUTRAL_HSL[950],
- "--heroui-background-foreground": NEUTRAL_HSL[50],
- "--heroui-foreground-50": NEUTRAL_HSL[975],
- "--heroui-foreground-100": NEUTRAL_HSL[950],
- "--heroui-foreground-200": NEUTRAL_HSL[900],
- "--heroui-foreground-300": NEUTRAL_HSL[850],
- "--heroui-foreground-400": NEUTRAL_HSL[800],
- "--heroui-foreground-500": NEUTRAL_HSL[700],
- "--heroui-foreground-600": NEUTRAL_HSL[600],
- "--heroui-foreground-700": NEUTRAL_HSL[500],
- "--heroui-foreground-800": NEUTRAL_HSL[400],
- "--heroui-foreground-900": NEUTRAL_HSL[300],
- "--heroui-foreground": NEUTRAL_HSL[300],
- "--heroui-content1": NEUTRAL_HSL[900],
- "--heroui-content1-foreground": NEUTRAL_HSL[100],
- "--heroui-content2": NEUTRAL_HSL[850],
- "--heroui-content2-foreground": NEUTRAL_HSL[200],
- "--heroui-content3": NEUTRAL_HSL[800],
- "--heroui-content3-foreground": NEUTRAL_HSL[300],
- "--heroui-content4": NEUTRAL_HSL[700],
- "--heroui-content4-foreground": NEUTRAL_HSL[400],
- "--heroui-default-50": NEUTRAL_HSL[975],
- "--heroui-default-100": NEUTRAL_HSL[950],
- "--heroui-default-200": NEUTRAL_HSL[900],
- "--heroui-default-300": NEUTRAL_HSL[850],
- "--heroui-default-400": NEUTRAL_HSL[800],
- "--heroui-default-500": NEUTRAL_HSL[700],
- "--heroui-default-600": NEUTRAL_HSL[600],
- "--heroui-default-700": NEUTRAL_HSL[500],
- "--heroui-default-800": NEUTRAL_HSL[400],
- "--heroui-default-900": NEUTRAL_HSL[300],
- "--heroui-default-foreground": NEUTRAL_HSL[50],
- "--heroui-default": NEUTRAL_HSL[800],
-};
-
-import { AGENT_SERVER_UI_THEMEABLE_BRAND_VARIABLES } from "#/styles/agent-server-ui-style-scope";
-
-/** CSS custom properties overridden by color themes (see applyColorTheme). */
-export const COLOR_THEME_TOKEN_KEYS = AGENT_SERVER_UI_THEMEABLE_BRAND_VARIABLES;
-
-/** White primary/accent tokens β€” used by OpenHands-Neo for button surfaces. */
-const NEO_WHITE_BUTTON_TOKENS: Record<
- (typeof COLOR_THEME_TOKEN_KEYS)[number],
- string
-> = {
- "--oh-color-primary": "#ffffff",
- "--oh-accent": "#ffffff",
- "--oh-warning": "#ffffff",
-};
-
-export const COLOR_THEMES: Record<ColorThemeKey, ColorThemeDefinition> = {
- "openhands-deepsea": {
- label: "OpenHands-DeepSea",
- // Matches the values already set by index.css; included so switching back
- // from another theme restores the original palette explicitly.
- scale: {
- "--cool-grey-50": "#F7F9FC",
- "--cool-grey-100": "#EEF2F7",
- "--cool-grey-200": "#DCE3EE",
- "--cool-grey-300": "#C3CDDC",
- "--cool-grey-400": "#A3B0C4",
- "--cool-grey-500": "#7E8A9E",
- "--cool-grey-600": "#626D82",
- "--cool-grey-700": "#4B5468",
- "--cool-grey-800": "#383F50",
- "--cool-grey-900": "#2C313F",
- "--cool-grey-925": "#21252F",
- "--cool-grey-950": "#0B0E14",
- "--cool-grey-975": "#05070A",
- },
- // Values generated by heroui() from hero.ts β€” restore them explicitly when
- // switching back from another theme.
- heroui: {
- "--heroui-background": "220 29.03% 6.08%",
- "--heroui-background-foreground": "216 45.45% 97.84%",
- "--heroui-foreground-50": "216 33.33% 2.94%",
- "--heroui-foreground-100": "220 29.03% 6.08%",
- "--heroui-foreground-200": "222.86 17.5% 15.69%",
- "--heroui-foreground-300": "224.21 17.76% 20.98%",
- "--heroui-foreground-400": "222.5 17.65% 26.67%",
- "--heroui-foreground-500": "221.38 16.2% 35.1%",
- "--heroui-foreground-600": "219.38 14.04% 44.71%",
- "--heroui-foreground-700": "217.5 14.16% 55.69%",
- "--heroui-foreground-800": "216.36 21.85% 70.39%",
- "--heroui-foreground-900": "216 26.32% 81.37%",
- "--heroui-foreground": "216 26.32% 81.37%",
- "--heroui-content1": "222.86 17.5% 15.69%",
- "--heroui-content1-foreground": "213.33 36% 95.1%",
- "--heroui-content2": "224.21 17.76% 20.98%",
- "--heroui-content2-foreground": "216.67 34.62% 89.8%",
- "--heroui-content3": "222.5 17.65% 26.67%",
- "--heroui-content3-foreground": "216 26.32% 81.37%",
- "--heroui-content4": "221.38 16.2% 35.1%",
- "--heroui-content4-foreground": "216.36 21.85% 70.39%",
- "--heroui-default-50": "216 33.33% 2.94%",
- "--heroui-default-100": "220 29.03% 6.08%",
- "--heroui-default-200": "222.86 17.5% 15.69%",
- "--heroui-default-300": "224.21 17.76% 20.98%",
- "--heroui-default-400": "222.5 17.65% 26.67%",
- "--heroui-default-500": "221.38 16.2% 35.1%",
- "--heroui-default-600": "219.38 14.04% 44.71%",
- "--heroui-default-700": "217.5 14.16% 55.69%",
- "--heroui-default-800": "216.36 21.85% 70.39%",
- "--heroui-default-900": "216 26.32% 81.37%",
- "--heroui-default-foreground": "216 45.45% 97.84%",
- "--heroui-default": "222.5 17.65% 26.67%",
- },
- },
-
- "openhands-neutral": {
- label: "OpenHands-Neutral",
- scale: NEUTRAL_SCALE,
- // Each stop follows the same positional mapping as hero.ts:
- // heroui-default-100 ← cool-grey-950 position ← neutral-950 (#181818)
- // heroui-default-200 ← cool-grey-925 position ← neutral-900 (#202020)
- // ...etc.
- heroui: NEUTRAL_HEROUI,
- },
-
- "openhands-neo": {
- label: "OpenHands-Neo",
- scale: NEUTRAL_SCALE,
- heroui: NEUTRAL_HEROUI,
- tokens: NEO_WHITE_BUTTON_TOKENS,
- },
-};
-
-export const DEFAULT_COLOR_THEME: ColorThemeKey = "openhands-neutral";
-
-export const AVAILABLE_COLOR_THEMES = Object.entries(COLOR_THEMES).map(
- ([key, def]) => ({ key: key as ColorThemeKey, label: def.label }),
-);
-
-const STORAGE_KEY = "openhands-color-theme";
-
-/** Read the persisted theme key from localStorage, falling back to the default. */
-export function readPersistedColorTheme(): ColorThemeKey {
- if (typeof window === "undefined") return DEFAULT_COLOR_THEME;
- try {
- const stored = window.localStorage.getItem(STORAGE_KEY);
- if (stored && stored in COLOR_THEMES) return stored as ColorThemeKey;
- } catch {
- // ignore quota / privacy-mode failures
- }
- return DEFAULT_COLOR_THEME;
-}
-
-/** Persist the theme key to localStorage. */
-export function persistColorTheme(key: ColorThemeKey): void {
- try {
- window.localStorage.setItem(STORAGE_KEY, key);
- } catch {
- // ignore
- }
-}
-
-const THEME_STYLE_TAG_ID = "oh-color-theme-override";
-
/**
- * Apply a theme by injecting (or replacing) a <style> tag that overrides
- * both our custom --cool-grey-* primitives and HeroUI's --heroui-* tokens.
+ * Public entrypoint for the color theme system.
*
- * Why a <style> tag:
- * PostCSS transforms :root / body to [data-agent-server-ui], so --cool-grey-*
- * is set on EVERY element carrying that attribute. A body inline-style only
- * overrides body itself β€” inner matching elements keep the stylesheet value.
+ * The implementation lives in `./color-theme/`: one module per theme under
+ * `definitions/`, shared palettes under `palettes/`, the type contract in
+ * `types.ts`, and the apply/persist machinery in `runtime.ts`.
*
- * Why heroui variables:
- * HeroUI stores colors as HSL channels in --heroui-* vars on [data-theme=dark].
- * They reference their own token system and are unaffected by --cool-grey-*
- * changes, so we override them from the same injected sheet.
- *
- * Why doubled selectors + re-append on every call:
- * "Later sheet wins the tie" cannot be relied on: in the built SPA
- * (ssr:false, prerendered shell) React 19 re-creates the <head> elements it
- * manages (<Meta/>/<Links/>) whenever the tree above the router remounts.
- * That can re-insert the base stylesheet <link> AFTER this tag, allowing its
- * unlayered [data-agent-server-ui] variable rules (0,1,0) to win every tie.
- * Doubling the attribute selectors ([x][x], 0,2,0) beats them from any
- * position in <head>; re-appending on each apply keeps document order
- * favorable as well.
+ * Consumers import from here, not from the internals.
*/
-export function applyColorTheme(key: ColorThemeKey): void {
- if (typeof document === "undefined") return;
- const { scale, heroui, tokens = {} } = COLOR_THEMES[key];
-
- const scaleDecls = Object.entries(scale)
- .map(([p, v]) => ` ${p}: ${v};`)
- .join("\n");
-
- const herouiDecls = Object.entries(heroui)
- .map(([p, v]) => ` ${p}: ${v};`)
- .join("\n");
-
- const tokenDecls = Object.entries(tokens)
- .map(([p, v]) => ` ${p}: ${v};`)
- .join("\n");
-
- // Target both selectors for heroui vars:
- // [data-agent-server-ui] β€” covers document.body (portal destination) so
- // portalled popover/listbox content inherits the overridden values.
- // [data-theme=dark] β€” covers the inner AgentServerUIRoot wrapper so
- // components scoped inside the dark theme wrapper also pick them up.
- // Both are doubled to out-specify the base sheet regardless of stylesheet
- // order (see the doc comment above).
- const css = [
- `[data-agent-server-ui][data-agent-server-ui] {\n${scaleDecls}\n${herouiDecls}\n${tokenDecls}\n}`,
- `[data-theme=dark][data-theme=dark] {\n${herouiDecls}\n}`,
- ].join("\n");
-
- let styleEl = document.getElementById(
- THEME_STYLE_TAG_ID,
- ) as HTMLStyleElement | null;
- if (!styleEl) {
- styleEl = document.createElement("style");
- styleEl.id = THEME_STYLE_TAG_ID;
- }
- styleEl.textContent = css;
- // Re-append even when the tag already exists (appendChild relocates a
- // connected node) so the override also stays after any re-inserted <link>.
- document.head.appendChild(styleEl);
-
- syncColorThemeTokensOnScopeRoots(tokens);
-}
-
-function syncColorThemeTokensOnScopeRoots(
- tokens: Record<string, string>,
-): void {
- const roots = document.querySelectorAll("[data-agent-server-ui]");
- for (const root of roots) {
- if (!(root instanceof HTMLElement)) continue;
-
- for (const key of COLOR_THEME_TOKEN_KEYS) {
- const value = tokens[key];
- if (value) {
- root.style.setProperty(key, value);
- } else {
- root.style.removeProperty(key);
- }
- }
- }
-}
+export {
+ type ColorThemeAppearance,
+ type ColorThemeDefinition,
+ type ColorThemeKey,
+} from "./color-theme/types";
+
+export {
+ AVAILABLE_COLOR_THEMES,
+ COLOR_THEMES,
+ DEFAULT_COLOR_THEME,
+} from "./color-theme/definitions";
+
+export {
+ applyColorTheme,
+ COLOR_THEME_BOOTSTRAP_SCRIPT,
+ getColorThemeCss,
+ getActiveColorTheme,
+ persistColorTheme,
+ readPersistedColorTheme,
+ setColorTheme,
+ subscribeColorTheme,
+} from "./color-theme/runtime";
diff --git a/src/themes/syntax-highlighter-themes.test.ts b/src/themes/syntax-highlighter-themes.test.ts
new file mode 100644
index 0000000000..34910266f2
--- /dev/null
+++ b/src/themes/syntax-highlighter-themes.test.ts
@@ -0,0 +1,15 @@
+import { describe, expect, it } from "vitest";
+import {
+ solarizedlight,
+ vs,
+ vscDarkPlus,
+} from "react-syntax-highlighter/dist/esm/styles/prism";
+import { getSyntaxHighlighterTheme } from "#/themes/syntax-highlighter-themes";
+
+describe("getSyntaxHighlighterTheme", () => {
+ it("maps the app themes to matching Prism palettes", () => {
+ expect(getSyntaxHighlighterTheme("light-plus")).toBe(vs);
+ expect(getSyntaxHighlighterTheme("solarized-light")).toBe(solarizedlight);
+ expect(getSyntaxHighlighterTheme("openhands-neutral")).toBe(vscDarkPlus);
+ });
+});
diff --git a/src/themes/syntax-highlighter-themes.ts b/src/themes/syntax-highlighter-themes.ts
new file mode 100644
index 0000000000..b6eaff4f73
--- /dev/null
+++ b/src/themes/syntax-highlighter-themes.ts
@@ -0,0 +1,19 @@
+import {
+ solarizedlight,
+ vs,
+ vscDarkPlus,
+} from "react-syntax-highlighter/dist/esm/styles/prism";
+import type { ColorThemeKey } from "#/themes/color-themes";
+
+// Exhaustive: adding a Canvas theme requires an explicit syntax palette.
+const SYNTAX_THEMES: Record<ColorThemeKey, typeof vs> = {
+ "openhands-deepsea": vscDarkPlus,
+ "openhands-neutral": vscDarkPlus,
+ "openhands-neo": vscDarkPlus,
+ "light-plus": vs,
+ "solarized-light": solarizedlight,
+};
+
+export function getSyntaxHighlighterTheme(theme: ColorThemeKey) {
+ return SYNTAX_THEMES[theme];
+}
diff --git a/src/themes/terminal-themes.test.ts b/src/themes/terminal-themes.test.ts
new file mode 100644
index 0000000000..7224e4e7d7
--- /dev/null
+++ b/src/themes/terminal-themes.test.ts
@@ -0,0 +1,46 @@
+import { describe, expect, it } from "vitest";
+import { AVAILABLE_COLOR_THEMES } from "./color-themes";
+import { getTerminalTheme } from "./terminal-themes";
+
+const ansiSlots = [
+ "black",
+ "red",
+ "green",
+ "yellow",
+ "blue",
+ "magenta",
+ "cyan",
+ "white",
+ "brightBlack",
+ "brightRed",
+ "brightGreen",
+ "brightYellow",
+ "brightBlue",
+ "brightMagenta",
+ "brightCyan",
+ "brightWhite",
+] as const;
+
+describe("terminal themes", () => {
+ it.each(AVAILABLE_COLOR_THEMES)(
+ "defines every ANSI slot for $label",
+ ({ key }) => {
+ const theme = getTerminalTheme(key, "#123456");
+ for (const slot of ansiSlots)
+ expect(theme[slot]).toMatch(/^#[0-9a-f]{6}$/i);
+ expect(theme.foreground).toBe("#123456");
+ expect(theme.background).toBe("rgba(0, 0, 0, 0)");
+ },
+ );
+
+ it("resets all ANSI colors when switching back to dark", () => {
+ const original = getTerminalTheme("openhands-neutral", "#eeeeee");
+ const terminalOptions = { ...original };
+ Object.assign(terminalOptions, getTerminalTheme("light-plus", "#111111"));
+ Object.assign(
+ terminalOptions,
+ getTerminalTheme("openhands-neutral", "#eeeeee"),
+ );
+ expect(terminalOptions).toEqual(original);
+ });
+});
diff --git a/src/themes/terminal-themes.ts b/src/themes/terminal-themes.ts
new file mode 100644
index 0000000000..101a31f462
--- /dev/null
+++ b/src/themes/terminal-themes.ts
@@ -0,0 +1,84 @@
+import type { ITheme } from "@xterm/xterm";
+import { COLOR_THEMES, type ColorThemeKey } from "./color-themes";
+
+// Specify every ANSI slot so switching back to dark also resets light colors.
+const dark: ITheme = {
+ black: "#000000",
+ red: "#cd0000",
+ green: "#00cd00",
+ yellow: "#cdcd00",
+ blue: "#0000ee",
+ magenta: "#cd00cd",
+ cyan: "#00cdcd",
+ white: "#e5e5e5",
+ brightBlack: "#7f7f7f",
+ brightRed: "#ff0000",
+ brightGreen: "#00ff00",
+ brightYellow: "#ffff00",
+ brightBlue: "#5c5cff",
+ brightMagenta: "#ff00ff",
+ brightCyan: "#00ffff",
+ brightWhite: "#ffffff",
+};
+
+const light: ITheme = {
+ black: "#1f1f1f",
+ red: "#a31515",
+ green: "#167040",
+ yellow: "#795e00",
+ blue: "#0451a5",
+ magenta: "#800080",
+ cyan: "#006b73",
+ white: "#616161",
+ brightBlack: "#616161",
+ brightRed: "#b52020",
+ brightGreen: "#12743c",
+ brightYellow: "#806000",
+ brightBlue: "#005cc5",
+ brightMagenta: "#950095",
+ brightCyan: "#007880",
+ brightWhite: "#424242",
+};
+
+const solarized: ITheme = {
+ black: "#073642",
+ red: "#b52624",
+ green: "#586e00",
+ yellow: "#826200",
+ blue: "#006ab1",
+ magenta: "#a72d70",
+ cyan: "#147a74",
+ white: "#586e75",
+ brightBlack: "#657b83",
+ brightRed: "#b84313",
+ brightGreen: "#657b00",
+ brightYellow: "#936f00",
+ brightBlue: "#0879ba",
+ brightMagenta: "#6c71c4",
+ brightCyan: "#16827a",
+ brightWhite: "#002b36",
+};
+
+const palettes: Record<ColorThemeKey, ITheme> = {
+ "openhands-deepsea": dark,
+ "openhands-neutral": dark,
+ "openhands-neo": dark,
+ "light-plus": light,
+ "solarized-light": solarized,
+};
+
+export function getTerminalTheme(
+ key: ColorThemeKey,
+ foreground: string,
+): ITheme {
+ return {
+ ...palettes[key],
+ background: "rgba(0, 0, 0, 0)",
+ foreground,
+ cursor: foreground,
+ selectionBackground:
+ COLOR_THEMES[key].appearance === "light"
+ ? "rgba(0, 80, 160, 0.2)"
+ : "rgba(255, 255, 255, 0.25)",
+ };
+}
diff --git a/src/ui/dropdown/clear-button.tsx b/src/ui/dropdown/clear-button.tsx
index 5e1aa5c4cd..7074f957ba 100644
--- a/src/ui/dropdown/clear-button.tsx
+++ b/src/ui/dropdown/clear-button.tsx
@@ -12,7 +12,7 @@ export function ClearButton({ onClear }: ClearButtonProps) {
onClick={onClear}
// eslint-disable-next-line i18next/no-literal-string -- i18n-free UI primitive; callers supply translated labels
aria-label="Clear selection"
- className="text-white hover:text-text-tertiary"
+ className="text-contrast hover:text-text-tertiary"
>
<X size={14} />
</button>
diff --git a/src/ui/dropdown/dropdown-input.tsx b/src/ui/dropdown/dropdown-input.tsx
index 5c4ab3ba1c..59e8cb3791 100644
--- a/src/ui/dropdown/dropdown-input.tsx
+++ b/src/ui/dropdown/dropdown-input.tsx
@@ -23,7 +23,7 @@ export function DropdownInput({
placeholder,
disabled: isDisabled,
className: cn(
- "outline-none bg-transparent text-white not-italic",
+ "outline-none bg-transparent text-contrast not-italic",
fitContent
? "w-auto field-sizing-content whitespace-nowrap text-sm"
: "flex-1 min-w-0",
diff --git a/src/ui/dropdown/dropdown-menu.tsx b/src/ui/dropdown/dropdown-menu.tsx
index 52977782ba..39e18bcae7 100644
--- a/src/ui/dropdown/dropdown-menu.tsx
+++ b/src/ui/dropdown/dropdown-menu.tsx
@@ -38,7 +38,7 @@ export function DropdownMenu({
return (
<div
className={cn(
- "absolute z-50 overflow-hidden text-white",
+ "absolute z-50 overflow-hidden text-contrast",
fitContent ? "min-w-full w-max" : "w-full",
openUpward ? "bottom-full mb-1" : "mt-1",
"bg-tertiary rounded-md context-menu-box-shadow p-1",
@@ -65,7 +65,7 @@ export function DropdownMenu({
dropdownMenuRowClassName,
"focus:outline-none",
selectedItem?.value === option.value &&
- "bg-interactive-selected text-white",
+ "bg-interactive-selected text-contrast",
),
})}
>
diff --git a/src/ui/dropdown/loading-spinner.tsx b/src/ui/dropdown/loading-spinner.tsx
index 6916a5aebb..5d76fe1979 100644
--- a/src/ui/dropdown/loading-spinner.tsx
+++ b/src/ui/dropdown/loading-spinner.tsx
@@ -1,7 +1,7 @@
export function LoadingSpinner() {
return (
<div
- className="animate-spin h-4 w-4 border-2 border-transparent border-t-white rounded-full"
+ className="animate-spin h-4 w-4 border-2 border-transparent border-t-contrast rounded-full"
data-testid="dropdown-loading"
/>
);
diff --git a/src/ui/help-link.tsx b/src/ui/help-link.tsx
index d5ab03b88f..701646c8b2 100644
--- a/src/ui/help-link.tsx
+++ b/src/ui/help-link.tsx
@@ -9,7 +9,7 @@ const helpLinkVariants = cva("", {
},
linkColor: {
default: "",
- white: "text-white",
+ white: "text-contrast",
},
},
defaultVariants: {
diff --git a/src/ui/toggle-switch.tsx b/src/ui/toggle-switch.tsx
index bb6cfc29e6..b9c570d5d4 100644
--- a/src/ui/toggle-switch.tsx
+++ b/src/ui/toggle-switch.tsx
@@ -25,8 +25,8 @@ export function ToggleSwitchVisual({
compact ? "h-3.5 w-6 p-0.75" : "h-5.5 w-10 border",
enabled
? compact
- ? "bg-white"
- : "border-white bg-white"
+ ? "bg-contrast"
+ : "border-contrast bg-contrast"
: compact
? "bg-border"
: "border-border bg-surface-raised",
diff --git a/src/ui/typography.tsx b/src/ui/typography.tsx
index 2959b8d432..027317a9ce 100644
--- a/src/ui/typography.tsx
+++ b/src/ui/typography.tsx
@@ -4,11 +4,11 @@ import { cn } from "#/utils/utils";
const typographyVariants = cva("", {
variants: {
variant: {
- h1: "text-[32px] text-white font-medium leading-5",
- h2: "text-xl font-medium leading-6 -tracking-[0.02em] text-white",
+ h1: "text-[32px] text-contrast font-medium leading-5",
+ h2: "text-xl font-medium leading-6 -tracking-[0.02em] text-contrast",
h3: "text-sm font-medium text-text-tertiary",
- span: "text-sm font-normal text-white leading-5.5",
- p: "text-sm font-normal text-white leading-5.5",
+ span: "text-sm font-normal text-contrast leading-5.5",
+ p: "text-sm font-normal text-contrast leading-5.5",
codeBlock:
"font-mono text-sm leading-relaxed text-text-tertiary whitespace-pre-wrap",
},
diff --git a/src/utils/dropdown-classes.ts b/src/utils/dropdown-classes.ts
index b2500a1d67..60c3c92677 100644
--- a/src/utils/dropdown-classes.ts
+++ b/src/utils/dropdown-classes.ts
@@ -22,12 +22,12 @@ export const dropdownTriggerShellClassName = cn(
"flex items-center gap-2",
formControlShellClassName,
dropdownInstantColorClassName,
- "group w-full gap-2 px-3 text-muted hover:text-white",
+ "group w-full gap-2 px-3 text-muted hover:text-contrast",
);
/** Standard white-label menu row. */
export const dropdownMenuRowClassName = cn(
- "group flex w-full cursor-pointer items-center rounded px-2 py-2 text-left text-sm font-normal text-white",
+ "group flex w-full cursor-pointer items-center rounded px-2 py-2 text-left text-sm font-normal text-contrast",
dropdownMenuRowGapClassName,
"hover:bg-interactive-hover disabled:cursor-not-allowed disabled:opacity-60",
dropdownInstantColorClassName,
@@ -44,7 +44,7 @@ export const dropdownMenuRowForegroundClassName = cn(
/** Icon inside a menu row β€” muted until row hover/focus. */
export const dropdownMenuRowIconClassName = cn(
- "shrink-0 text-muted group-hover:text-white group-focus-visible:text-white",
+ "shrink-0 text-muted group-hover:text-contrast group-focus-visible:text-contrast",
dropdownInstantColorClassName,
);
@@ -57,8 +57,8 @@ export const dropdownMenuRowIconWrapperClassName = cn(
/** Enum/filter dropdown trigger chip. */
export const dropdownFilterTriggerClassName = cn(
"inline-flex cursor-pointer items-center gap-1.5 rounded-lg border px-3 py-2 text-sm font-medium",
- "border-border bg-base-secondary text-white",
- "focus-visible:border-white/40 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-white/20",
+ "border-border bg-base-secondary text-contrast",
+ "focus-visible:border-contrast/40 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-contrast/20",
dropdownInstantColorClassName,
);
@@ -83,7 +83,7 @@ export const dropdownMenuViewportScrollClassName = cn(
/** Footer action row inside a dropdown panel. */
export const dropdownFooterActionClassName = cn(
- "group flex w-full items-center rounded-md px-2 py-2 text-sm font-normal text-white",
+ "group flex w-full items-center rounded-md px-2 py-2 text-sm font-normal text-contrast",
dropdownMenuRowGapClassName,
"hover:bg-interactive-hover",
dropdownInstantColorClassName,
diff --git a/src/utils/form-control-classes.ts b/src/utils/form-control-classes.ts
index 48e806e177..cc7d63a8b3 100644
--- a/src/utils/form-control-classes.ts
+++ b/src/utils/form-control-classes.ts
@@ -43,7 +43,7 @@ export const formControlTransformTransitionClassName = cn(
/** Muted icon/pill controls: instant foreground, fading shell on hover. */
export const formControlMutedHoverClassName =
- "hover:text-white hover:bg-white/10";
+ "hover:text-contrast hover:bg-contrast/10";
/** Text/icon pill triggers in the chat input actions row. */
export const chatInputPillButtonClassName = cn(
@@ -61,10 +61,10 @@ export const chatInputIconButtonClassName = cn(
);
export const formControlFocusClassName =
- "focus:border-white/40 focus:ring-1 focus:ring-white/20 focus:outline-none";
+ "focus:border-contrast/40 focus:ring-1 focus:ring-contrast/20 focus:outline-none";
export const formControlFocusWithinClassName =
- "focus-within:border-white/40 focus-within:ring-1 focus-within:ring-white/20";
+ "focus-within:border-contrast/40 focus-within:ring-1 focus-within:ring-contrast/20";
export const formControlDisabledClassName =
"disabled:cursor-not-allowed disabled:opacity-60";
@@ -78,7 +78,7 @@ export const formControlFieldClassName = cn(
formControlTransitionClassName,
formControlFocusClassName,
formControlDisabledClassName,
- "w-full min-w-0 px-3 text-sm text-white placeholder:text-tertiary-alt",
+ "w-full min-w-0 px-3 text-sm text-contrast placeholder:text-tertiary-alt",
);
/** Settings screens keep italic placeholders on form controls. */
@@ -96,7 +96,7 @@ export const formControlMultilineFieldClassName = cn(
formControlTransitionClassName,
formControlFocusClassName,
formControlDisabledClassName,
- "w-full min-w-0 px-3 py-2 text-sm text-white placeholder:text-tertiary-alt",
+ "w-full min-w-0 px-3 py-2 text-sm text-contrast placeholder:text-tertiary-alt",
);
/** Combobox / search shell (icon + input), e.g. skills toolbar. */
@@ -134,7 +134,7 @@ export const formControlFilterTriggerClassName = cn(
formControlButtonClassName,
formControlBorderClassName,
formControlSurfaceClassName,
- "shrink-0 text-white",
+ "shrink-0 text-contrast",
);
/** Muted back navigation control with tertiary hover fill (settings sub-pages, detail views). */
@@ -142,5 +142,5 @@ export const formControlBackNavButtonClassName = cn(
"inline-flex items-center gap-2 self-start rounded-lg p-2",
"text-sm font-normal leading-5 text-muted cursor-pointer",
formControlTransitionClassName,
- "hover:bg-tertiary hover:text-white",
+ "hover:bg-tertiary hover:text-contrast",
);
diff --git a/src/utils/git-control-bar-classes.ts b/src/utils/git-control-bar-classes.ts
index c6ad09fd6a..28fbab01df 100644
--- a/src/utils/git-control-bar-classes.ts
+++ b/src/utils/git-control-bar-classes.ts
@@ -7,13 +7,13 @@ export function gitControlBarActionButtonClassName(isEnabled: boolean) {
return cn(
gitControlBarActionButtonBaseClassName,
isEnabled
- ? "bg-surface hover:bg-tertiary cursor-pointer text-white"
+ ? "bg-surface hover:bg-tertiary cursor-pointer text-contrast"
: "bg-surface cursor-not-allowed opacity-50 text-muted",
);
}
export function gitControlBarActionIconColor(isEnabled: boolean) {
- return isEnabled ? "white" : "var(--oh-muted)";
+ return isEnabled ? "var(--oh-contrast)" : "var(--oh-muted)";
}
export const gitControlBarActionLabelClassName =
diff --git a/src/utils/settings-list-classes.ts b/src/utils/settings-list-classes.ts
index 51f7ae35ac..da3cf3a7bc 100644
--- a/src/utils/settings-list-classes.ts
+++ b/src/utils/settings-list-classes.ts
@@ -59,5 +59,5 @@ export const settingsListTableCellClassName = cn(
export const settingsListIconActionButtonClassName = cn(
"inline-flex cursor-pointer items-center justify-center rounded-md p-1 text-muted",
formControlTransitionClassName,
- "hover:bg-interactive-hover-low hover:text-white",
+ "hover:bg-interactive-hover-low hover:text-contrast",
);