Skip to content

refactor(website): substrate migration batch 3 — docs components off inline styles - #850

Merged
blove merged 4 commits into
mainfrom
blove/style-substrate-batch-3
Aug 29, 2026
Merged

refactor(website): substrate migration batch 3 — docs components off inline styles#850
blove merged 4 commits into
mainfrom
blove/style-substrate-batch-3

Conversation

@blove

@blove blove commented Aug 29, 2026

Copy link
Copy Markdown
Contributor

What

Batch 3 of the substrate migration (plan, Task 3) — the largest batch, and the one that unblocks the docs polish project: 22 components/docs files move to src/styles/docs.css, and every existing docs rule leaves global.css in a pure cut-paste commit, so docs styling now has exactly one home.

  • 4 commits: cut-paste, mdx components, docs chrome, API renderers + diagrams.
  • Both embedded <style> tags hoisted (DocsSidebar's [data-docs-navlink] rules with ${tokens.*}var(--*); ArchFlowDiagram's keyframes verbatim).
  • 5 presentation-only hover-handler pairs deleted (mdx Card/Tabs/CodeGroup/FeatureChips, CopyPromptButton) → :hover rules.
  • State → data-* modifiers: search result data-selected, TOC data-active, tabs data-active, copy buttons data-copied, callout rules on the existing data-tone.

Verified: 1238/1238 elements identical to production

The densest docs page (/docs/chat/components/chat) was hashed element-by-element against the live site at a pinned 1280×900 — sidebar, breadcrumb, article (all prose/tables/code figures), TOC, and prev/next: 1238 elements × 26 computed properties, zero mismatches.

Plus: vitest at the pre-existing baseline (5 failed | 341 passed), 0 lint errors, prod build green.

Migrated verbatim, NOT fixed — on purpose

The known docs defects ride through unchanged so the migration diff stays reviewable: the breadcrumb's inconsistent separator typography, paddingTop: 80, the docs shell's overflow-x-hidden, Steps' dangling connector, and the table min-width gap. They are called out in code comments and belong to the polish arc (findings).

What stayed inline: MdxRenderer's --tw-prose-* object (the documented escape hatch), LibraryMark's unbounded numeric size (now a --size custom property), CardGroup's cols-dependent grid template, and the rehype-supplied <pre> style passthrough.

🤖 Generated with Claude Code

blove added 4 commits August 29, 2026 13:50
…(pure cut-paste)

Relocates every .docs-prose rule, the code-figure rules
([data-rehype-pretty-code-*], .shiki), .docs-diagram/heading-anchor rules,
the .ag-ui-arch-grid block, and the --docs-* local-constants block from
global.css into docs.css. Zero edits — verified byte-identical via
git diff HEAD~1 (pure relocation, no content change).

Part of the inline-style substrate migration (Batch 3).
Migrates Callout, Steps, Card, Tabs, CodeBlock, CodeGroup, and FeatureChips
(components/docs/mdx) off inline style props onto data-mdx/.mdx-* classes
in docs.css. Callout's tone map becomes data-tone rules on its existing
attribute; Tabs/CodeGroup active-tab state and CodeBlock's copied state
become data-active/data-copied modifiers; the 5 presentation-only hover
handlers across Card, Tabs, CodeGroup, and FeatureChips become :hover
rules. headings.tsx has no style sites (skipped); MdxRenderer's
--tw-prose-* custom-property object is the documented escape hatch and
stays inline.

Part of the inline-style substrate migration (Batch 3).
Migrates DocsSidebar, DocsSearch, DocsTOC, DocsBreadcrumb, DocsPageHeader,
PageActions, and LibraryMark off inline style props onto .docs-* classes
and data-* modifiers in docs.css.

- DocsSidebar's embedded <style> tag (the [data-docs-navlink] rules) is
  hoisted verbatim into docs.css, replacing each ${tokens.X.Y} interpolation
  with its CSS var.
- DocsSearch's keyboard-selected row and DocsTOC's active link become
  data-selected/data-active modifiers.
- DocsBreadcrumb's crumb/sep style variables (shape D) become
  .docs-crumb-link/.docs-crumb-sep classes, migrated verbatim including
  the existing inconsistent li/separator typography — not fixed here.
- LibraryMark's size prop is an unbounded number, so width/height stay
  dynamic via a --size/--inner-size custom-property escape hatch while
  the rest of its presentation (radius, kind-based background/border)
  moves to a data-kind-modified class.

Part of the inline-style substrate migration (Batch 3).
Migrates ApiDocRenderer, ApiRefTable, ArchFlowDiagram, AgUiArchDiagram,
CopyPromptButton, CopyButton, and DocsPrevNext off inline style props onto
.api-doc-*/.api-ref-*/.arch-flow-*/.ag-ui-arch-*/.docs-* classes and
data-* modifiers in docs.css.

- ArchFlowDiagram's embedded <style> tag (plain @Keyframes, no token
  interpolations) is hoisted verbatim; its per-log-source colors
  (SOURCE_COLORS bg/text) become data-source rules, keeping only the
  label text in JS.
- AgUiArchDiagram's Box tone and ArrowLabel's base layout are migrated;
  the arrow's base declarations are reunited with the pre-existing
  .ag-ui-arch-arrow mobile-rotate rule already in docs.css.
- CopyPromptButton's hero/docs variant and copied state become
  data-variant/data-copied modifiers; its hover handler (docs variant
  only) becomes a :hover rule — the last of the 5 documented hover pairs.
- CopyButton's copied state becomes a data-copied modifier.

Part of the inline-style substrate migration (Batch 3).
@vercel

vercel Bot commented Aug 29, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
threadplane Ready Ready Preview Aug 29, 2026 9:15pm

Request Review

@blove
blove enabled auto-merge (squash) August 29, 2026 21:13

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Automated approval: this PR received an intelligent (AI) code review. See the review comments on this PR.

@github-actions

github-actions Bot commented Aug 29, 2026

Copy link
Copy Markdown
Contributor

Claude finished @blove's task in 0s —— View job


I'll analyze this and get back to you.

@blove
blove merged commit 73857a6 into main Aug 29, 2026
24 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