{/* Clickable overlay for card */}
diff --git a/client/src/components/SidePanel/SidePanelGroup.tsx b/client/src/components/SidePanel/SidePanelGroup.tsx
index bf8961a767..55cb3448ba 100644
--- a/client/src/components/SidePanel/SidePanelGroup.tsx
+++ b/client/src/components/SidePanel/SidePanelGroup.tsx
@@ -31,7 +31,7 @@ const SidePanelGroup = memo(({ panel, children }: SidePanelProps) => {
{/* The surface behind the panels is this group's host, not the group
primitive: the resizer owns its own chrome, and the caller owns the
backdrop the panels sit on. */}
-
+
@@ -308,7 +308,7 @@ function SkillListItem({
className={cn(
'text-text-primary flex w-full items-center gap-1 rounded-lg pr-1 text-sm select-none',
isActive && !activeFile && 'bg-surface-active',
- !isActive && 'hover:bg-surface-active-alt',
+ !isActive && 'hover:bg-surface-nav-hover',
)}
>
,
onClick: () => {
if (link.onClick) {
diff --git a/client/src/style.css b/client/src/style.css
index 278d6db725..212c99cee4 100644
--- a/client/src/style.css
+++ b/client/src/style.css
@@ -2063,8 +2063,8 @@ html[data-input-modality='keyboard']
border-radius: var(--theme-menu-radius, 0.7rem);
border-width: 1px;
border-style: solid;
- border-color: rgb(var(--border-light) / var(--border-light-alpha, 1));
- background-color: rgb(var(--surface-primary));
+ border-color: rgb(var(--border-menu) / var(--border-menu-alpha, var(--border-light-alpha, 1)));
+ background-color: rgb(var(--surface-popover));
padding: 0.5rem;
color: rgb(var(--text-primary));
/* The `menuShadow` role, whose light default is this literal. */
@@ -2102,7 +2102,7 @@ html[data-input-modality='keyboard']
}
.popover-ui:where(.dark, .dark *) {
- background-color: rgb(var(--surface-secondary));
+ background-color: rgb(var(--surface-popover));
color: rgb(var(--text-secondary));
box-shadow: var(
--theme-menu-shadow,
diff --git a/e2e/specs/mock/scenarios/clickhouse-layers.spec.ts b/e2e/specs/mock/scenarios/clickhouse-layers.spec.ts
new file mode 100644
index 0000000000..1819c56bbe
--- /dev/null
+++ b/e2e/specs/mock/scenarios/clickhouse-layers.spec.ts
@@ -0,0 +1,92 @@
+import { expect, test } from '@playwright/test';
+import type { Page } from '@playwright/test';
+import { clickHouseTheme } from '../../../../packages/client/src/theme/themes/clickhouse';
+import { NEW_CHAT_PATH, messagesView, replyPrompt, replyText, sendMessage } from '../helpers';
+
+/**
+ * Click UI separates the chat canvas from the sidebar and sets the user turn apart from the
+ * canvas. LibreChat reads each of those layers from its own role, which follows the surface it
+ * painted before, so the default theme keeps its single flat layer.
+ */
+test.describe.configure({ timeout: 120_000 });
+test.use({ viewport: { width: 1280, height: 800 } });
+
+type Mode = 'light' | 'dark';
+
+type ThemeChoice = 'clickhouse' | 'default';
+
+async function installThemeBridge(page: Page) {
+ await page.addInitScript((definition) => {
+ const params = new URL(location.href).searchParams;
+ const theme = params.get('e2eTheme');
+ const mode = params.get('e2eThemeMode');
+ if (theme === null || mode === null) {
+ return;
+ }
+ localStorage.setItem('color-theme', mode);
+ localStorage.removeItem('theme-colors');
+ localStorage.removeItem('theme-name');
+ if (theme === 'clickhouse') {
+ localStorage.setItem('theme-definition', JSON.stringify(definition));
+ localStorage.setItem('theme-source', 'definition');
+ } else {
+ localStorage.removeItem('theme-definition');
+ localStorage.removeItem('theme-source');
+ }
+ }, clickHouseTheme);
+}
+
+async function openChatWithTurn(page: Page, theme: ThemeChoice, mode: Mode) {
+ await page.goto(`${NEW_CHAT_PATH}?e2eTheme=${theme}&e2eThemeMode=${mode}`, { timeout: 15000 });
+ const label = `layers-${theme}-${mode}`;
+ await sendMessage(page, replyPrompt(label));
+ await expect(messagesView(page).getByText(replyText(label))).toBeVisible({ timeout: 30000 });
+ await expect(page.locator('.bg-surface-user-message').first()).toBeVisible();
+}
+
+const paint = (page: Page, selector: string) =>
+ page
+ .locator(selector)
+ .first()
+ .evaluate((node) => getComputedStyle(node).backgroundColor);
+
+const rgb = (triplet: string | undefined) => `rgb(${(triplet ?? '').split(' ').join(', ')})`;
+
+const sidebar = 'nav.bg-surface-primary-alt';
+
+test.describe('layered surfaces', () => {
+ test('the canvas, sidebar and user turn take their own Click UI layers under the ClickHouse theme @scenario:clickhouse-layers-follow-click-ui', async ({
+ page,
+ }) => {
+ await installThemeBridge(page);
+ for (const mode of ['light', 'dark'] as Mode[]) {
+ await openChatWithTurn(page, 'clickhouse', mode);
+ await expect(page.locator('html')).toHaveAttribute('data-theme', 'clickhouse');
+ const colors = clickHouseTheme.modes[mode]?.colors ?? {};
+
+ const canvas = await paint(page, '.bg-surface-canvas');
+ expect(canvas).toBe(rgb(colors['rgb-surface-canvas']));
+ expect(await paint(page, sidebar)).toBe(rgb(colors['rgb-surface-primary-alt']));
+ expect(await paint(page, '.bg-surface-user-message')).toBe(
+ rgb(colors['rgb-surface-user-message']),
+ );
+ expect(canvas).not.toBe(await paint(page, sidebar));
+ expect(await paint(page, '.bg-surface-user-message')).not.toBe(canvas);
+ }
+ });
+
+ test('the default theme keeps one canvas and its user turn fill @scenario:default-theme-layers-unchanged', async ({
+ page,
+ }) => {
+ await installThemeBridge(page);
+ for (const [mode, bubble] of [
+ ['light', 'rgb(236, 236, 236)'],
+ ['dark', 'rgb(47, 47, 47)'],
+ ] as Array<[Mode, string]>) {
+ await openChatWithTurn(page, 'default', mode);
+
+ expect(await paint(page, '.bg-surface-canvas')).toBe(await paint(page, sidebar));
+ expect(await paint(page, '.bg-surface-user-message')).toBe(bubble);
+ }
+ });
+});
diff --git a/e2e/specs/mock/scenarios/deployment-theme-first-paint.spec.ts b/e2e/specs/mock/scenarios/deployment-theme-first-paint.spec.ts
index e7a1d2b0af..f66433a470 100644
--- a/e2e/specs/mock/scenarios/deployment-theme-first-paint.spec.ts
+++ b/e2e/specs/mock/scenarios/deployment-theme-first-paint.spec.ts
@@ -146,7 +146,7 @@ async function expectFirstPaint(page: Page, mode: Mode) {
expect(frame.theme).toBe('clickhouse');
expect(frame.surface).toBe(colors['rgb-surface-primary']);
if (frame.shell !== null) {
- expect(frame.shell).toBe(rgb(colors['rgb-surface-primary-alt']));
+ expect(frame.shell).toBe(rgb(colors['rgb-surface-canvas']));
}
}
await expect(page.locator('html')).toHaveAttribute('data-theme', 'clickhouse');
diff --git a/e2e/specs/mock/scenarios/message-theme.spec.ts b/e2e/specs/mock/scenarios/message-theme.spec.ts
index c87318d805..2a6a7ab9c1 100644
--- a/e2e/specs/mock/scenarios/message-theme.spec.ts
+++ b/e2e/specs/mock/scenarios/message-theme.spec.ts
@@ -124,7 +124,7 @@ for (const definition of ['stock', 'clickhouse'] as const) {
});
expect((await computedStyles(header, ['backgroundColor'])).backgroundColor).toBe(
- await probeStyle(page, 'bg-surface-primary-alt', 'background-color'),
+ await probeStyle(page, 'bg-surface-canvas', 'background-color'),
);
const heading = table.locator('th').first();
const headingStyles = await computedStyles(heading, [
diff --git a/e2e/specs/mock/scenarios/sidebar-active-row.spec.ts b/e2e/specs/mock/scenarios/sidebar-active-row.spec.ts
index 98a18a5fdb..ee93adb766 100644
--- a/e2e/specs/mock/scenarios/sidebar-active-row.spec.ts
+++ b/e2e/specs/mock/scenarios/sidebar-active-row.spec.ts
@@ -9,7 +9,7 @@ import { openSidebar } from './sidebar';
const userEmail = getE2EUser().email;
/** The row's own highlight, not its `hover:` variant, which every idle row carries. */
-const ACTIVE = /(^|\s)bg-surface-active-alt(\s|$)/;
+const ACTIVE = /(^|\s)bg-surface-nav-selected(\s|$)/;
const row = (page: Page, title: string) =>
page.getByTestId('convo-item').filter({ hasText: title }).filter({ visible: true }).first();
diff --git a/packages/client/src/components/Dropdown.css b/packages/client/src/components/Dropdown.css
index b125f9224c..3ecb80481b 100644
--- a/packages/client/src/components/Dropdown.css
+++ b/packages/client/src/components/Dropdown.css
@@ -8,8 +8,8 @@
border-radius: var(--theme-menu-radius, 0.7rem);
border-width: 1px;
border-style: solid;
- border-color: rgb(var(--border-light) / var(--border-light-alpha, 1));
- background-color: rgb(var(--surface-primary));
+ border-color: rgb(var(--border-menu) / var(--border-menu-alpha, var(--border-light-alpha, 1)));
+ background-color: rgb(var(--surface-popover));
padding: 0.5rem;
color: rgb(var(--text-primary));
/* The `menuShadow` role, whose light default is this literal. */
@@ -55,7 +55,7 @@ html.high-contrast .popover-ui {
}
.popover-ui:where(.dark, .dark *) {
- background-color: rgb(var(--surface-secondary));
+ background-color: rgb(var(--surface-popover));
color: rgb(var(--text-secondary));
box-shadow: var(
--theme-menu-shadow,
diff --git a/packages/client/src/theme/README.md b/packages/client/src/theme/README.md
index cc2aa8b55f..7d2e343697 100644
--- a/packages/client/src/theme/README.md
+++ b/packages/client/src/theme/README.md
@@ -387,6 +387,17 @@ Each status family has a foreground, a `-subtle` background, a `-border`, and a
(0.5rem, 0.25rem and 1rem by default).
- `bg-alert-error-fill` / `border-alert-error-border` - The error `Alert`'s fill and edge. They
follow `status-error-subtle` and `status-error-border`, which the badges, tags and diffs keep.
+- Layering roles - `bg-surface-canvas` (the chat canvas and its header fade),
+ `bg-surface-user-message` (the user turn's bubble), `bg-surface-card` and
+ `bg-surface-card-hover` (marketplace cards), `bg-surface-nav-hover` and
+ `bg-surface-nav-selected` (sidebar, rail and drawer rows), `bg-surface-tab-selected`
+ (the settings tab rail), `bg-surface-menu` and `bg-surface-popover` with `border-border-menu` (menu and popover
+ panels), `bg-surface-composer` (the composer box) and `bg-surface-search` (the sidebar
+ search pill). Each follows the surface it painted before it had a name
+ (`surface-primary-alt`, `surface-tertiary`, `surface-secondary`, `surface-active-alt`,
+ `presentation` for menus, `surface-primary` or `surface-secondary` for popovers, `border-light`, `surface-chat`),
+ so a theme that repaints that surface keeps the layer on it, and a theme steps the layers
+ apart by naming them.
- `border-border-field-focus` - A form field's edge while it holds focus, under
`fieldFocusStyle: border`. Follows `focus-control` when a theme names only that.
- Form fields and labels - `h-theme-field` (`fieldHeight`) sizes `Input`, `Dropdown`
diff --git a/packages/client/src/theme/defaults.css b/packages/client/src/theme/defaults.css
index 00544ddc38..b6d58f7d78 100644
--- a/packages/client/src/theme/defaults.css
+++ b/packages/client/src/theme/defaults.css
@@ -162,6 +162,18 @@ html {
--text-tooltip: var(--text-primary);
--alert-error-fill: var(--status-error-subtle);
--alert-error-border: var(--status-error-border);
+ --surface-canvas: var(--surface-primary-alt);
+ --surface-user-message: var(--surface-tertiary);
+ --surface-card: var(--surface-secondary);
+ --surface-card-hover: var(--surface-tertiary);
+ --surface-nav-hover: var(--surface-active-alt);
+ --surface-nav-selected: var(--surface-active-alt);
+ --surface-tab-selected: var(--surface-tertiary);
+ --surface-menu: var(--presentation);
+ --surface-popover: var(--surface-primary);
+ --border-menu: var(--border-light);
+ --surface-composer: var(--surface-chat);
+ --surface-search: var(--surface-secondary);
--focus-control: var(--gray-800);
--border-disabled: var(--gray-200);
--status-success: var(--green-700);
@@ -416,6 +428,18 @@ html {
--text-tooltip: var(--text-primary);
--alert-error-fill: var(--status-error-subtle);
--alert-error-border: var(--status-error-border);
+ --surface-canvas: var(--surface-primary-alt);
+ --surface-user-message: var(--surface-tertiary);
+ --surface-card: var(--surface-secondary);
+ --surface-card-hover: var(--surface-tertiary);
+ --surface-nav-hover: var(--surface-active-alt);
+ --surface-nav-selected: var(--surface-active-alt);
+ --surface-tab-selected: var(--surface-tertiary);
+ --surface-menu: var(--presentation);
+ --surface-popover: var(--surface-secondary);
+ --border-menu: var(--border-light);
+ --surface-composer: var(--surface-chat);
+ --surface-search: var(--surface-secondary);
--focus-control: var(--gray-100);
--border-disabled: var(--gray-650);
--status-success: var(--green-300);
@@ -487,11 +511,36 @@ html {
/* A root other than the document one that a legacy palette themes (`THEME_SCOPE_ATTRIBUTE` in
utils/applyTheme.ts) keeps its avatar backdrop on its own surfaces, following the mode, as the
- document root's alias above does. An explicit avatar-placeholder set inline still wins. */
+ document root's alias above does. The layering roles alias their source the same way, so a
+ scoped palette that repaints the source moves them. An explicit role set inline still wins. */
[data-theme-scope] {
--avatar-placeholder: var(--surface-secondary);
+ --surface-canvas: var(--surface-primary-alt);
+ --surface-user-message: var(--surface-tertiary);
+ --surface-card: var(--surface-secondary);
+ --surface-card-hover: var(--surface-tertiary);
+ --surface-nav-hover: var(--surface-active-alt);
+ --surface-nav-selected: var(--surface-active-alt);
+ --surface-tab-selected: var(--surface-tertiary);
+ --surface-menu: var(--presentation);
+ --surface-popover: var(--surface-primary);
+ --border-menu: var(--border-light);
+ --surface-composer: var(--surface-chat);
+ --surface-search: var(--surface-secondary);
}
.dark [data-theme-scope],
[data-theme-scope].dark {
--avatar-placeholder: var(--surface-tertiary);
+ --surface-canvas: var(--surface-primary-alt);
+ --surface-user-message: var(--surface-tertiary);
+ --surface-card: var(--surface-secondary);
+ --surface-card-hover: var(--surface-tertiary);
+ --surface-nav-hover: var(--surface-active-alt);
+ --surface-nav-selected: var(--surface-active-alt);
+ --surface-tab-selected: var(--surface-tertiary);
+ --surface-menu: var(--presentation);
+ --surface-popover: var(--surface-secondary);
+ --border-menu: var(--border-light);
+ --surface-composer: var(--surface-chat);
+ --surface-search: var(--surface-secondary);
}
diff --git a/packages/client/src/theme/defaults.spec.ts b/packages/client/src/theme/defaults.spec.ts
index fd3e28be3a..ba086d05dc 100644
--- a/packages/client/src/theme/defaults.spec.ts
+++ b/packages/client/src/theme/defaults.spec.ts
@@ -68,7 +68,7 @@ describe.each([
const tokens = Object.keys(theme) as Array;
it('covers every registry color', () => {
- expect(tokens).toHaveLength(135);
+ expect(tokens).toHaveLength(147);
});
it('resolves every registry color to the runtime theme value', () => {
diff --git a/packages/client/src/theme/highContrast.css b/packages/client/src/theme/highContrast.css
index ca67bf3e28..e019680592 100644
--- a/packages/client/src/theme/highContrast.css
+++ b/packages/client/src/theme/highContrast.css
@@ -39,7 +39,8 @@
html.high-contrast [data-active-item],
html.high-contrast .select-item:focus-visible,
html.high-contrast [data-state='selected'],
-html.high-contrast :is(.bg-surface-active, .bg-surface-active-alt):not(span) {
+html.high-contrast
+ :is(.bg-surface-active, .bg-surface-active-alt, .bg-surface-nav-selected):not(span) {
outline: 3px solid rgb(var(--text-primary)) !important;
outline-offset: -3px;
}
@@ -50,7 +51,7 @@ html.high-contrast :is(.bg-surface-active, .bg-surface-active-alt):not(span) {
* fragment separately. It still needs a cue, so it inverts instead — the same
* treatment the mode gives `::selection`, 21:1 and with no geometry to wrap.
*/
-html.high-contrast span:is(.bg-surface-active, .bg-surface-active-alt) {
+html.high-contrast span:is(.bg-surface-active, .bg-surface-active-alt, .bg-surface-nav-selected) {
background-color: rgb(var(--text-primary));
color: rgb(var(--surface-primary));
}
diff --git a/packages/client/src/theme/registry.spec.ts b/packages/client/src/theme/registry.spec.ts
index c0f9afb4ec..f83c2b6d55 100644
--- a/packages/client/src/theme/registry.spec.ts
+++ b/packages/client/src/theme/registry.spec.ts
@@ -10,6 +10,7 @@ import {
fromLegacyTheme,
libreChatTheme,
resolveTheme,
+ layerRoleSources,
themeColorTokens,
validateThemeDefinition,
} from './registry';
@@ -1000,6 +1001,62 @@ describe('theme registry', () => {
});
});
+ describe('layering roles', () => {
+ const layerTheme = (modes: ThemeDefinition['modes']): ThemeDefinition => ({
+ version: 1,
+ name: 'layering-reference',
+ modes,
+ });
+
+ it('resolves every layer to the surface it followed before it had a name', () => {
+ for (const mode of ['light', 'dark'] as const) {
+ const { colors } = resolveTheme(layerTheme({}), mode);
+ layerRoleSources.forEach(([role, light, dark]) => {
+ expect([role, colors[role]]).toEqual([role, colors[mode === 'dark' ? dark : light]]);
+ });
+ }
+ });
+
+ it('names the legacy surface of each layer outright', () => {
+ const legacy: Record = {
+ 'rgb-surface-canvas': ['rgb-surface-primary-alt', 'rgb-surface-primary-alt'],
+ 'rgb-surface-user-message': ['rgb-surface-tertiary', 'rgb-surface-tertiary'],
+ 'rgb-surface-card': ['rgb-surface-secondary', 'rgb-surface-secondary'],
+ 'rgb-surface-card-hover': ['rgb-surface-tertiary', 'rgb-surface-tertiary'],
+ 'rgb-surface-nav-hover': ['rgb-surface-active-alt', 'rgb-surface-active-alt'],
+ 'rgb-surface-nav-selected': ['rgb-surface-active-alt', 'rgb-surface-active-alt'],
+ 'rgb-surface-tab-selected': ['rgb-surface-tertiary', 'rgb-surface-tertiary'],
+ 'rgb-surface-menu': ['rgb-presentation', 'rgb-presentation'],
+ 'rgb-surface-popover': ['rgb-surface-primary', 'rgb-surface-secondary'],
+ 'rgb-border-menu': ['rgb-border-light', 'rgb-border-light'],
+ 'rgb-surface-composer': ['rgb-surface-chat', 'rgb-surface-chat'],
+ 'rgb-surface-search': ['rgb-surface-secondary', 'rgb-surface-secondary'],
+ };
+ expect(
+ Object.fromEntries(layerRoleSources.map(([role, light, dark]) => [role, [light, dark]])),
+ ).toEqual(legacy);
+ });
+
+ it('keeps a theme that repaints a surface on that layer, and lets it name the role', () => {
+ const { colors } = resolveTheme(
+ layerTheme({
+ light: {
+ colors: {
+ 'rgb-surface-tertiary': '10 20 30',
+ 'rgb-surface-primary-alt': '40 50 60',
+ 'rgb-surface-card-hover': '1 2 3',
+ },
+ },
+ }),
+ 'light',
+ );
+ expect(colors['rgb-surface-user-message']).toBe('10 20 30');
+ expect(colors['rgb-surface-tab-selected']).toBe('10 20 30');
+ expect(colors['rgb-surface-canvas']).toBe('40 50 60');
+ expect(colors['rgb-surface-card-hover']).toBe('1 2 3');
+ });
+ });
+
describe('field fill and ink', () => {
const fieldTheme = (modes: ThemeDefinition['modes']): ThemeDefinition => ({
version: 1,
diff --git a/packages/client/src/theme/registry.ts b/packages/client/src/theme/registry.ts
index e36bcaabe5..e2bf86ff33 100644
--- a/packages/client/src/theme/registry.ts
+++ b/packages/client/src/theme/registry.ts
@@ -118,6 +118,37 @@ export function primaryButtonFallbacks(colors: IThemeRGB): IThemeRGB {
};
}
+/**
+ * Layering roles split out of the surface a component painted before each had a name: the role,
+ * and the surface it followed in light and in dark. A theme that repaints the surface keeps the
+ * layer on it, unless it names the role.
+ */
+export const layerRoleSources: ReadonlyArray<
+ readonly [keyof IThemeRGB, keyof IThemeRGB, keyof IThemeRGB]
+> = [
+ ['rgb-surface-canvas', 'rgb-surface-primary-alt', 'rgb-surface-primary-alt'],
+ ['rgb-surface-user-message', 'rgb-surface-tertiary', 'rgb-surface-tertiary'],
+ ['rgb-surface-card', 'rgb-surface-secondary', 'rgb-surface-secondary'],
+ ['rgb-surface-card-hover', 'rgb-surface-tertiary', 'rgb-surface-tertiary'],
+ ['rgb-surface-nav-hover', 'rgb-surface-active-alt', 'rgb-surface-active-alt'],
+ ['rgb-surface-nav-selected', 'rgb-surface-active-alt', 'rgb-surface-active-alt'],
+ ['rgb-surface-tab-selected', 'rgb-surface-tertiary', 'rgb-surface-tertiary'],
+ ['rgb-surface-menu', 'rgb-presentation', 'rgb-presentation'],
+ ['rgb-surface-popover', 'rgb-surface-primary', 'rgb-surface-secondary'],
+ ['rgb-border-menu', 'rgb-border-light', 'rgb-border-light'],
+ ['rgb-surface-composer', 'rgb-surface-chat', 'rgb-surface-chat'],
+ ['rgb-surface-search', 'rgb-surface-secondary', 'rgb-surface-secondary'],
+];
+
+export function layerRoleFallbacks(colors: IThemeRGB, mode: ThemeMode): IThemeRGB {
+ return Object.fromEntries(
+ layerRoleSources.flatMap(([role, light, dark]) => {
+ const source = colors[mode === 'dark' ? dark : light];
+ return colors[role] === undefined && source !== undefined ? [[role, source]] : [];
+ }),
+ );
+}
+
/** Inks split out of the primary one: dialog titles, badge labels, the default avatar's glyph and
* a field's typed value were all set in it. */
export const primaryInkRoles: ReadonlyArray = [
@@ -688,6 +719,8 @@ export function resolveTheme(theme: ThemeDefinition, mode: ThemeMode): ResolvedT
customColors != null ? controlBorderFallback(customColors) : undefined;
const borderControlFallback: IThemeRGB =
borderControlSource !== undefined ? { 'rgb-border-control': borderControlSource } : {};
+ const layerFallback: IThemeRGB =
+ customColors != null ? layerRoleFallbacks(customColors, mode) : {};
const focusFallback: IThemeRGB = customColors != null ? focusFallbacks(customColors) : {};
const pressedFallback: IThemeRGB = customColors != null ? pressedFallbacks(customColors) : {};
const primaryButtonFallback: IThemeRGB =
@@ -759,6 +792,7 @@ export function resolveTheme(theme: ThemeDefinition, mode: ThemeMode): ResolvedT
...switchThumbFallback,
...fieldFillFallback,
...overlayFallback,
+ ...layerFallback,
...tableHeaderTextFallback,
...tableHeaderFillFallback,
...borderControlFallback,
diff --git a/packages/client/src/theme/themes/clickhouse.spec.tsx b/packages/client/src/theme/themes/clickhouse.spec.tsx
index 4f29c10f56..db34a3129a 100644
--- a/packages/client/src/theme/themes/clickhouse.spec.tsx
+++ b/packages/client/src/theme/themes/clickhouse.spec.tsx
@@ -30,6 +30,13 @@ const canvasSurfaces: Array = [
'rgb-surface-code',
'rgb-surface-code-body',
'rgb-presentation',
+ 'rgb-surface-canvas',
+ 'rgb-surface-card',
+ 'rgb-surface-card-hover',
+ 'rgb-surface-menu',
+ 'rgb-surface-popover',
+ 'rgb-surface-composer',
+ 'rgb-surface-search',
];
/** Fills a row or menu item takes on hover or selection, which carry the
@@ -45,6 +52,10 @@ const interactiveFills: Array = [
'rgb-header-primary',
'rgb-header-hover',
'rgb-header-button-hover',
+ 'rgb-surface-user-message',
+ 'rgb-surface-nav-hover',
+ 'rgb-surface-nav-selected',
+ 'rgb-surface-tab-selected',
];
const neutralTextTokens: Array = [
@@ -174,6 +185,19 @@ describe.each(modes)('clickhouse %s palette', (_mode, theme) => {
expect(below(theme, WCAG_AA_NORMAL, neutralTextTokens, canvasSurfaces)).toEqual([]);
});
+ it('steps each layer off the one it sits on, so hover and selection stay apart', () => {
+ const layers: Array<[keyof IThemeRGB, keyof IThemeRGB]> = [
+ ['rgb-surface-user-message', 'rgb-surface-canvas'],
+ ['rgb-surface-card-hover', 'rgb-surface-card'],
+ ['rgb-surface-nav-selected', 'rgb-surface-nav-hover'],
+ ['rgb-surface-nav-hover', 'rgb-surface-primary-alt'],
+ ['rgb-surface-tab-selected', 'rgb-surface-dialog'],
+ ['rgb-surface-search', 'rgb-surface-primary-alt'],
+ ['rgb-border-menu', 'rgb-surface-menu'],
+ ];
+ expect(layers.filter(([layer, ground]) => theme[layer] === theme[ground])).toEqual([]);
+ });
+
it('keeps primary text at WCAG AA on hover, selected and header fills', () => {
expect(below(theme, WCAG_AA_NORMAL, ['rgb-text-primary'], interactiveFills)).toEqual([]);
});
diff --git a/packages/client/src/theme/themes/clickhouse.ts b/packages/client/src/theme/themes/clickhouse.ts
index 88f2ad4bc2..3c4b792d3a 100644
--- a/packages/client/src/theme/themes/clickhouse.ts
+++ b/packages/client/src/theme/themes/clickhouse.ts
@@ -116,6 +116,19 @@ export const clickHouseLightTheme: IThemeRGB = {
'rgb-text-tooltip': '255 255 255', // #ffffff (tooltip.color.label.default)
'rgb-alert-error-fill': '255 233 233', // #ffe9e9 (alert.color.background.danger, danger at 10% over background.default)
'rgb-alert-error-border': '255 233 233', // #ffe9e9 (Click UI alerts draw no edge, so it matches the fill)
+ // Layering roles
+ 'rgb-surface-canvas': '255 255 255', // #ffffff (background.default)
+ 'rgb-surface-user-message': '230 231 233', // #e6e7e9 (palette.slate.100, the sidebar.main.navigation.item active step; Click UI has no chat bubble)
+ 'rgb-surface-card': '255 255 255', // #ffffff (card.secondary.color.background.default)
+ 'rgb-surface-card-hover': '246 247 250', // #f6f7fa (card.secondary.color.background.hover)
+ 'rgb-surface-nav-hover': '236 237 240', // #ecedf0 (sidebar.main.navigation.item.color.background.hover, lch(91.609 1.1023 265.86 / 0.6) composited on background.split)
+ 'rgb-surface-nav-selected': '230 231 233', // #e6e7e9 (sidebar.main.navigation.item.color.background.active)
+ 'rgb-surface-tab-selected': '230 231 233', // #e6e7e9 (sidebar.main.navigation.item.color.background.active)
+ 'rgb-surface-menu': '255 255 255', // #ffffff (genericMenu.panel.color.background.default)
+ 'rgb-surface-popover': '255 255 255', // #ffffff (genericMenu.panel.color.background.default)
+ 'rgb-border-menu': '230 231 233', // #e6e7e9 (genericMenu.panel.color.stroke.default)
+ 'rgb-surface-composer': '255 255 255', // #ffffff (background.default)
+ 'rgb-surface-search': '255 255 255', // #ffffff (background.default)
'rgb-surface-disabled': '223 223 223', // #dfdfdf (button.basic.color.primary.background.disabled)
'rgb-text-disabled': '160 160 160', // #a0a0a0 (text.disabled)
'rgb-border-disabled': '223 223 223', // #dfdfdf (field.color.stroke.disabled)
@@ -282,6 +295,19 @@ export const clickHouseDarkTheme: IThemeRGB = {
'rgb-text-tooltip': '255 255 255', // #ffffff (tooltip.color.label.default)
'rgb-alert-error-fill': '76 32 29', // #4c201d (alert.color.background.danger, danger at 20% over background.default)
'rgb-alert-error-border': '76 32 29', // #4c201d (Click UI alerts draw no edge, so it matches the fill)
+ // Layering roles
+ 'rgb-surface-canvas': '31 31 28', // #1f1f1c (background.default)
+ 'rgb-surface-user-message': '50 50 50', // #323232 (palette.neutral.712)
+ 'rgb-surface-card': '31 31 28', // #1f1f1c (card.secondary.color.background.default)
+ 'rgb-surface-card-hover': '40 40 40', // #282828 (card.secondary.color.background.hover)
+ 'rgb-surface-nav-hover': '46 46 46', // #2e2e2e (sidebar.main.navigation.item.color.background.hover, lch(19.05 0 none))
+ 'rgb-surface-nav-selected': '55 55 55', // #373737 (sidebar.main.navigation.item.color.background.active, lch(27.535 0 none / 0.6) composited on background.split)
+ 'rgb-surface-tab-selected': '50 50 50', // #323232 (palette.neutral.712)
+ 'rgb-surface-menu': '40 40 40', // #282828 (genericMenu.panel.color.background.default)
+ 'rgb-surface-popover': '40 40 40', // #282828 (genericMenu.panel.color.background.default)
+ 'rgb-border-menu': '65 65 65', // #414141 (genericMenu.panel.color.stroke.default)
+ 'rgb-surface-composer': '45 45 45', // #2d2d2d (field.color.background.default)
+ 'rgb-surface-search': '45 45 45', // #2d2d2d (field.color.background.default)
'rgb-surface-disabled': '65 65 65', // #414141 (button.basic.color.primary.background.disabled)
'rgb-text-disabled': '128 128 128', // #808080 (text.disabled)
'rgb-border-disabled': '65 65 65', // #414141 (field.color.stroke.disabled)
diff --git a/packages/client/src/theme/themes/clickui.json b/packages/client/src/theme/themes/clickui.json
index f4ae894a76..9b12498730 100644
--- a/packages/client/src/theme/themes/clickui.json
+++ b/packages/client/src/theme/themes/clickui.json
@@ -28,6 +28,8 @@
"click.button.basic.space.x": "1rem",
"click.button.basic.typography.label.default": "400 0.875rem/1.5 \"Inter\", \"SF Pro Display\", -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Oxygen, Ubuntu, Cantarell, \"Open Sans\", \"Helvetica Neue\", sans-serif",
"click.button.iconButton.color.primary.background.active": "rgb(86.824% 87.176% 88.235%)",
+ "click.card.secondary.color.background.default": "#ffffff",
+ "click.card.secondary.color.background.hover": "#f6f7fa",
"click.checkbox.color.background.active": "#161517",
"click.checkbox.color.background.default": "#f6f7fa",
"click.checkbox.color.check.active": "#ffffff",
@@ -51,6 +53,8 @@
"click.field.color.text.default": "#302e32",
"click.field.space.y": "0.2813rem",
"click.field.typography.label.default": "500 0.75rem/1.5 \"Inter\", \"SF Pro Display\", -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Oxygen, Ubuntu, Cantarell, \"Open Sans\", \"Helvetica Neue\", sans-serif",
+ "click.genericMenu.panel.color.background.default": "#ffffff",
+ "click.genericMenu.panel.color.stroke.default": "#e6e7e9",
"click.genericMenu.panel.radii.all": "0.25rem",
"click.genericMenu.panel.shadow.default": "0 4px 6px -1px lch(6.7738 0 none / 0.15), 0 2px 4px -1px lch(6.7738 0 none / 0.15)",
"click.genericMenu.panel.size.height": "2rem",
@@ -59,6 +63,8 @@
"click.image.lg.size.width": "1.5rem",
"click.image.md.size.width": "1.25rem",
"click.image.sm.size.width": "1rem",
+ "click.sidebar.main.navigation.item.color.background.active": "#e6e7e9",
+ "click.sidebar.main.navigation.item.color.background.hover": "lch(91.609 1.1023 265.86 / 0.6)",
"click.switch.color.background.active": "#151515",
"click.switch.color.background.default": "#cccfd3",
"click.switch.color.indicator.default": "#ffffff",
@@ -185,6 +191,8 @@
"click.button.basic.space.x": "1rem",
"click.button.basic.typography.label.default": "400 0.875rem/1.5 \"Inter\", \"SF Pro Display\", -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Oxygen, Ubuntu, Cantarell, \"Open Sans\", \"Helvetica Neue\", sans-serif",
"click.button.iconButton.color.primary.background.active": "rgb(14.118% 14.118% 14.118%)",
+ "click.card.secondary.color.background.default": "#1f1f1c",
+ "click.card.secondary.color.background.hover": "#282828",
"click.checkbox.color.background.active": "#faff69",
"click.checkbox.color.background.default": "rgb(17.794% 17.794% 17.794%)",
"click.checkbox.color.check.active": "#151515",
@@ -208,6 +216,8 @@
"click.field.color.text.default": "#e6e7e9",
"click.field.space.y": "0.2813rem",
"click.field.typography.label.default": "500 0.75rem/1.5 \"Inter\", \"SF Pro Display\", -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Oxygen, Ubuntu, Cantarell, \"Open Sans\", \"Helvetica Neue\", sans-serif",
+ "click.genericMenu.panel.color.background.default": "#282828",
+ "click.genericMenu.panel.color.stroke.default": "#414141",
"click.genericMenu.panel.radii.all": "0.25rem",
"click.genericMenu.panel.shadow.default": "0 4px 6px -1px rgb(8.2353% 8.2353% 8.2353% / 0.6), 0 2px 4px -1px rgb(8.2353% 8.2353% 8.2353% / 0.6)",
"click.genericMenu.panel.size.height": "2rem",
@@ -216,6 +226,8 @@
"click.image.lg.size.width": "1.5rem",
"click.image.md.size.width": "1.25rem",
"click.image.sm.size.width": "1rem",
+ "click.sidebar.main.navigation.item.color.background.active": "lch(27.535 0 none / 0.6)",
+ "click.sidebar.main.navigation.item.color.background.hover": "lch(19.05 0 none)",
"click.switch.color.background.active": "#faff69",
"click.switch.color.background.default": "#606060",
"click.switch.color.indicator.default": "#151515",
diff --git a/packages/client/src/theme/themes/clickui.spec.ts b/packages/client/src/theme/themes/clickui.spec.ts
index 634b3f78fc..fc33402762 100644
--- a/packages/client/src/theme/themes/clickui.spec.ts
+++ b/packages/client/src/theme/themes/clickui.spec.ts
@@ -125,6 +125,17 @@ const colorSources: Record>>
'rgb-border-field-focus': 'click.field.color.stroke.active',
'rgb-field-fill': 'click.field.color.background.default',
'rgb-field-text': 'click.field.color.text.default',
+ 'rgb-surface-canvas': 'global.color.background.default',
+ 'rgb-surface-user-message': 'palette.slate.100',
+ 'rgb-surface-card': 'click.card.secondary.color.background.default',
+ 'rgb-surface-card-hover': 'click.card.secondary.color.background.hover',
+ 'rgb-surface-nav-selected': 'click.sidebar.main.navigation.item.color.background.active',
+ 'rgb-surface-tab-selected': 'click.sidebar.main.navigation.item.color.background.active',
+ 'rgb-surface-menu': 'click.genericMenu.panel.color.background.default',
+ 'rgb-surface-popover': 'click.genericMenu.panel.color.background.default',
+ 'rgb-border-menu': 'click.genericMenu.panel.color.stroke.default',
+ 'rgb-surface-composer': 'global.color.background.default',
+ 'rgb-surface-search': 'global.color.background.default',
'rgb-surface-disabled': 'click.button.basic.color.primary.background.disabled',
'rgb-text-disabled': 'global.color.text.disabled',
'rgb-border-disabled': 'click.field.color.stroke.disabled',
@@ -257,6 +268,17 @@ const colorSources: Record>>
'rgb-border-field-focus': 'click.field.color.stroke.active',
'rgb-field-fill': 'click.field.color.background.default',
'rgb-field-text': 'click.field.color.text.default',
+ 'rgb-surface-canvas': 'global.color.background.default',
+ 'rgb-surface-user-message': 'palette.neutral.712',
+ 'rgb-surface-card': 'click.card.secondary.color.background.default',
+ 'rgb-surface-card-hover': 'click.card.secondary.color.background.hover',
+ 'rgb-surface-nav-hover': 'click.sidebar.main.navigation.item.color.background.hover',
+ 'rgb-surface-tab-selected': 'palette.neutral.712',
+ 'rgb-surface-menu': 'click.genericMenu.panel.color.background.default',
+ 'rgb-surface-popover': 'click.genericMenu.panel.color.background.default',
+ 'rgb-border-menu': 'click.genericMenu.panel.color.stroke.default',
+ 'rgb-surface-composer': 'click.field.color.background.default',
+ 'rgb-surface-search': 'click.field.color.background.default',
'rgb-surface-disabled': 'click.button.basic.color.primary.background.disabled',
'rgb-text-disabled': 'global.color.text.disabled',
'rgb-border-disabled': 'click.field.color.stroke.disabled',
@@ -336,12 +358,16 @@ const ALERT_ALPHA_REASON =
/** Values the theme sets on purpose without a Click UI source, and why. */
const unsourcedColors: Record>> = {
light: {
+ 'rgb-surface-nav-hover':
+ 'Click UI sidebar item hover is a 0.6 alpha lch; the theme paints its composite on background.split',
'rgb-surface-media-overlay': MEDIA_OVERLAY_REASON,
'rgb-avatar-edge': AVATAR_EDGE_REASON,
'rgb-alert-error-fill': ALERT_ALPHA_REASON,
'rgb-alert-error-border': ALERT_ALPHA_REASON,
},
dark: {
+ 'rgb-surface-nav-selected':
+ 'Click UI sidebar item active is a 0.6 alpha lch; the theme paints its composite on background.split',
'rgb-surface-overlay':
'Click UI dark dialog.color.opaqueBackground is a gray that leaves the dialog under 3:1',
'rgb-surface-media-overlay': MEDIA_OVERLAY_REASON,
@@ -381,6 +407,12 @@ const departures: Record>>
status: 'mismatch',
reason: ALERT_ALPHA_REASON,
},
+ 'rgb-surface-nav-hover': {
+ counterpart: 'click.sidebar.main.navigation.item.color.background.hover',
+ status: 'near',
+ reason:
+ 'the token is lch(91.609 1.1023 265.86) at 0.6 alpha; the theme value is its composite on background.split',
+ },
'rgb-avatar-edge': {
counterpart: 'global.color.stroke.default',
status: 'near',
@@ -463,6 +495,12 @@ const departures: Record>>
},
},
dark: {
+ 'rgb-surface-nav-selected': {
+ counterpart: 'click.sidebar.main.navigation.item.color.background.active',
+ status: 'near',
+ reason:
+ 'the token is lch(27.535 0 none) at 0.6 alpha; the theme value is its composite on background.split',
+ },
'rgb-border-xheavy': {
counterpart: 'global.color.stroke.intense',
status: 'mismatch',
diff --git a/packages/client/src/theme/themes/dark.ts b/packages/client/src/theme/themes/dark.ts
index 8a3c63732b..d5fb5c31da 100644
--- a/packages/client/src/theme/themes/dark.ts
+++ b/packages/client/src/theme/themes/dark.ts
@@ -90,6 +90,18 @@ export const darkTheme: IThemeRGB = {
'rgb-text-tooltip': '236 236 236', // matching text-primary
'rgb-alert-error-fill': '69 10 10', // matching status-error-subtle
'rgb-alert-error-border': '153 27 27', // matching status-error-border
+ 'rgb-surface-canvas': '23 23 23', // matching surface-primary-alt
+ 'rgb-surface-user-message': '47 47 47', // matching surface-tertiary
+ 'rgb-surface-card': '33 33 33', // matching surface-secondary
+ 'rgb-surface-card-hover': '47 47 47', // matching surface-tertiary
+ 'rgb-surface-nav-hover': '47 47 47', // matching surface-active-alt
+ 'rgb-surface-nav-selected': '47 47 47', // matching surface-active-alt
+ 'rgb-surface-tab-selected': '47 47 47', // matching surface-tertiary
+ 'rgb-surface-menu': '33 33 33', // matching presentation
+ 'rgb-surface-popover': '33 33 33', // matching surface-secondary
+ 'rgb-border-menu': '33 33 33', // matching border-light
+ 'rgb-surface-composer': '47 47 47', // matching surface-chat
+ 'rgb-surface-search': '33 33 33', // matching surface-secondary
'rgb-surface-disabled': '47 47 47', // #2f2f2f (gray-700)
'rgb-text-disabled': '153 150 150', // #999696 (gray-400)
'rgb-border-disabled': '57 57 57', // #393939 (gray-650)
diff --git a/packages/client/src/theme/themes/default.ts b/packages/client/src/theme/themes/default.ts
index 4677dd64dc..ae88181a3e 100644
--- a/packages/client/src/theme/themes/default.ts
+++ b/packages/client/src/theme/themes/default.ts
@@ -90,6 +90,18 @@ export const defaultTheme: IThemeRGB = {
'rgb-text-tooltip': '33 33 33', // matching text-primary
'rgb-alert-error-fill': '254 242 242', // matching status-error-subtle
'rgb-alert-error-border': '252 165 165', // matching status-error-border
+ 'rgb-surface-canvas': '247 247 248', // matching surface-primary-alt
+ 'rgb-surface-user-message': '236 236 236', // matching surface-tertiary
+ 'rgb-surface-card': '247 247 248', // matching surface-secondary
+ 'rgb-surface-card-hover': '236 236 236', // matching surface-tertiary
+ 'rgb-surface-nav-hover': '227 227 227', // matching surface-active-alt
+ 'rgb-surface-nav-selected': '227 227 227', // matching surface-active-alt
+ 'rgb-surface-tab-selected': '236 236 236', // matching surface-tertiary
+ 'rgb-surface-menu': '255 255 255', // matching presentation
+ 'rgb-surface-popover': '255 255 255', // matching surface-primary
+ 'rgb-border-menu': '227 227 227', // matching border-light
+ 'rgb-surface-composer': '255 255 255', // matching surface-chat
+ 'rgb-surface-search': '247 247 248', // matching surface-secondary
'rgb-surface-disabled': '236 236 236', // #ececec (gray-100)
'rgb-text-disabled': '153 150 150', // #999696 (gray-400)
'rgb-border-disabled': '227 227 227', // #e3e3e3 (gray-200)
diff --git a/packages/client/src/theme/themes/highContrast.ts b/packages/client/src/theme/themes/highContrast.ts
index 24ccd47b5b..43d85146a8 100644
--- a/packages/client/src/theme/themes/highContrast.ts
+++ b/packages/client/src/theme/themes/highContrast.ts
@@ -126,6 +126,18 @@ export const highContrastLightTheme: IThemeRGB = {
'rgb-text-tooltip': '0 0 0', // matching text-primary
'rgb-alert-error-fill': '255 255 255', // matching status-error-subtle
'rgb-alert-error-border': '161 0 0', // matching status-error-border
+ 'rgb-surface-canvas': '255 255 255', // matching surface-primary-alt
+ 'rgb-surface-user-message': '255 255 255', // matching surface-tertiary
+ 'rgb-surface-card': '255 255 255', // matching surface-secondary
+ 'rgb-surface-card-hover': '255 255 255', // matching surface-tertiary
+ 'rgb-surface-nav-hover': '212 212 212', // matching surface-active-alt
+ 'rgb-surface-nav-selected': '212 212 212', // matching surface-active-alt
+ 'rgb-surface-tab-selected': '255 255 255', // matching surface-tertiary
+ 'rgb-surface-menu': '255 255 255', // matching presentation
+ 'rgb-surface-popover': '255 255 255', // matching surface-primary
+ 'rgb-border-menu': '0 0 0', // matching border-light
+ 'rgb-surface-composer': '255 255 255', // matching surface-chat
+ 'rgb-surface-search': '255 255 255', // matching surface-secondary
'rgb-surface-disabled': '255 255 255', // #ffffff
'rgb-text-disabled': '87 87 87', // #575757
'rgb-border-disabled': '87 87 87', // #575757
@@ -310,6 +322,18 @@ export const highContrastDarkTheme: IThemeRGB = {
'rgb-text-tooltip': '255 255 255', // matching text-primary
'rgb-alert-error-fill': '0 0 0', // matching status-error-subtle
'rgb-alert-error-border': '255 143 143', // matching status-error-border
+ 'rgb-surface-canvas': '0 0 0', // matching surface-primary-alt
+ 'rgb-surface-user-message': '0 0 0', // matching surface-tertiary
+ 'rgb-surface-card': '0 0 0', // matching surface-secondary
+ 'rgb-surface-card-hover': '0 0 0', // matching surface-tertiary
+ 'rgb-surface-nav-hover': '61 61 61', // matching surface-active-alt
+ 'rgb-surface-nav-selected': '61 61 61', // matching surface-active-alt
+ 'rgb-surface-tab-selected': '0 0 0', // matching surface-tertiary
+ 'rgb-surface-menu': '0 0 0', // matching presentation
+ 'rgb-surface-popover': '0 0 0', // matching surface-secondary
+ 'rgb-border-menu': '255 255 255', // matching border-light
+ 'rgb-surface-composer': '0 0 0', // matching surface-chat
+ 'rgb-surface-search': '0 0 0', // matching surface-secondary
'rgb-surface-disabled': '0 0 0', // #000000
'rgb-text-disabled': '184 184 184', // #b8b8b8
'rgb-border-disabled': '184 184 184', // #b8b8b8
diff --git a/packages/client/src/theme/tokens.css b/packages/client/src/theme/tokens.css
index b738a3fe78..900dd66c61 100644
--- a/packages/client/src/theme/tokens.css
+++ b/packages/client/src/theme/tokens.css
@@ -130,6 +130,20 @@
--color-text-tooltip: rgb(var(--text-tooltip, var(--text-primary)));
--color-alert-error-fill: rgb(var(--alert-error-fill, var(--status-error-subtle)));
--color-alert-error-border: rgb(var(--alert-error-border, var(--status-error-border)));
+ --color-surface-canvas: rgb(var(--surface-canvas));
+ --color-surface-user-message: rgb(var(--surface-user-message));
+ --color-surface-card: rgb(var(--surface-card));
+ --color-surface-card-hover: rgb(var(--surface-card-hover));
+ --color-surface-nav-hover: rgb(var(--surface-nav-hover));
+ --color-surface-nav-selected: rgb(var(--surface-nav-selected));
+ --color-surface-tab-selected: rgb(var(--surface-tab-selected));
+ --color-surface-menu: rgb(var(--surface-menu));
+ --color-surface-popover: rgb(var(--surface-popover));
+ --color-border-menu: rgb(
+ var(--border-menu) / var(--border-menu-alpha, var(--border-light-alpha, 1))
+ );
+ --color-surface-composer: rgb(var(--surface-composer));
+ --color-surface-search: rgb(var(--surface-search));
--color-border-disabled: rgb(var(--border-disabled));
/* status */
diff --git a/packages/client/src/theme/types/index.ts b/packages/client/src/theme/types/index.ts
index 7daa673cd0..bd8232e3cd 100644
--- a/packages/client/src/theme/types/index.ts
+++ b/packages/client/src/theme/types/index.ts
@@ -119,6 +119,18 @@ export interface IThemeRGB {
* `rgb-status-error-border` when a theme omits them. */
'rgb-alert-error-fill'?: string;
'rgb-alert-error-border'?: string;
+ 'rgb-surface-canvas'?: string;
+ 'rgb-surface-user-message'?: string;
+ 'rgb-surface-card'?: string;
+ 'rgb-surface-card-hover'?: string;
+ 'rgb-surface-nav-hover'?: string;
+ 'rgb-surface-nav-selected'?: string;
+ 'rgb-surface-tab-selected'?: string;
+ 'rgb-surface-menu'?: string;
+ 'rgb-surface-popover'?: string;
+ 'rgb-border-menu'?: string;
+ 'rgb-surface-composer'?: string;
+ 'rgb-surface-search'?: string;
/** Disabled fill, ink and edge. Painted only under the `fill` disabled style. */
'rgb-surface-disabled'?: string;
'rgb-text-disabled'?: string;
@@ -312,6 +324,18 @@ export interface IThemeVariables {
'--text-tooltip': string;
'--alert-error-fill': string;
'--alert-error-border': string;
+ '--surface-canvas': string;
+ '--surface-user-message': string;
+ '--surface-card': string;
+ '--surface-card-hover': string;
+ '--surface-nav-hover': string;
+ '--surface-nav-selected': string;
+ '--surface-tab-selected': string;
+ '--surface-menu': string;
+ '--surface-popover': string;
+ '--border-menu': string;
+ '--surface-composer': string;
+ '--surface-search': string;
'--surface-disabled': string;
'--text-disabled': string;
'--border-disabled': string;
@@ -455,6 +479,18 @@ export interface IThemeColors {
'text-tooltip'?: string;
'alert-error-fill'?: string;
'alert-error-border'?: string;
+ 'surface-canvas'?: string;
+ 'surface-user-message'?: string;
+ 'surface-card'?: string;
+ 'surface-card-hover'?: string;
+ 'surface-nav-hover'?: string;
+ 'surface-nav-selected'?: string;
+ 'surface-tab-selected'?: string;
+ 'surface-menu'?: string;
+ 'surface-popover'?: string;
+ 'border-menu'?: string;
+ 'surface-composer'?: string;
+ 'surface-search'?: string;
'surface-disabled'?: string;
'text-disabled'?: string;
'border-disabled'?: string;
diff --git a/packages/client/src/utils/composer.spec.ts b/packages/client/src/utils/composer.spec.ts
index a05a9a203d..45deb2f5db 100644
--- a/packages/client/src/utils/composer.spec.ts
+++ b/packages/client/src/utils/composer.spec.ts
@@ -5,7 +5,7 @@ describe('composerSurfaceClasses', () => {
const classes = composerSurfaceClasses();
expect(classes).toContain('border-border-light');
- expect(classes).toContain('bg-surface-chat');
+ expect(classes).toContain('bg-surface-composer');
expect(classes).toContain('text-text-primary');
});
});
diff --git a/packages/client/src/utils/composer.ts b/packages/client/src/utils/composer.ts
index a830c32a4c..c3144d0d43 100644
--- a/packages/client/src/utils/composer.ts
+++ b/packages/client/src/utils/composer.ts
@@ -8,7 +8,9 @@ import { cn } from './utils';
* padding, and feature-specific overrides stay with each owner.
*/
export const composerSurfaceClasses = (): string =>
- cn('border border-border-light bg-surface-chat text-text-primary transition-all duration-200');
+ cn(
+ 'border border-border-light bg-surface-composer text-text-primary transition-all duration-200',
+ );
/** Elevation states for the composer surface. `within` is the CSS-only
* equivalent of the managed focused/blurred pair for surfaces that do not
diff --git a/packages/data-provider/src/theme.ts b/packages/data-provider/src/theme.ts
index ffd9f35dc9..2002116875 100644
--- a/packages/data-provider/src/theme.ts
+++ b/packages/data-provider/src/theme.ts
@@ -88,6 +88,18 @@ export const themeColorTokens = Object.freeze([
'rgb-text-tooltip',
'rgb-alert-error-fill',
'rgb-alert-error-border',
+ 'rgb-surface-canvas',
+ 'rgb-surface-user-message',
+ 'rgb-surface-card',
+ 'rgb-surface-card-hover',
+ 'rgb-surface-nav-hover',
+ 'rgb-surface-nav-selected',
+ 'rgb-surface-tab-selected',
+ 'rgb-surface-menu',
+ 'rgb-surface-popover',
+ 'rgb-border-menu',
+ 'rgb-surface-composer',
+ 'rgb-surface-search',
'rgb-surface-disabled',
'rgb-text-disabled',
'rgb-border-disabled',