Skip to content

Beautiful, AI-native markdown IDE and LLM wiki

Layer dark mode surfaces the way light mode does (#7296)

Abraham1c64b99bdbb6
diff --git a/.changeset/dark-surface-order.md b/.changeset/dark-surface-order.md
new file mode 100644
index 000000000..4c4a9f4b3
--- /dev/null
+++ b/.changeset/dark-surface-order.md
@@ -0,0 +1,5 @@
+---
+'@inkeep/open-knowledge': patch
+---
+
+The default dark theme now layers surfaces the way light mode does: the window background is darkest, sidebars sit a step above it, documents are lighter still, and menus lighter again. Panels also get a thin edge in dark mode.
diff --git a/docs/src/components/html-preview.tsx b/docs/src/components/html-preview.tsx
index 98c8b9a88..e966ae756 100644
--- a/docs/src/components/html-preview.tsx
+++ b/docs/src/components/html-preview.tsx
@@ -17,7 +17,7 @@ const LIGHT =
'--background:oklch(1 0 0);--foreground:oklch(0.145 0 0);--card:oklch(1 0 0);--card-foreground:oklch(0.145 0 0);--muted:oklch(0.97 0 0);--muted-foreground:oklch(0.556 0 0);--border:oklch(0.922 0 0);--primary:oklch(0.5621 0.1983 259.59);--accent-soft:#e6efff;--accent-ink:#00245d;--chart-1:oklch(0.62 0.19 259);--chart-2:oklch(0.58 0.14 145);--chart-3:oklch(0.62 0.15 70);--chart-4:oklch(0.55 0.18 290);--chart-5:oklch(0.58 0.21 25);--radius:0.625rem;color-scheme:light';
const DARK =
- '--background:oklch(0.195 0 0);--foreground:oklch(0.985 0 0);--card:oklch(0.245 0 0);--card-foreground:oklch(0.985 0 0);--muted:oklch(0.3 0 0);--muted-foreground:oklch(0.708 0 0);--border:oklch(1 0 0 / 0.14);--primary:#69a3ff;--accent-soft:#12233f;--accent-ink:#9ec3ff;--chart-1:oklch(0.72 0.14 259);--chart-2:oklch(0.73 0.13 145);--chart-3:oklch(0.77 0.14 70);--chart-4:oklch(0.72 0.16 290);--chart-5:oklch(0.72 0.2 25);--radius:0.625rem;color-scheme:dark';
+ '--background:oklch(0.21 0 0);--foreground:oklch(0.985 0 0);--card:oklch(0.245 0 0);--card-foreground:oklch(0.985 0 0);--muted:oklch(0.3 0 0);--muted-foreground:oklch(0.708 0 0);--border:oklch(1 0 0 / 0.14);--primary:#69a3ff;--accent-soft:#12233f;--accent-ink:#9ec3ff;--chart-1:oklch(0.72 0.14 259);--chart-2:oklch(0.73 0.13 145);--chart-3:oklch(0.77 0.14 70);--chart-4:oklch(0.72 0.16 290);--chart-5:oklch(0.72 0.2 25);--radius:0.625rem;color-scheme:dark';
const THEME_CSS = `:root{${LIGHT}}@media (prefers-color-scheme:dark){:root:not([data-theme="light"]){${DARK}}}:root[data-theme="dark"]{${DARK}}:root[data-theme="light"]{${LIGHT}}`;
diff --git a/packages/app/src/comments/comment-hue-contrast.test.ts b/packages/app/src/comments/comment-hue-contrast.test.ts
index 61a3c753b..4f25efb37 100644
--- a/packages/app/src/comments/comment-hue-contrast.test.ts
+++ b/packages/app/src/comments/comment-hue-contrast.test.ts
@@ -11,7 +11,7 @@ const RESTING_LINE_ALPHA = 0.7;
const CANVASES = {
light: { rgb: [255, 255, 255], decl: 'oklch(1 0 0)' },
- dark: { rgb: [21, 21, 21], decl: 'oklch(0.195 0 0)' },
+ dark: { rgb: [24, 24, 24], decl: 'oklch(0.21 0 0)' },
} as const;
type Rgb = readonly [number, number, number] | number[];
diff --git a/packages/app/src/components/ui/pane-card.dom.test.tsx b/packages/app/src/components/ui/pane-card.dom.test.tsx
index 127ea1f43..e154bfc13 100644
--- a/packages/app/src/components/ui/pane-card.dom.test.tsx
+++ b/packages/app/src/components/ui/pane-card.dom.test.tsx
@@ -18,6 +18,13 @@ function card(container: HTMLElement): HTMLElement {
const SHAPE_TOKENS = [
'rounded-xl',
'shadow-[0_2px_8px_0_rgb(0_0_0/0.08),0_1px_2px_-1px_rgb(0_0_0/0.1)]',
+ 'dark:after:pointer-events-none',
+ 'dark:after:absolute',
+ 'dark:after:inset-0',
+ 'dark:after:z-30',
+ 'dark:after:ring-1',
+ 'dark:after:ring-inset',
+ 'dark:after:ring-foreground/15',
];
const FILL_TOKENS = [
'relative',
diff --git a/packages/app/src/components/ui/pane-card.tsx b/packages/app/src/components/ui/pane-card.tsx
index d84917e07..cbc7c820e 100644
--- a/packages/app/src/components/ui/pane-card.tsx
+++ b/packages/app/src/components/ui/pane-card.tsx
@@ -32,8 +32,10 @@ export function paneCardDividerClass(
const PANE_CARD_BASE_CLASS =
'relative flex min-h-0 min-w-0 flex-1 flex-col overflow-hidden bg-background';
-const PANE_CARD_SHAPE_CLASS =
- 'rounded-xl shadow-[0_2px_8px_0_rgb(0_0_0/0.08),0_1px_2px_-1px_rgb(0_0_0/0.1)]';
+const PANE_CARD_SHAPE_CLASS = cn(
+ 'rounded-xl shadow-[0_2px_8px_0_rgb(0_0_0/0.08),0_1px_2px_-1px_rgb(0_0_0/0.1)]',
+ 'dark:after:pointer-events-none dark:after:absolute dark:after:inset-0 dark:after:z-30 dark:after:rounded-[inherit] dark:after:ring-1 dark:after:ring-foreground/15 dark:after:ring-inset',
+);
interface PaneCardProps extends React.ComponentProps<'div'> {
readonly pane: PaneId;
diff --git a/packages/app/src/globals.alpha-aware.test.ts b/packages/app/src/globals.alpha-aware.test.ts
index 411dcb091..95a4d0c26 100644
--- a/packages/app/src/globals.alpha-aware.test.ts
+++ b/packages/app/src/globals.alpha-aware.test.ts
@@ -56,7 +56,7 @@ describe('globals.css — the desk token follows the active colour theme', () =>
const dark = CSS.match(/\n\.dark\s*\{([\s\S]*?)\n\}/)?.[1] ?? '';
expect(dark).not.toMatch(/--desk\s*:/);
expect(CSS).toMatch(
- /html\.dark:not\(\[data-color-theme\]\)\s*\{[^}]*--desk:\s*oklch\(0\.28 0 0\)/,
+ /html\.dark:not\(\[data-color-theme\]\)\s*\{[^}]*--desk:\s*oklch\(0\.15 0 0\)/,
);
expect(themedDeskSelectors(CSS)).toEqual([]);
expect(themedDeskSelectors('html.dark[data-color-theme="dracula"] { --desk: red; }')).toEqual([
diff --git a/packages/app/src/globals.css b/packages/app/src/globals.css
index ae7f15679..4bfa52f8c 100644
--- a/packages/app/src/globals.css
+++ b/packages/app/src/globals.css
@@ -3592,11 +3592,11 @@ button:active:not(:disabled) {
.dark {
color-scheme: dark;
- --background: oklch(0.195 0 0);
+ --background: oklch(0.21 0 0);
--foreground: oklch(0.985 0 0);
--card: oklch(0.245 0 0);
--card-foreground: oklch(0.985 0 0);
- --popover: oklch(0.205 0 0);
+ --popover: oklch(0.225 0 0);
--popover-foreground: oklch(0.985 0 0);
--primary: var(--color-sky-blue);
--primary-foreground: oklch(0.205 0 0);
@@ -3627,7 +3627,7 @@ button:active:not(:disabled) {
--chart-3: oklch(0.77 0.14 70);
--chart-4: oklch(0.72 0.16 290);
--chart-5: oklch(0.72 0.2 25);
- --sidebar: oklch(0.21 0 0);
+ --sidebar: oklch(0.185 0 0);
--sidebar-foreground: oklch(0.985 0 0);
--sidebar-primary: oklch(0.488 0.243 264.376);
--sidebar-primary-foreground: oklch(0.985 0 0);
@@ -3686,7 +3686,7 @@ button:active:not(:disabled) {
}
html.dark:not([data-color-theme]) {
- --desk: oklch(0.28 0 0);
+ --desk: oklch(0.15 0 0);
--file-tree-foreground: color-mix(in oklab, var(--sidebar-foreground) 75%, var(--sidebar));
}
diff --git a/packages/app/tests/foundation/theme-text-backgrounds.test-helper.ts b/packages/app/tests/foundation/theme-text-backgrounds.test-helper.ts
index 556ab7634..ba32f7f77 100644
--- a/packages/app/tests/foundation/theme-text-backgrounds.test-helper.ts
+++ b/packages/app/tests/foundation/theme-text-backgrounds.test-helper.ts
@@ -44,49 +44,49 @@ export const measuredBackgrounds: Record<string, number[][]> = {
],
'default-light/terminal': [[1, 1, 1]],
'default-dark/source': [
- [0.081708560789, 0.081708565873, 0.081708579633],
- [0.117650456352, 0.117650462772, 0.11765048015],
+ [0.094977657291, 0.094977662868, 0.094977677964],
+ [0.130388788993, 0.130388795887, 0.130388814548],
],
'default-dark/source-active': [
- [0.081708560789, 0.081708565873, 0.081708579633],
- [0.117650456352, 0.117650462772, 0.11765048015],
+ [0.094977657291, 0.094977662868, 0.094977677964],
+ [0.130388788993, 0.130388795887, 0.130388814548],
],
- 'default-dark/source-gutter': [[0.081708560789, 0.081708565873, 0.081708579633]],
+ 'default-dark/source-gutter': [[0.094977657291, 0.094977662868, 0.094977677964]],
'default-dark/rich-and-raw-mdx': [
[0.0676052135, 0.067791876405, 0.077441216614],
- [0.081708560789, 0.081708565873, 0.081708579633],
- [0.173537704711, 0.122282791231, 0.122657586151],
+ [0.094977657291, 0.094977662868, 0.094977677964],
+ [0.185479891562, 0.134225003989, 0.134599806678],
],
'default-dark/text-doc': [
- [0.081708560789, 0.081708565873, 0.081708579633],
- [0.117650456352, 0.117650462772, 0.11765048015],
+ [0.094977657291, 0.094977662868, 0.094977677964],
+ [0.130388788993, 0.130388795887, 0.130388814548],
[0.149382071714, 0.149382079314, 0.149382099886],
],
'default-dark/mermaid': [
- [0.081708560789, 0.081708565873, 0.081708579633],
- [0.117650456352, 0.117650462772, 0.11765048015],
+ [0.094977657291, 0.094977662868, 0.094977677964],
+ [0.130388788993, 0.130388795887, 0.130388814548],
[0.149382071714, 0.149382079314, 0.149382099886],
],
'default-dark/viewer': [
- [0.081708560789, 0.081708565873, 0.081708579633],
- [0.117650456352, 0.117650462772, 0.11765048015],
+ [0.094977657291, 0.094977662868, 0.094977677964],
+ [0.130388788993, 0.130388795887, 0.130388814548],
[0.149382071714, 0.149382079314, 0.149382099886],
],
'default-dark/property': [
- [0.081708560789, 0.081708565873, 0.081708579633],
+ [0.094977657291, 0.094977662868, 0.094977677964],
[0.149382071714, 0.149382079314, 0.149382099886],
],
- 'default-dark/tree-hover': [[0.119954736374, 0.11995474288, 0.11995476049]],
+ 'default-dark/tree-hover': [[0.111192087747, 0.111192093927, 0.111192110655]],
'default-dark/diff': [
- [0.081708560789, 0.081708565873, 0.081708579633],
- [0.088231040222, 0.092511442303, 0.089385266806],
- [0.09350916826, 0.089198100825, 0.089046840315],
- [0.1615592116, 0.22860895912, 0.182406290904],
- [0.22549556928, 0.372165367296, 0.277335432724],
- [0.240612790799, 0.179772039024, 0.178400806588],
- [0.392490232639, 0.270762431219, 0.27000564527],
- ],
- 'default-dark/terminal': [[0.082352941176, 0.082352941176, 0.082352941176]],
+ [0.094977657291, 0.094977662868, 0.094977677964],
+ [0.100960993623, 0.105243321798, 0.102120861327],
+ [0.106235945171, 0.101928349649, 0.10179135429],
+ [0.172850330635, 0.24033162972, 0.193699713739],
+ [0.234528464508, 0.381543503776, 0.286370170991],
+ [0.252528157479, 0.191070538401, 0.189634908654],
+ [0.402022525983, 0.279801230721, 0.278992926923],
+ ],
+ 'default-dark/terminal': [[0.094117647059, 0.094117647059, 0.094117647059]],
'default-light/code-modal': [[1.000000044587, 0.999999957075, 1.000000094692]],
'default-light/conflict-syntax': [
[0.605850573417, 0.757747006006, 0.668957029309],
@@ -100,17 +100,17 @@ export const measuredBackgrounds: Record<string, number[][]> = {
[0.999999967565, 0.999988978749, 0.999999936483],
[1.000000044587, 0.999999957075, 1.000000094692],
],
- 'default-dark/code-modal': [[0.082352941176, 0.082352941176, 0.082352941176]],
+ 'default-dark/code-modal': [[0.094977657291, 0.094977662868, 0.094977677964]],
'default-dark/conflict-syntax': [
- [0.081708560789, 0.081708565873, 0.081708579633],
- [0.11818703484, 0.145757449695, 0.126144680688],
- [0.121417657231, 0.133612407572, 0.149798087721],
- [0.130077552798, 0.167790495553, 0.141228002503],
- [0.134553037766, 0.151408732081, 0.173370877376],
- [0.137114492454, 0.13710295412, 0.137114668428],
- [0.158539670471, 0.222291057816, 0.178303465033],
- [0.166313175658, 0.195373405076, 0.23186905896],
- [0.242518687799, 0.416929124272, 0.306275823889],
- [0.269605662479, 0.350370518864, 0.437892196616],
+ [0.094977657291, 0.094977662868, 0.094977677964],
+ [0.130356065725, 0.15822907921, 0.138364038333],
+ [0.133585506581, 0.145921919262, 0.162315240429],
+ [0.142052552699, 0.180120213563, 0.153247543675],
+ [0.146517635034, 0.163538563436, 0.185754522326],
+ [0.149627216228, 0.14961521972, 0.149628951584],
+ [0.169996728752, 0.234162886026, 0.189766451745],
+ [0.177722531775, 0.206978378724, 0.243807070923],
+ [0.250661687731, 0.425313332519, 0.314449111886],
+ [0.277741588621, 0.358618804185, 0.446313075182],
],
};
diff --git a/packages/app/tests/stress/_helpers/card-surface.ts b/packages/app/tests/stress/_helpers/card-surface.ts
index dd5c3b8cd..d65092c73 100644
--- a/packages/app/tests/stress/_helpers/card-surface.ts
+++ b/packages/app/tests/stress/_helpers/card-surface.ts
@@ -35,7 +35,7 @@ const OPAQUE = 255;
const ANTIALIAS_MARGIN_PX = 1;
-async function rgbaBytesOf(page: Page, colors: readonly string[]): Promise<RgbaBytes[]> {
+export async function rgbaBytesOf(page: Page, colors: readonly string[]): Promise<RgbaBytes[]> {
return await page.evaluate((list) => {
const context = new OffscreenCanvas(1, 1).getContext('2d', { willReadFrequently: true });
if (!context) throw new Error('Could not create a color conversion context');
@@ -173,7 +173,7 @@ function linearChannel(channel: number): number {
return normalized <= 0.04045 ? normalized / 12.92 : ((normalized + 0.055) / 1.055) ** 2.4;
}
-function relativeLuminance([red, green, blue]: RgbaBytes): number {
+export function relativeLuminance([red, green, blue]: RgbaBytes): number {
return 0.2126 * linearChannel(red) + 0.7152 * linearChannel(green) + 0.0722 * linearChannel(blue);
}
@@ -220,6 +220,29 @@ export async function innerClipsOf(card: Locator): Promise<readonly ScreenClip[]
return [band(geometry.radius, geometry.border), band(geometry.border, geometry.radius)];
}
+export async function screenshotBrightness(page: Page, png: Buffer): Promise<number[]> {
+ return await page.evaluate(async (base64) => {
+ const bytes = Uint8Array.from(atob(base64), (char) => char.charCodeAt(0));
+ const bitmap = await createImageBitmap(new Blob([bytes], { type: 'image/png' }), {
+ colorSpaceConversion: 'none',
+ premultiplyAlpha: 'none',
+ });
+ const context = new OffscreenCanvas(bitmap.width, bitmap.height).getContext('2d', {
+ willReadFrequently: true,
+ });
+ if (!context) throw new Error('Could not create an image decoding context');
+ context.drawImage(bitmap, 0, 0);
+ const { data } = context.getImageData(0, 0, bitmap.width, bitmap.height);
+ const brightness: number[] = [];
+ for (let offset = 0; offset < data.length; offset += 4) {
+ brightness.push(
+ ((data[offset] ?? 0) + (data[offset + 1] ?? 0) + (data[offset + 2] ?? 0)) / 3,
+ );
+ }
+ return brightness;
+ }, png.toString('base64'));
+}
+
export async function countDifferingPixels(
page: Page,
first: Buffer,
diff --git a/packages/app/tests/stress/_helpers/index.ts b/packages/app/tests/stress/_helpers/index.ts
index 770275ade..e910bb51c 100644
--- a/packages/app/tests/stress/_helpers/index.ts
+++ b/packages/app/tests/stress/_helpers/index.ts
@@ -29,7 +29,10 @@ export {
readCardSurface,
readContrastPair,
readRootColor,
+ relativeLuminance,
+ rgbaBytesOf,
type ScreenClip,
+ screenshotBrightness,
} from './card-surface.ts';
export { simulateCopyAndRead, simulateCutAndRead } from './clipboard.ts';
export { resetContentToFixtureBaseline } from './content-reset.ts';
diff --git a/packages/app/tests/stress/surface-order.e2e.ts b/packages/app/tests/stress/surface-order.e2e.ts
new file mode 100644
index 000000000..b46330dee
--- /dev/null
+++ b/packages/app/tests/stress/surface-order.e2e.ts
@@ -0,0 +1,142 @@
+import type { Page } from '@playwright/test';
+import type { ApiHelpers } from './_helpers';
+import {
+ expect,
+ headerPaneButton,
+ relativeLuminance,
+ rgbaBytesOf,
+ screenshotBrightness,
+ stubAgentCatalog,
+ test,
+ waitForActiveProviderSynced,
+} from './_helpers';
+
+type Theme = 'light' | 'dark';
+
+const BOOT_TIMEOUT_MS = 30_000;
+const DOC_TEXT = 'Cards sit on a desk.';
+const DESK = 'header[data-app-header]';
+const SIDEBAR = '[data-slot="sidebar-inner"]';
+const DOCUMENT = '[data-slot="sidebar-inset"]';
+const EDITOR_CARD = '[data-slot="pane-card"][data-pane="editor"]';
+const AGENTS_CARD = '[data-slot="pane-card"][data-pane="agents"]';
+const EDGES = ['top', 'right', 'bottom', 'left'] as const;
+const EDGE_SAMPLE_PX = 4;
+const RING_STEP = 12;
+const POPOVER = '[data-slot="dialog-content"]';
+
+test.use({ deviceScaleFactor: 2 });
+
+async function openInTheme(page: Page, api: ApiHelpers, theme: Theme): Promise<void> {
+ const name = `surface-order-${theme}-${test.info().workerIndex}`;
+ await api.seedDocs([{ name, markdown: `# ${name}\n\n${DOC_TEXT}\n` }]);
+ await page.emulateMedia({ colorScheme: theme });
+ await page.addInitScript((value) => window.localStorage.setItem('ok-theme-v1', value), theme);
+ await stubAgentCatalog(page);
+ await page.setViewportSize({ width: 1600, height: 900 });
+ await page.goto(`/#/${name}`);
+ await waitForActiveProviderSynced(page);
+ await expect(page.locator('html')).toHaveClass(new RegExp(`\\b${theme}\\b`));
+ await expect(headerPaneButton(page, 'editor')).toBeVisible({ timeout: BOOT_TIMEOUT_MS });
+ await expect(page.locator('.tiptap-editor .ProseMirror').first()).toContainText(DOC_TEXT, {
+ timeout: BOOT_TIMEOUT_MS,
+ });
+}
+
+async function luminanceOf(page: Page, selector: string): Promise<number> {
+ const surface = page.locator(selector).first();
+ await expect(surface).toBeVisible();
+ const color = await surface.evaluate((element) => getComputedStyle(element).backgroundColor);
+ const [bytes] = await rgbaBytesOf(page, [color]);
+ if (bytes === undefined || bytes[3] !== 255) {
+ throw new Error(`${selector} paints no opaque background of its own`);
+ }
+ return relativeLuminance(bytes);
+}
+
+type Edge = 'top' | 'right' | 'bottom' | 'left';
+
+async function edgeBrightness(
+ page: Page,
+ selector: string,
+ edge: Edge,
+): Promise<{ ring: number; inside: number }> {
+ const box = await page.locator(selector).first().boundingBox();
+ if (box === null) throw new Error(`${selector} has no layout box`);
+ const horizontal = edge === 'left' || edge === 'right';
+ const along = Math.round(horizontal ? box.y + box.height / 2 : box.x + box.width / 2);
+ const at = Math.round(
+ { top: box.y, right: box.x + box.width, bottom: box.y + box.height, left: box.x }[edge],
+ );
+ const towardEdgeLast = edge === 'right' || edge === 'bottom';
+ const start = towardEdgeLast ? at - EDGE_SAMPLE_PX : at;
+ const clip = horizontal
+ ? { x: start, y: along, width: EDGE_SAMPLE_PX, height: 1 }
+ : { x: along, y: start, width: 1, height: EDGE_SAMPLE_PX };
+ const pixels = await screenshotBrightness(page, await page.screenshot({ clip }));
+ const fromEdge = towardEdgeLast ? [...pixels].reverse() : pixels;
+ return {
+ ring: Math.max(fromEdge[0] ?? 0, fromEdge[1] ?? 0),
+ inside: fromEdge[fromEdge.length - 1] ?? 0,
+ };
+}
+
+async function readSurfaces(page: Page) {
+ const desk = await luminanceOf(page, DESK);
+ const sidebar = await luminanceOf(page, SIDEBAR);
+ const document = await luminanceOf(page, DOCUMENT);
+ await page.keyboard.press('ControlOrMeta+k');
+ const popover = await luminanceOf(page, POPOVER);
+ await page.keyboard.press('Escape');
+ await expect(page.locator(POPOVER)).toHaveCount(0);
+ return { desk, sidebar, document, popover };
+}
+
+test.describe('surface order', () => {
+ for (const theme of ['light', 'dark'] as const) {
+ test(`in the ${theme} theme the desk is darkest, the file sidebar steps up from it, the document is lighter still and a popover is no darker than the document`, async ({
+ page,
+ api,
+ }) => {
+ await openInTheme(page, api, theme);
+ const { desk, sidebar, document, popover } = await readSurfaces(page);
+
+ expect(desk, 'desk below the file sidebar').toBeLessThan(sidebar);
+ expect(sidebar, 'file sidebar below the document').toBeLessThan(document);
+ expect(popover, 'popover against the document').toBeGreaterThanOrEqual(document);
+ });
+ }
+
+ test('in the dark theme a popover steps up to its own lighter surface', async ({ page, api }) => {
+ await openInTheme(page, api, 'dark');
+ const { document, popover } = await readSurfaces(page);
+ expect(popover).toBeGreaterThan(document);
+ });
+
+ test('in the dark theme every edge of the editor and Agents cards paints a ring, including where the file list and document panel reach it', async ({
+ page,
+ api,
+ }) => {
+ await openInTheme(page, api, 'dark');
+ const agents = headerPaneButton(page, 'agents');
+ if ((await agents.getAttribute('aria-pressed')) !== 'true') await agents.click();
+ await expect(page.locator(AGENTS_CARD)).toBeVisible();
+ for (const card of [EDITOR_CARD, AGENTS_CARD]) {
+ for (const edge of EDGES) {
+ const { ring, inside } = await edgeBrightness(page, card, edge);
+ expect(ring - inside, `${card} ${edge} edge`).toBeGreaterThan(RING_STEP);
+ }
+ }
+ });
+
+ test('in the light theme the editor card relies on its shadow and paints no ring', async ({
+ page,
+ api,
+ }) => {
+ await openInTheme(page, api, 'light');
+ for (const edge of EDGES) {
+ const { ring, inside } = await edgeBrightness(page, EDITOR_CARD, edge);
+ expect(Math.abs(ring - inside), `editor card ${edge} edge`).toBeLessThanOrEqual(RING_STEP);
+ }
+ });
+});
diff --git a/packages/app/tests/stress/theme-fade.e2e.ts b/packages/app/tests/stress/theme-fade.e2e.ts
index 1a9f7d793..e795990d8 100644
--- a/packages/app/tests/stress/theme-fade.e2e.ts
+++ b/packages/app/tests/stress/theme-fade.e2e.ts
@@ -309,7 +309,7 @@ test('default light and dark modes fade surfaces without losing selection', asyn
`the settled surface equals the light one — the mode never switched.${detail}`,
).not.toBe(fade.beforeClick.body);
expect(fade.afterSettle.sidebar, `the settled token is not dark --sidebar.${detail}`).toBe(
- 'oklch(0.21 0 0)',
+ 'oklch(0.185 0 0)',
);
expect(
fade.connected,
diff --git a/packages/core/src/constants/chrome.ts b/packages/core/src/constants/chrome.ts
index 691dce73a..1f1bf796b 100644
--- a/packages/core/src/constants/chrome.ts
+++ b/packages/core/src/constants/chrome.ts
@@ -1,8 +1,8 @@
export const CHROME_BG_LIGHT = '#f5f5f5' as const;
-export const CHROME_BG_DARK = '#292929' as const;
+export const CHROME_BG_DARK = '#0b0b0b' as const;
export const SIDEBAR_BG_LIGHT = '#fafafa' as const;
-export const SIDEBAR_BG_DARK = '#181818' as const;
-export const CANVAS_BG_DARK = '#151515' as const;
+export const SIDEBAR_BG_DARK = '#131313' as const;
+export const CANVAS_BG_DARK = '#181818' as const;
const ROOT_FONT_SIZE_PX = 16;
diff --git a/packages/core/src/constants/preview-theme-tokens.ts b/packages/core/src/constants/preview-theme-tokens.ts
index 22391de77..43aa87f0f 100644
--- a/packages/core/src/constants/preview-theme-tokens.ts
+++ b/packages/core/src/constants/preview-theme-tokens.ts
@@ -13,7 +13,7 @@ export const PREVIEW_THEME_TOKENS: readonly PreviewThemeToken[] = [
{ name: '--primary', light: 'oklch(0.5621 0.1983 259.59)', dark: '#69a3ff' },
{ name: '--primary-foreground', light: 'oklch(0.985 0 0)', dark: 'oklch(0.205 0 0)' },
{ name: '--foreground', light: 'oklch(0.145 0 0)', dark: 'oklch(0.985 0 0)' },
- { name: '--background', light: 'oklch(1 0 0)', dark: 'oklch(0.195 0 0)' },
+ { name: '--background', light: 'oklch(1 0 0)', dark: 'oklch(0.21 0 0)' },
{ name: '--card', light: 'oklch(1 0 0)', dark: 'oklch(0.245 0 0)' },
{ name: '--card-foreground', light: 'oklch(0.145 0 0)', dark: 'oklch(0.985 0 0)' },
{ name: '--muted-foreground', light: 'oklch(0.556 0 0)', dark: 'oklch(0.708 0 0)' },
diff --git a/packages/desktop/src/main/window-chrome.test.ts b/packages/desktop/src/main/window-chrome.test.ts
index 26174d247..7b052044e 100644
--- a/packages/desktop/src/main/window-chrome.test.ts
+++ b/packages/desktop/src/main/window-chrome.test.ts
@@ -68,7 +68,7 @@ describe('computeTitleBarOverlay', () => {
test('chrome tokens stay in lockstep with the committed FOUC-guard values', () => {
expect(CHROME_BG.light).toBe('#f5f5f5');
- expect(CHROME_BG.dark).toBe('#292929');
+ expect(CHROME_BG.dark).toBe('#0b0b0b');
});
test("the renderer's live colors take precedence over the default-theme snapshot", () => {