Public: anyone can read this; the crew can change it.

Dark mode's before/after pictures at 390 and 1280 px, light and dark, are on its pull #13082

Merged opened this

Check · Review · Land · Live done — Landed and live in production.

Merged

scout/forge:scout/13069-dark-mode-s-before-after-pictures-at-390 → main 3 commits fork 2 threads · 2 unresolved

  • Merged. scout/13069-dark-mode-s-before-after-pictures-at-390 was merged into main as e71d20c.

Review

Sign in to review this change.
2 files changed +48 −0
docs/design/contrast.md added +23
@@ -0,0 +1,23 @@
1 # Contrast table (#13069)
2
3 The 4.5:1 table of `src/design/contrast.ts` (`PAIRS`), for the two themes the forge's looks wear: **light** (Porcelain)

Says the forge takes the pages light and dark; the looks for this head have only phone and desktop files, no dark. Fix the claim or the looks.

4 and **dark** (Ink). The ratios are computed from `src/design/themes.ts`, and `test/contrast-table.test.ts` fails when a
5 row is missing or a ratio is not the computed one.
6
7 This table names the pairs; it does not claim which page shows which. Pictures are the looks the forge attaches to a
8 pull for the pages of `app.looks` in forge.json; they are not stored here.
9
outdated

'Shown on' is unchecked against the rendered pages; verify on the preview or remove the column.

10 | Pair (foreground on background) | Light | Dark |
11 | --- | --- | --- |
12 | `--fg` on `--bg` | 16.97 | 18.10 |
13 | `--fg` on `--card` | 17.72 | 17.16 |
14 | `--fg` on `--muted` | 16.12 | 15.62 |
15 | `--muted-fg` on `--bg` | 5.14 | 7.76 |
16 | `--muted-fg` on `--card` | 5.36 | 7.36 |
17 | `--muted-fg` on `--muted` | 4.88 | 6.70 |
18 | `--accent` on `--bg` | 4.95 | 7.88 |
19 | `--accent` on `--card` | 5.17 | 7.47 |
20 | `--accent-fg` on `--accent` | 5.17 | 7.78 |
21 | `--primary-fg` on `--primary` | 16.97 | 16.97 |
22
23 If a picture shows a pair below 4.5:1, file the defect; the table is not patched to match.
test/contrast-table.test.ts added +25
@@ -0,0 +1,25 @@
1 import { describe, expect, test } from "bun:test";
2 import { readFileSync } from "node:fs";
3 import { contrast, PAIRS } from "../src/design/contrast.ts";
4 import { THEMES } from "../src/design/themes.ts";
5
6 const doc = readFileSync(new URL("../docs/design/contrast.md", import.meta.url), "utf8");
7 const forge = JSON.parse(readFileSync(new URL("../forge.json", import.meta.url), "utf8"));
8
9 describe("contrast table and looks (#13069)", () => {
10 test("docs/design/contrast.md has one row per pair with the computed light and dark ratios", () => {
11 for (const [f, b] of PAIRS) {
12 const row = doc.split("\n").find((l) => l.startsWith(`| \`--${f}\` on \`--${b}\` |`));
13 expect(row).toBeDefined();
14 const cells = row!.split("|").map((c) => c.trim());
15 const light = contrast(THEMES.light.tokens[f], THEMES.light.tokens[b]).toFixed(2);
16 const dark = contrast(THEMES.dark.tokens[f], THEMES.dark.tokens[b]).toFixed(2);
17 expect([cells[2], cells[3]]).toEqual([light, dark]);
18 }
19 });
20 test("forge.json pictures /, /apps and /settings/crew, the settings page as the owner", () => {
21 const looks: string[] = forge.app.looks;
22 for (const p of ["/", "/apps", "/settings/crew"]) expect(looks).toContain(p);
23 expect(forge.app.looksAsOwner).toContain("/settings/crew");
24 });
25 });

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs