Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions app/src/lib/artifacts/tokens.css
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@
--destructive: oklch(0.46 0.173 22.6);
--success: oklch(0.514 0.1 167.2);
--warning: oklch(0.521 0.143 47.7);
--border: oklch(0.108 0.042 264.7 / 20%);
--input: oklch(0.108 0.042 264.7 / 20%);
--border: oklch(0.108 0.042 264.7 / 10%);
--input: oklch(0.108 0.042 264.7 / 10%);
--ring: oklch(0.638 0.167 276.1);
--chart-1: oklch(0.46 0.2 264);
--chart-2: oklch(0.66 0.146 66);
Expand All @@ -34,7 +34,7 @@
--sidebar-primary-foreground: oklch(1 0 0);
--sidebar-accent: oklch(0.832 0.085 281.4 / 30%);
--sidebar-accent-foreground: oklch(0.108 0.042 264.7);
--sidebar-border: oklch(0.108 0.042 264.7 / 20%);
--sidebar-border: oklch(0.108 0.042 264.7 / 10%);
--sidebar-ring: oklch(0.638 0.167 276.1);
--radius: 0.625rem;
}
Expand All @@ -58,8 +58,8 @@
--destructive: oklch(0.792 0.121 16.4);
--success: oklch(0.832 0.13 170.1);
--warning: oklch(0.828 0.189 84.4);
--border: oklch(0.956 0.004 252 / 16%);
--input: oklch(0.956 0.004 252 / 16%);
--border: oklch(0.956 0.004 252 / 12%);
--input: oklch(0.956 0.004 252 / 12%);
--ring: oklch(0.713 0.151 277.7);
--chart-1: oklch(0.58 0.2 264);
--chart-2: oklch(0.76 0.168 66);
Expand All @@ -73,6 +73,6 @@
--sidebar-primary-foreground: oklch(0.108 0.017 252);
--sidebar-accent: oklch(0.832 0.085 281.4 / 12%);
--sidebar-accent-foreground: oklch(0.956 0.004 252);
--sidebar-border: oklch(0.956 0.004 252 / 16%);
--sidebar-border: oklch(0.956 0.004 252 / 12%);
--sidebar-ring: oklch(0.713 0.151 277.7);
}
3 changes: 2 additions & 1 deletion app/src/skins/openfuse/skin.css
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,8 @@
);
--openfuse-pill: var(--card);
--openfuse-pill-border: var(--border);
--openfuse-handle: var(--border);
/* A sheet's grab handle is a mark to find, not a line: secondary text, as the scrollbar's thumb. */
--openfuse-handle: var(--muted-foreground);
--openfuse-quiet: var(--muted-foreground);
--openfuse-green-dot: var(--success);
--openfuse-green-ring: color-mix(in oklab, var(--success) 25%, transparent);
Expand Down
21 changes: 13 additions & 8 deletions app/src/theme.css
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@
--destructive: oklch(0.46 0.173 22.6);
--success: oklch(0.514 0.1 167.2);
--warning: oklch(0.521 0.143 47.7);
--border: oklch(0.108 0.042 264.7 / 20%);
--input: oklch(0.108 0.042 264.7 / 20%);
--border: oklch(0.108 0.042 264.7 / 10%);
--input: oklch(0.108 0.042 264.7 / 10%);
--ring: oklch(0.638 0.167 276.1);
--chart-1: oklch(0.46 0.2 264);
--chart-2: oklch(0.66 0.146 66);
Expand All @@ -46,7 +46,7 @@
--sidebar-primary-foreground: oklch(1 0 0);
--sidebar-accent: oklch(0.832 0.085 281.4 / 30%);
--sidebar-accent-foreground: oklch(0.108 0.042 264.7);
--sidebar-border: oklch(0.108 0.042 264.7 / 20%);
--sidebar-border: oklch(0.108 0.042 264.7 / 10%);
--sidebar-ring: oklch(0.638 0.167 276.1);
/* end of tokens/src/scheme.ts */
/*
Expand Down Expand Up @@ -84,8 +84,8 @@
--destructive: oklch(0.792 0.121 16.4);
--success: oklch(0.832 0.13 170.1);
--warning: oklch(0.828 0.189 84.4);
--border: oklch(0.956 0.004 252 / 16%);
--input: oklch(0.956 0.004 252 / 16%);
--border: oklch(0.956 0.004 252 / 12%);
--input: oklch(0.956 0.004 252 / 12%);
--ring: oklch(0.713 0.151 277.7);
--chart-1: oklch(0.58 0.2 264);
--chart-2: oklch(0.76 0.168 66);
Expand All @@ -99,7 +99,7 @@
--sidebar-primary-foreground: oklch(0.108 0.017 252);
--sidebar-accent: oklch(0.832 0.085 281.4 / 12%);
--sidebar-accent-foreground: oklch(0.956 0.004 252);
--sidebar-border: oklch(0.956 0.004 252 / 16%);
--sidebar-border: oklch(0.956 0.004 252 / 12%);
--sidebar-ring: oklch(0.713 0.151 277.7);
/* end of tokens/src/scheme.ts */
--empty-pattern-opacity: 0.15;
Expand Down Expand Up @@ -220,14 +220,19 @@ body {
background: transparent;
}

/*
* The thumb is `muted-foreground`, not `border`. A line is about 1.25:1, too faint for the one
* mark that says a list scrolls and where you are in it. `muted-foreground` is 4.5:1 or more on
* every surface, in light and dark.
*/
::-webkit-scrollbar-thumb {
background: var(--border);
background: var(--muted-foreground);
border-radius: 5px;
}

* {
scrollbar-width: thin;
scrollbar-color: var(--border) transparent;
scrollbar-color: var(--muted-foreground) transparent;
}
}

Expand Down
31 changes: 25 additions & 6 deletions app/tests/ui-look-theme.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,14 +50,15 @@ describe("the look's theme values", () => {
});

/*
* A hairline is the text color, at 20% in light and 16% in dark (Guido, 2026-11-24): about 1.6:1
* against a card in both themes, where the scheme's old border was 1.37 in light and 1.20 in dark
* and all but vanished. One value for lines between things, a field's edge and the sidebar's
* lines, so no line in the app is fainter than another.
* A hairline is the text color, at 10% in light and 12% in dark (Sam, 2026-12-01): about 1.25:1
* against a card in light and 1.38:1 in dark. At 20% and 16% (1.6:1) cards and rows read heavy and
* boxed beside ChatGPT, Claude and Grok, whose lines are 4% to 10%. One value for lines between
* things, a field's edge and the sidebar's lines, so no line in the app is fainter than another.
* An edge that must reach 3:1 (a checkbox's) is `muted-foreground`, never a line.
*/
test.each([
[":root", "20%"],
[".dark", "16%"],
[":root", "10%"],
[".dark", "12%"],
])("%s draws every line in the text color at %s", (selector, strength) => {
const block =
new RegExp(
Expand All @@ -73,4 +74,22 @@ describe("the look's theme values", () => {
value: `${foreground} / ${strength})`,
});
});

/*
* A line is too faint for a mark someone has to find: the thumb that shows a list scrolls, and the
* grab handle on OpenFuse's sheets. Both are drawn in secondary text.
*/
test("the scrollbar's thumb and OpenFuse's sheet handle are muted-foreground, never a line", () => {
expect(withoutComments).toMatch(
/::-webkit-scrollbar-thumb\s*\{[^}]*background:\s*var\(--muted-foreground\);/,
);
expect(withoutComments).toMatch(
/scrollbar-color:\s*var\(--muted-foreground\) transparent;/,
);
const openfuse = readFileSync(
new URL("../src/skins/openfuse/skin.css", import.meta.url),
"utf8",
).replace(/\/\*[\s\S]*?\*\//g, "");
expect(openfuse).toMatch(/--openfuse-handle:\s*var\(--muted-foreground\);/);
});
});
4 changes: 2 additions & 2 deletions desktop/src-tauri/src/connected/sign_in.rs
Original file line number Diff line number Diff line change
Expand Up @@ -959,7 +959,7 @@ const END_PAGE_STYLE: &str = r#"
--foreground: oklch(0.108 0.042 264.7);
--card: oklch(1 0 0);
--muted-foreground: oklch(0.506 0.045 257.4);
--border: oklch(0.108 0.042 264.7 / 20%);
--border: oklch(0.108 0.042 264.7 / 10%);
--sidebar: oklch(0.948 0.01 251.8);
/* end of tokens/src/scheme.ts */
--radius: 0.625rem;
Expand All @@ -973,7 +973,7 @@ const END_PAGE_STYLE: &str = r#"
--foreground: oklch(0.956 0.004 252);
--card: oklch(0.212 0.017 252);
--muted-foreground: oklch(0.69 0.016 252);
--border: oklch(0.956 0.004 252 / 16%);
--border: oklch(0.956 0.004 252 / 12%);
--sidebar: oklch(0.156 0.017 252);
/* end of tokens/src/scheme.ts */
--shadow: 0 1px 3px 0 rgb(0 0 0 / 0.4), 0 1px 2px -1px rgb(0 0 0 / 0.4);
Expand Down
8 changes: 4 additions & 4 deletions desktop/src-tauri/src/first_paint.rs
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ pub const LIGHT: Palette = Palette {
// tokens/src/scheme.ts, light: ground=sidebar card=card border=border ink=foreground soft=muted-foreground (bun run tokens:generate)
ground: (0xe9, 0xee, 0xf4),
card: (0xff, 0xff, 0xff),
border: (0xcc, 0xcd, 0xd0),
border: (0xe6, 0xe6, 0xe7),
ink: (0x01, 0x03, 0x13),
soft: (0x55, 0x66, 0x7f),
// end of tokens/src/scheme.ts
Expand All @@ -78,7 +78,7 @@ pub const DARK: Palette = Palette {
// tokens/src/scheme.ts, dark: ground=sidebar card=card border=border ink=foreground soft=muted-foreground (bun run tokens:generate)
ground: (0x07, 0x0d, 0x14),
card: (0x13, 0x19, 0x20),
border: (0x36, 0x3c, 0x42),
border: (0x2d, 0x33, 0x39),
ink: (0xee, 0xf1, 0xf3),
soft: (0x94, 0x9c, 0xa5),
// end of tokens/src/scheme.ts
Expand Down Expand Up @@ -849,12 +849,12 @@ mod tests {
// Light, then dark.
"--sidebar: oklch(0.948 0.01 251.8);",
"--card: oklch(1 0 0);",
"--border: oklch(0.108 0.042 264.7 / 20%);",
"--border: oklch(0.108 0.042 264.7 / 10%);",
"--foreground: oklch(0.108 0.042 264.7);",
"--muted-foreground: oklch(0.506 0.045 257.4);",
"--sidebar: oklch(0.156 0.017 252);",
"--card: oklch(0.212 0.017 252);",
"--border: oklch(0.956 0.004 252 / 16%);",
"--border: oklch(0.956 0.004 252 / 12%);",
"--foreground: oklch(0.956 0.004 252);",
"--muted-foreground: oklch(0.69 0.016 252);",
"--surface-main: var(--sidebar);",
Expand Down
8 changes: 4 additions & 4 deletions desktop/src/styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@
--muted-foreground: oklch(0.506 0.045 257.4);
--destructive: oklch(0.46 0.173 22.6);
--success: oklch(0.514 0.1 167.2);
--border: oklch(0.108 0.042 264.7 / 20%);
--input: oklch(0.108 0.042 264.7 / 20%);
--border: oklch(0.108 0.042 264.7 / 10%);
--input: oklch(0.108 0.042 264.7 / 10%);
--ring: oklch(0.638 0.167 276.1);
--sidebar: oklch(0.948 0.01 251.8);
--sidebar-accent: oklch(0.832 0.085 281.4 / 30%);
Expand Down Expand Up @@ -2527,8 +2527,8 @@ main > .sheet:has(.journey.handing-off) .self-contained-why {
--muted-foreground: oklch(0.69 0.016 252);
--destructive: oklch(0.792 0.121 16.4);
--success: oklch(0.832 0.13 170.1);
--border: oklch(0.956 0.004 252 / 16%);
--input: oklch(0.956 0.004 252 / 16%);
--border: oklch(0.956 0.004 252 / 12%);
--input: oklch(0.956 0.004 252 / 12%);
--ring: oklch(0.713 0.151 277.7);
--sidebar: oklch(0.156 0.017 252);
--sidebar-accent: oklch(0.832 0.085 281.4 / 12%);
Expand Down
5 changes: 3 additions & 2 deletions docs/app-guidelines.md
Original file line number Diff line number Diff line change
Expand Up @@ -225,8 +225,9 @@ things are drawn, not how big they are.
step and no corner of its own (`rounded-[20px]`).
4. **Surfaces.** The frame (`sidebar`), the panel the page sits in (`background`), cards on it
(`card`). A card has a hairline border in light and in dark. Every line (`border`, a field's
`input`, the sidebar's `sidebar-border`) is the text color at 20% in light and 16% in dark,
about 1.6:1 against a card in both, so no line in the app is fainter than another.
`input`, the sidebar's `sidebar-border`) is the text color at 10% in light and 12% in dark,
about 1.25:1 against a card in light and 1.38:1 in dark, so no line in the app is fainter than
another. A line is never the only cue of a control: a checkbox's edge is `muted-foreground`.
5. **Shadows.** A shadow says how far something floats, as Linear draws it, and Tailwind's own
steps only:
- none for everything in the page: the panel, cards, rows, fields, the sidebar;
Expand Down
9 changes: 6 additions & 3 deletions docs/design-system.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,8 @@ A screen is a few surfaces, one on another. Each level has its token, and the to

On a surface, a fill marks a part of it: `secondary` and `muted` for a button, a badge or a tile,
`accent` for the highlighted row of a menu. Each surface and fill has a `-foreground` for the text
on it. Every line is `border`, the text color at one strength, so no line is fainter than another.
on it. Every line is `border`, the text color at one strength (10% in light, 12% in dark), so no
line is fainter than another.

- **Choose the level by what the thing is,** never by the shade you want. A group of rows is a
card. If a card looks wrong where you put it, the layout is wrong, not the token.
Expand Down Expand Up @@ -152,8 +153,10 @@ icons a screen draws with. What it leaves to this page:
onboarding and empty states included. If a design hands you a video of an animation, build the
animation.
- **Check contrast before you choose a color,** in light and in dark: 4.5:1 for text, 3:1 for the
edge of a control that has no other cue, such as a checkbox, and for the focus ring. A color that
fails as text is not rescued with a second token for "the same color, as text".
edge of a control that has no other cue, such as a checkbox, and for the focus ring. A line
(`border`, `input`) is about 1.25:1 against a card in light and 1.38:1 in dark, so such an edge,
and a mark like the scrollbar's thumb, is `muted-foreground`, never a line. A color that fails as
text is not rescued with a second token for "the same color, as text".
- **Motion stops when less motion is asked for.** An animation in code can stand still. Don't
swap in a picture of one frame.

Expand Down
12 changes: 6 additions & 6 deletions mobile/src/scheme.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ export const scheme = {
destructive: "#a31526",
success: "#12795b",
warning: "#a84900",
border: "#01031333",
input: "#01031333",
border: "#0103131a",
input: "#0103131a",
ring: "#727eef",
"chart-1": "#1949c5",
"chart-2": "#cd7d04",
Expand All @@ -35,7 +35,7 @@ export const scheme = {
"sidebar-primary-foreground": "#ffffff",
"sidebar-accent": "#bec2ff4d",
"sidebar-accent-foreground": "#010313",
"sidebar-border": "#01031333",
"sidebar-border": "#0103131a",
"sidebar-ring": "#727eef",
},
dark: {
Expand All @@ -56,8 +56,8 @@ export const scheme = {
destructive: "#ff9aa0",
success: "#5fe3bb",
warning: "#ffb900",
border: "#eef1f329",
input: "#eef1f329",
border: "#eef1f31f",
input: "#eef1f31f",
ring: "#8d97ff",
"chart-1": "#3a70ee",
"chart-2": "#f79807",
Expand All @@ -71,7 +71,7 @@ export const scheme = {
"sidebar-primary-foreground": "#020409",
"sidebar-accent": "#bec2ff1f",
"sidebar-accent-foreground": "#eef1f3",
"sidebar-border": "#eef1f329",
"sidebar-border": "#eef1f31f",
"sidebar-ring": "#8d97ff",
},
} as const;
Expand Down
18 changes: 12 additions & 6 deletions tokens/src/scheme.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,14 @@ const light: Palette = {
destructive: "oklch(0.46 0.173 22.6)",
success: "oklch(0.514 0.1 167.2)",
warning: "oklch(0.521 0.143 47.7)",
border: "oklch(0.108 0.042 264.7 / 20%)",
input: "oklch(0.108 0.042 264.7 / 20%)",
/*
* Every line (`border`, `input`, `sidebar-border`) is the text color at one strength: 10% here,
* 12% in dark. That is about 1.25:1 against a card in light and 1.38:1 in dark, as light as the
* lines in ChatGPT, Claude and Grok. A line is never the only cue of a control: a checkbox's or a
* radio's edge is `muted-foreground` (docs/design-system.md).
*/
border: "oklch(0.108 0.042 264.7 / 10%)",
input: "oklch(0.108 0.042 264.7 / 10%)",
ring: "oklch(0.638 0.167 276.1)",
/*
* The chart series are OpenBot's own hues: the brand blue, warning's amber, success's teal,
Expand All @@ -102,7 +108,7 @@ const light: Palette = {
"sidebar-primary-foreground": "oklch(1 0 0)",
"sidebar-accent": "oklch(0.832 0.085 281.4 / 30%)",
"sidebar-accent-foreground": "oklch(0.108 0.042 264.7)",
"sidebar-border": "oklch(0.108 0.042 264.7 / 20%)",
"sidebar-border": "oklch(0.108 0.042 264.7 / 10%)",
"sidebar-ring": "oklch(0.638 0.167 276.1)",
};

Expand Down Expand Up @@ -131,8 +137,8 @@ const dark: Palette = {
destructive: "oklch(0.792 0.121 16.4)",
success: "oklch(0.832 0.13 170.1)",
warning: "oklch(0.828 0.189 84.4)",
border: "oklch(0.956 0.004 252 / 16%)",
input: "oklch(0.956 0.004 252 / 16%)",
border: "oklch(0.956 0.004 252 / 12%)",
input: "oklch(0.956 0.004 252 / 12%)",
ring: "oklch(0.713 0.151 277.7)",
"chart-1": "oklch(0.58 0.2 264)",
"chart-2": "oklch(0.76 0.168 66)",
Expand All @@ -146,7 +152,7 @@ const dark: Palette = {
"sidebar-primary-foreground": "oklch(0.108 0.017 252)",
"sidebar-accent": "oklch(0.832 0.085 281.4 / 12%)",
"sidebar-accent-foreground": "oklch(0.956 0.004 252)",
"sidebar-border": "oklch(0.956 0.004 252 / 16%)",
"sidebar-border": "oklch(0.956 0.004 252 / 12%)",
"sidebar-ring": "oklch(0.713 0.151 277.7)",
};

Expand Down
Loading