Skip to content

network diagram: use type tokens for step buttons and the note - #22

Merged
RodCor merged 1 commit into
mainfrom
cursor/network-diagram-step-note-tokens-e833
Nov 20, 2026
Merged

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

Conversation

@RodCor

@RodCor RodCor commented Nov 20, 2026 •

Copy link
Copy Markdown
Owner

Summary

.step now uses var(--km-text-sm) and .note uses var(--km-text-xs). Copy is unchanged, including 1.77x, 22% to 65%, and about 99%.

Computed size

Measured in Chrome on the static homepage. Root font size was 16px. --km-text-sm is 0.875rem and --km-text-xs is 0.75rem in global.css. The custom properties computed to .875rem and .75rem.

Element Before After 1440 and 390
.step 0.875rem var(--km-text-sm) 14px both
.note 0.75rem var(--km-text-xs) 12px both

The note stays display: none until reduced motion. With prefers-reduced-motion: reduce it is display: block and still 12px, before and after. Measured.

Judged: the tokens are the same rem values as the literals, so the computed size does not change.

Section height

Measured. #network after pausing on step 5. The before and after PNGs are byte-identical at both widths, and the reduced-motion frames are byte-identical too.

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

The diagram card was 382px at 1440 and 766px at 390 on both builds. With reduced motion at 1440 the section was 1572px on both, because the note is shown. Measured.

axe-core 4.14.1

Measured on the after homepage, paused on step 5. Tags wcag2a, wcag2aa, wcag21a, wcag21aa, wcag22aa.

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

Lighthouse

Measured. One Lighthouse process at a time, interleaved before then after. Local static builds, not the live site. Before is 88b8de6 on port 4180. After is this branch on port 4181.

Setup: mobile form factor, screen 412×823 at device scale 1.75, simulated throttling (RTT 150 ms, throughput 1638.4 kbps, request latency 562.5 ms, download 1474.56 kbps, upload 675 kbps, CPU slowdown 4×). Lighthouse 13.6.0. Chrome 157.0.8103.50 (HeadlessChrome/157.0.0.0 in the result). Flags: --only-categories=performance --form-factor=mobile --chrome-flags="--headless=new --no-sandbox --disable-gpu --disable-dev-shm-usage".

Run Before score LCP TBT CLS benchmarkIndex After score LCP TBT CLS benchmarkIndex
1 100 907.4 50.0 0 3709 100 906.7 73.5 0 3811
2 99 906.1 108.5 0 3077.5 100 905.5 51.5 0 3755.5
3 100 907.9 74.5 0 3644.5 100 906.9 48.5 0 3812.5
4 100 907.8 70.5 0 3815.5 100 906.5 51.0 0 3766.5
5 100 907.7 70.0 0 3736.5 100 907.8 76.5 0 3692.5
Median 100 907.7 70.5 0 100 906.7 51.5 0

Times are milliseconds. The after performance median does not drop. The one before score of 99 is the run with benchmarkIndex 3077.5 and TBT 108.5 ms. Measured.

Check

Measured. npm test passed, 45 tests. npm run build passed. npm run lint passed.

Screenshots

On pr-assets at e37abf5.

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 

Point .step at --km-text-sm and .note at --km-text-xs. Those tokens are 0.875rem and 0.75rem, the same sizes the literals were.

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

RodCor commented Nov 20, 2026

Copy link
Copy Markdown
Owner Author

approved at a57cba6.

  • consistency: .step and .note move to var(--km-text-sm) and var(--km-text-xs), and every font-size in network-diagram.module.css is now a token. the test asserts the full list plus the token values in global.css.
  • rendering doesn't change: computed 14 and 12 px before and after, and the shots at 1440, 390 and reduced motion are byte-identical. #network is still 1540 / 2932 px.
  • a11y: axe 0. perf: lighthouse local, 5 runs, median 100 before and after with cls 0 (the setup is noted, per kimetsu-perf-measurement).
  • the diff is 2 files, both inside network-diagram.*. no collision with layout's item 1. verify is green.

@RodCor
RodCor marked this pull request as ready for review November 20, 2026 16:56
@RodCor
RodCor merged commit f5e3c10 into main Nov 20, 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