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

The shared components stylesheet uses only design tokens, focus-visible, forced-colours answers and 24 px targets #3729

Merged opened this

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

Merged

`src/web/style/components.ts` now has no design-lint findings: `bun scripts/design-lint.ts` passes and its baseline entries are at zero. The earlier check failure came from the topbar search input being 13px, which the lint counts as an iOS-zooming input. I changed it back to 16px, the value it had before the last commit.

shipped production is serving it deploy ee63e4f

opened this

src/web/style/components.ts now has no design-lint findings: bun scripts/design-lint.ts passes and its baseline entries are at zero. The earlier check failure came from the topbar search input being 13px, which the lint counts as an iOS-zooming input. I changed it back to 16px, the value it had before the last commit.

  • Test change: test/components-palette-focus.test.ts had pinned that input at 13px, so I changed the test, not just the code, to expect 16px.
  • Visual change: the desktop topbar search text goes from 13px back to 16px. The issue's "nothing changed by eye" holds against the original stylesheet but not against the previous commit on this branch, which had set it to 13px.
  • Tests: I ran the palette-focus test and the design-lint test; the palette-focus test passes and the design-lint test passed in the same run. I did not get a result from the full bun test; the run timed out in this sandbox, so the forge's check will be the first full run.
  • Not done: I did not touch the file's motion rules, which another issue owns. The before/after light and dark screenshots the issue asks for are not attached, because the sandbox can't take them.

To try it, run bun scripts/design-lint.ts, then open any page with the topbar search and compare its text size to the other inputs.

Closes #3549

commented

src/web/style/components.ts now has no design-lint findings: bun scripts/design-lint.ts passes and its baseline entries are at zero. The earlier check failure came from the topbar search input being 13px, which the lint counts as an iOS-zooming input. I changed it back to 16px, the value it had before the last commit.

  • Test change: test/components-palette-focus.test.ts had pinned that input at 13px, so I changed the test, not just the code, to expect 16px.
  • Visual change: the desktop topbar search text goes from 13px back to 16px. The issue's "nothing changed by eye" holds against the original stylesheet but not against the previous commit on this branch, which had set it to 13px.
  • Tests: I ran the palette-focus test and the design-lint test; the palette-focus test passes and the design-lint test passed in the same run. I did not get a result from the full bun test; the run timed out in this sandbox, so the forge's check will be the first full run.
  • Not done: I did not touch the file's motion rules, which another issue owns. The before/after light and dark screenshots the issue asks for are not attached, because the sandbox can't take them.

To try it, run bun scripts/design-lint.ts, then open any page with the topbar search and compare its text size to the other inputs.

Approved — before the latest push

Approved. Read from the diff only: my sandbox could not reach the preview host, and I did not open the screenshots. The stylesheet change is sound. The :focus rules become :focus-visible, so keyboard users still get a ring. The forced-colours block paints a real outline, and the avatar hues now live in one place with a test pinning twelve. The tabs underline keeps its 2px height: top calc(100% - 1px) with bottom -1px works out the same.

Two things I would do next:

  1. Add the before and after light and dark avatar screenshots the issue asked for. The hsl to oklch conversion is close but not pixel-identical, and the lightest buckets (2, 3, 4) have the lowest initials contrast. Check them.
  2. Rewrite the tabs underline as height: 2px with bottom: -1px. The calc form is obscure, and the test or lint should not need it.

The 13px to 16px topbar search change is a visible desktop difference. It matches the original stylesheet, and the pull says so.

commented

I merged main into the branch and pushed it. The only conflict was in src/web/style/components.ts, in two places.

  • Avatar: I kept this branch's data-h palette, which sets --av and --av-ink. I dropped the --hue hsl rules that main still had. I took main's var(--fs-min) for the font size.
  • .row-meta .avatar: I also took var(--fs-min) for its font size. The branch had a hard-coded 0.53125rem.

I ran the four design and style test files directly: the palette-focus, reduced-motion, design-lint and design-audit tests. They pass, 20 of 20.

The full bun test run did not finish within my time limit, so I didn't see a result. The tsc --noEmit check failed with a bun temp-directory write error ("ReadOnlyFileSystem"). It never type-checked anything. The forge's check on this push will be the first full run.

Changes requested — before the latest push

The focus-visible, forced-colours and 16px-input fixes are right. The avatar palette is a regression, though, so I'm requesting changes.

First fix: recompute the --av-ink values for data-h 1 to 6 (and check 0 and 7 to 11). The comment says the twelve are the old hsl(h 62% 42%) inks. They are not. Hues 2 to 5 use ink lightness of 66 to 71%. Old HSL 42% green is about oklch 58 to 62%. I estimated the contrast of each ink against its 22% tint over a white card in light theme. It comes to roughly 2.5 to 2.9 for the lime and green hues (data-h 2, 3, 4, 5), about 3.2 for 6, and 3.5 for 1. The old HSL values were noticeably darker. These are initials at --fs-min, so WCAG 1.4.3 wants at least 4.5. Convert each hue from the real HSL values, or darken the inks until the contrast is at least 4.5 in both themes.

Second, add a test that fails when an avatar ink is too light. The new tests only count rules and grep strings, so they would not catch this.

Third, the fallback --av is now hue 262, where the old default was --hue, 220. Either match it or say why it changed.

I did not take the page-level screenshots, since the sandbox has no way to render them. The pull says the before/after images are missing, and I would want them for an avatar change.

commented

Both of juniper's comments are addressed. I ran test/components-palette-focus.test.ts, test/design-lint.test.ts and bun scripts/design-lint.ts, which all pass. I did not run the full bun test, so the forge's check will be its first run.

  • Contrast on the initials (hues 2–5): I computed the contrast and you were right. The old initials were 88% hue ink and 12% --fg, and even the original 42% HSL lightness fell short. No single ink works in both a light and a dark theme, because a dark ink fails on a dark card. Initials are now 28% hue ink and 72% --fg. I checked every theme in src/design/themes.ts against all twelve hues. The worst case is about 4.5:1 (hue 117), and the rest clear it. The hue now shows mostly in the tinted circle and its ring, and the initials look closer to neutral. test/components-palette-focus.test.ts has a new test that pins the 28%/--fg mix.
  • Default hue: I'm keeping 262. The old fallback hsl(220 62% 52%) is the same blue written as oklch hue 262, so the colour is unchanged. I added a comment in src/web/style/components.ts that says so.

I left --av-ink in place and did not remove it. At 28% it only slightly tints the initials.

Approved — before the latest push

Approved. The stylesheet now uses focus-visible only, has a forced-colours focus outline, keeps the 16px topbar input (no iOS zoom), and moves the avatar hues into components.ts as oklch tokens. Initials hold 4.5:1 by mixing 72% --fg. The baseline is at zero and the new tests pin each change. Two things to do next: (1) the avatar initials are now close to neutral, so check the 20px circles by eye in dark and light themes and consider a stronger ring if the hue is hard to tell apart; (2) add a forced-colors rule for .topbar-search:focus-within, because its ring is only a border-colour change and forced colours may drop it.

commented

I merged main into the branch and pushed. docs/design/baseline.json was the only conflict.

On the conflict, main still had the old non-zero counts for src/web/style/components.ts. This branch has them at zero, because the stylesheet now passes the design lint. I kept the branch's side, including its zeroed content.ts entry. main has no content.ts entry, so that entry is not something main removed or changed.

After the merge I ran bun scripts/design-lint.ts (clean) and the design-lint and palette-focus tests (14 pass, 0 fail). I did not run the full bun test, so the forge's check is its first full run.

Approved — before the latest push

The diff matches the issue. The lint baseline is at zero, the avatar palette is one set of 12 data-h rules in components.ts, and the preview answers 200. I did not check the preview CSS or take screenshots.

Two things I would do next:

  1. Add the before/after light and dark screenshots the issue asked for. The topbar search text going from 13px to 16px on desktop is a visible change, so say so in the pull.
  2. Check the avatar contrast on hues 2-5 in the preview. The worst case is about 4.5:1, so there is no margin if a theme changes. Pin the 28% ink mix against the theme list in a test.

The test file is named for the palette and now also covers avatars and the topbar. Rename it, or split it, when you next touch it.

commented

I merged main into the branch and pushed it. The merge had one conflict, in docs/design/baseline.json.

  • Conflict: the colour count for src/web/style/components.ts. My side had it at 0 and main had it at 3. I kept 0, because this pull is what removes those colour violations from the shared stylesheet. components.ts itself merged without conflict.
  • Tests: the three design suites (design-lint, design-audit, design-map) pass, 18 tests. I started the full bun test but it ran past the 2-minute limit and I never saw its result, so the forge's check on this push is the first full run since the merge.
Approved

Approved. The stylesheet now uses tokens only. Avatar hues live in one place (12 data-h rules setting --av), :focus is replaced by :focus-visible, forced-colours gets a Highlight outline, and the tab underline no longer relies on a fixed height. Initials are 28% hue ink over --fg, which keeps 4.5:1 in every theme. Tests pin each change and the design-lint baseline is at zero. I read the diff and did not exercise the preview. Two things I would do next: (1) the forced-colors block covers .input, the palette input and .color-field but not .topbar-search:focus-within, whose input has outline:none and relies on a border-colour change. Give it the same Highlight outline. (2) The desktop topbar search text is now 16px, a visible change from 13px. Add the before/after screenshots the issue asked for so a person can confirm it is intended.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs