Skip to content

Fence scan and spec trees, rework serve reading typography - #207

Merged
damusix merged 1 commit into
nextfrom
worktree-doc-legibility
Aug 18, 2026
Merged

Fence scan and spec trees, rework serve reading typography#207
damusix merged 1 commit into
nextfrom
worktree-doc-legibility

Conversation

@damusix

@damusix damusix commented Aug 17, 2026

Copy link
Copy Markdown
Owner

Three patches against how atomic serve renders documentation.

signals scan and the spec template now fence their trees and outlines. Half the existing specs already fenced them and half indented them; nothing stated which, so the template, the currency rule, /atomic-plan and the reviewer now all say fenced. Flows stay real markdown so steps keep inline code and links.

Unlabeled fences no longer go through chroma. It colored nothing on them — the plaintext lexer has one token type — while stamping a Monokai background inline, so a file tree rendered as a dark box on paper. Labeled fences are untouched.

The typography pass follows published defaults from GitHub, Tailwind Typography, VitePress, Infima and MDN. Two changes are judgment calls worth a look: prose now caps at 40em per element, reversing a deliberate comment that declined a measure, and .md-content links move off the brand amber, which measures 3.5:1 on light paper against the 4.5:1 WCAG 1.4.3 floor. Chrome keeps the brand value.

@damusix
damusix force-pushed the worktree-doc-legibility branch 2 times, most recently from 62b1d82 to a7b4b08 Compare August 18, 2026 13:14
@damusix
damusix marked this pull request as ready for review August 18, 2026 13:40
Chroma emits token classes rather than inline colors, so one rendered
document follows the theme toggle, and every fence renders as a titled
window — unlabeled ones as `text`, since a tree or an outline is still a
block someone set apart.

Mermaid draws from the repo's own ramp instead of stock palettes, which
were near-monochrome in dark mode, and diagrams gain fullscreen with pan
and zoom. Diagram labels take a boundary color: mermaid wraps markdown
labels in <p>, so the page's prose color was painting them onto a fill.

Reading typography follows published doc-system defaults — a per-element
prose measure, relative code sizing, a 300px pressure on table columns,
and links off the brand amber, which measures 3.5:1 on light paper
against the 4.5:1 WCAG floor.

Specs and `atomic signals scan` fence their trees and outlines; that is
what makes them render as blocks rather than reflowed prose.

Includes the Page memoization fix, without which none of the above
survives a click: React 19 diffs props by identity, so a fresh { __html }
wrapper per render re-set the body innerHTML on any re-render and
discarded every SVG and control written into it after mount.
@damusix
damusix force-pushed the worktree-doc-legibility branch from a7b4b08 to 8625686 Compare August 18, 2026 13:50
@damusix
damusix merged commit 1f7102f into next Aug 18, 2026
2 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