Skip to content

Colour the pick card's report so it is easier to read - #94

Merged
adamXbot merged 1 commit into
websitefrom
feat/website-pick-card-colours
Oct 31, 2026
Merged

adamXbot merged 1 commit into
websitefrom
feat/website-pick-card-colours

Conversation

@adamXbot

Copy link
Copy Markdown
Collaborator

Follow-up to #93. The pick card's report was a single colour, so property names, values and the classes in each selector ran together.

What changes

  • Colour by token. lib/pick-report.ts now splits the report into tokens (reportTokens, selectorTokens, valueTokens), and the card gives each kind its own colour:
    • labels such as classes, box, styles and styled by… are dimmed;
    • property names, values and class names each get a colour;
    • attribute tests like [data-retro] and pseudo-classes like :hover stand out within rule selectors;
    • @layer notes and counts are dimmed and set in italics.
  • Aligned values. Style values line up in a column. A value that wraps, such as inset on a box-shadow, hangs under its column.
  • Colour swatches. Colour values get a swatch drawn over a checkerboard, so translucent colours show as translucent. This covers rgb, hsl, oklch, oklab and the other colour functions. Screen readers skip the swatch.
  • A palette per time-machine stop: DOS colours in 1999, dark ink on white for the 2003 Mac Terminal, and xterm colours in 2002. Every token colour meets 4.5:1 on its console.
  • reportLines keeps the CLI's wording; the only change is the aligned values.

Testing

  • npm run typecheck, npm run lint and npm run check:audit are clean. npm test passes 41 tests; new cases cover selector, value and line tokens and the alignment.
  • npm run test:browser passes 70 tests in Chromium and Firefox. The report test also checks that four token kinds have distinct colours, the swatch's aria-hidden and paint, and the wrapped-value indent.
  • Screenshots were checked in the default card and in all three time-machine stops.

🤖 Generated with Claude Code

The pick card's report was one colour, so property names, values and the classes in each selector ran together. The report is now split into tokens and each kind keeps its own colour: labels are dimmed, property names, values and classes are coloured apart, and attribute tests and pseudo-classes in rule selectors stand out. Layer notes and counts are dimmed and set in italics.

Style values line up in a column, and a value that wraps stays under it. Colour values, including the oklch and oklab that Tailwind uses, get a swatch over a checkerboard, so translucent colours show as such; screen readers skip it.

Each time-machine terminal has its own palette: DOS colours in 1999, dark ink on white in the 2003 Mac Terminal, and xterm colours in 2002. Every token colour meets 4.5:1 on its console. The plain-text report keeps the CLI's wording apart from the aligned values.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@adamXbot
adamXbot merged commit fe5545f into website Oct 31, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant