Skip to content

network diagram: use type scale tokens for 13px and 15px - #21

Merged
RodCor merged 1 commit into
mainfrom
cursor/network-diagram-type-tokens-e833
Nov 13, 2026
Merged

RodCor merged 1 commit into
mainfrom
cursor/network-diagram-type-tokens-e833

Conversation

@RodCor

@RodCor RodCor commented Nov 13, 2026

Copy link
Copy Markdown
Owner

Summary

Diagram kickers, meta lines, and chips now use the existing homepage type tokens. Step buttons stay at 14px. Copy is unchanged, including 1.77x, 22% to 65%, and about 99%. Play, Previous, Next, and the step buttons are unchanged in the markup.

Mapping

Judged: 15px is 1px from both --km-text-sm (14px) and --km-text-md (16px). --km-text-sm keeps the kicker one step above the meta and chips. 13px is 1px from both --km-text-xs (12px) and --km-text-sm (14px). --km-text-xs keeps those labels on the caption step. Computed sizes below are measured in Chrome with a 16px root.

Element Before Token After Delta
Kicker 15px (0.9375rem) --km-text-sm (0.875rem) 14px −1px
Meta and chips 13px (0.8125rem) --km-text-xs (0.75rem) 12px −1px
Step buttons 14px (0.875rem) left as a literal 14px 0

The reduced-motion note stays 0.75rem. Measured computed size: 12px, and it stays display: none unless reduced motion is on.

Judged: tests/homepage-type-scale.test.mjs lists homepage TSX files and rejects Tailwind size utilities. The diagram CSS module does not fit that check, because the step buttons and the note stay literal sizes on purpose. The token assertion is in tests/network-diagram.test.mjs.

Font sizes

Measured. Chrome, static homepage, viewports 1440×900 and 390×844. A size is a distinct computed font-size on a visible element (not display: none or visibility: hidden) inside .km-home that has direct text or is a form control. document.body had the same sets.

Width Before (8c00bd5) After
1440 9 — 12px, 13px, 14px, 15px, 16px, 18px, 24px, 34.4px, 56px 7 — 12px, 14px, 16px, 18px, 24px, 34.4px, 56px
390 9 — 12px, 13px, 14px, 15px, 16px, 18px, 24px, 26.4px, 36px 7 — 12px, 14px, 16px, 18px, 24px, 26.4px, 36px

Section height

Measured. #network getBoundingClientRect().height after pausing on step 5. PNG heights match these numbers. The diagram card was 382px at 1440 and 766px at 390 on both builds.

Width Before After
1440 1540px 1540px
390 2932px 2932px

Controls

Measured after, tabbing from “Read the Network guide”: Play, Previous, Next, then steps 1–5. Judged unchanged, because the markup was not edited.

axe-core 4.14.0

Measured. Tags wcag2a, wcag2aa, wcag21a, wcag21aa, wcag22aa. Homepage paused on step 5.

Run Violations Passes Incomplete
After, 1440 0 30 1 (color-contrast, 14 nodes)
After, 390 0 30 1 (color-contrast, 14 nodes)

The same pause on main produced the same 14 color-contrast nodes. Measured. An unpaused main run was also 0 violations (30 passes, 11 incomplete nodes); the extra incomplete nodes are the step 5 labels, on both builds.

Lighthouse

Measured. Lighthouse 13.6.0, mobile, simulated throttling, performance category, local static build. Median of 5 runs.

Build Scores Median
Main 100, 100, 99, 100, 100 100
This branch 100, 100, 89, 100, 100 100

The 89 run had LCP 3763ms. The other nine runs had LCP about 910ms. Median is unchanged.

Check

Measured. npm run check passed: Biome, types, 45 tests, static build.

Screenshots

On pr-assets at 3e5f5d4.

1440 before

Network section before at 1440

1440 after

Network section after at 1440

390 before

Network section before at 390

390 after

Network section after at 390

Loop, steps 1, 3, and 5

Loop strip after at 1440

Reduced motion

Reduced motion after at 1440

Open in Web Open in Cursor 

Map kickers from 15px to --km-text-sm and meta and chip labels from 13px to --km-text-xs. Keep the step buttons at 14px.

Co-authored-by: Rodrigo <rodrigo.ccordoba@hotmail.com>
@RodCor

RodCor commented Nov 13, 2026

Copy link
Copy Markdown
Owner Author

approved at 8f7018a.

  • consistency: the kicker goes from 15 to 14 px (--km-text-sm), and the meta and chips go from 13 to 12 px (--km-text-xs). the home lands on the 7 scale sizes at 1440 and 390, and there's no new size.
  • layout: #network height is unchanged (1540 / 2932 px), so there's no shift. the after shots at 1440 and 390 read cleanly, and the step buttons stay at 14 px.
  • a11y: axe shows 0 violations, same as main. tab order and figures are unchanged.
  • perf: only font-size changes. lighthouse mobile median is 100 for both main and the PR on the local static build. that's a different setup from the 89 measured earlier, so it doesn't close the main perf follow-up.
  • verify is green.
    non-blocking: .step (0.875rem) and .note (0.75rem) are still raw values that equal sm and xs. move them to var(--km-text-sm) and var(--km-text-xs) in your next diagram PR, and change the test to assert the tokens instead of the literals.

@RodCor
RodCor marked this pull request as ready for review November 13, 2026 19:32
@RodCor
RodCor merged commit 88b8de6 into main Nov 13, 2026
1 check 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.

2 participants