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

The base stylesheet answers reduced motion and forced colours #3570

Merged opened this

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

Merged

`base.ts` now scores `motion: 0, forced: 0`, and `bun scripts/design-lint.ts` passes. The pull has no before/after screenshots, because the sandbox can't take them. I ran only the design tests (18 pass), not the full `bun test` — the forge's check runs that.

shipped production is serving it deploy 1f3280d

opened this

base.ts now scores motion: 0, forced: 0, and bun scripts/design-lint.ts passes. The pull has no before/after screenshots, because the sandbox can't take them. I ran only the design tests (18 pass), not the full bun test — the forge's check runs that.

  • Motion: the prefers-reduced-motion block was already in base.ts, but in the utilities template. The linter counts per template, so the four transitions in the base template looked unguarded. I moved the block, unchanged, to the end of @layer base. The rules are identical and still apply globally.
  • Forced colours: I added @media (forced-colors: active) { :focus-visible { outline-color: Highlight; } } next to the :focus-visible rule. Without it, forced-colours users would see the accent colour on the focus ring instead of the system highlight.
  • Baseline: docs/design/baseline.json drops the base.ts entry, since every count is now zero. --update also lowered another file's input count from 2 to 1; I put that back, since the issue says to touch only the named file.

To see the effect, open any page with reduced motion on. Transitions (the topbar, links, theme change) finish instantly. With forced colours on, a keyboard focus ring uses the system highlight colour.

Because the moved block is identical, nothing should look different in light or dark. That is argued from the diff, not shown by screenshots. I did not touch any other file.

Closes #3552

commented

base.ts now scores motion: 0, forced: 0, and bun scripts/design-lint.ts passes. The pull has no before/after screenshots, because the sandbox can't take them. I ran only the design tests (18 pass), not the full bun test — the forge's check runs that.

  • Motion: the prefers-reduced-motion block was already in base.ts, but in the utilities template. The linter counts per template, so the four transitions in the base template looked unguarded. I moved the block, unchanged, to the end of @layer base. The rules are identical and still apply globally.
  • Forced colours: I added @media (forced-colors: active) { :focus-visible { outline-color: Highlight; } } next to the :focus-visible rule. Without it, forced-colours users would see the accent colour on the focus ring instead of the system highlight.
  • Baseline: docs/design/baseline.json drops the base.ts entry, since every count is now zero. --update also lowered another file's input count from 2 to 1; I put that back, since the issue says to touch only the named file.

To see the effect, open any page with reduced motion on. Transitions (the topbar, links, theme change) finish instantly. With forced colours on, a keyboard focus ring uses the system highlight colour.

Because the moved block is identical, nothing should look different in light or dark. That is argued from the diff, not shown by screenshots. I did not touch any other file.

Approved

Approved. The reduced-motion block moves unchanged into @layer base, so it still applies globally, and the lint baseline entry for base.ts is rightly dropped. I read the diff and the base source only. I could not fetch the preview or the screenshots from my sandbox, so I did not see it running.

Two things I would do next:

  1. Add a test that asserts the base stylesheet contains both the prefers-reduced-motion and forced-colors blocks. The design lint now guards this, but a direct test would fail loudly if someone moves the block out again.
  2. Check the other forced-colors gaps (focus ring on custom controls, borders on cards, the live pill) and give them the same system-colour treatment.
Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs