Skip to content

docs(core): the typography note says how a heading's font list is built - #11786

Merged
josephfarina merged 4 commits into
mainfrom
core-typography-heading-doc
Nov 15, 2026
Merged

josephfarina merged 4 commits into
mainfrom
core-typography-heading-doc

Conversation

@josephfarina

@josephfarina josephfarina commented Nov 14, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Brings every typography doc in line with what Core builds (buildFontFamilyTokens in resolveThemeValues.ts: a heading's list is buildFontFamily(heading.family, heading.fallbacks) ?? body, and buildFontFamily returns nothing without a family): a heading with no family takes the body's whole font list, with its own family only its own fallbacks, and fallbacks with no family build nothing.

Updated: the TypographyConfig note and the heading property JSDoc in types.ts (which also named a url field the role doesn't have), the typography JSDoc in defineTheme.ts, the CLI's fonts-and-assets doc (which owns the rule), the annotated theme template that astryx theme template and astryx init --features theme write into projects, and font-setup (one clause, plus a link to fonts-and-assets for the rest). Docs only; no output change.

Tests

defineTheme.test.ts's typography font-family tests pin all three cases (one new test covers a heading with its own family and a role with fallbacks but no family). doc-compiler and authoring-self-docs pass; prettier, eslint and changesets clean.

@josephfarina

@vercel

vercel Bot commented Nov 14, 2026 •

Copy link
Copy Markdown

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

Project Deployment Actions Updated
astryx Ready Ready Preview Nov 14, 2026 10:22pm UTC

Request Review

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Meta Open Source bot. label Nov 14, 2026
@astracat-bot

astracat-bot Bot commented Nov 14, 2026 •

Copy link
Copy Markdown
Contributor

AI review status for this pull request.

Review status Updated
🟢 Reviewed (for maintainers only) Nov 14, 2026, 10:32 PM UTC

@astracat-bot astracat-bot 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.

Changes requested: the new note matches what Core builds, but one claim in the description is not accurate.

  • The description says defineTheme's doc and the font-setup docs agree that a heading with a family takes only its own fallbacks, but defineTheme.ts:303-304 and font-setup.doc.mjs:48 only say that heading inherits from body when omitted, and fonts-and-assets.doc.mjs:24 says heading inherits family and fallbacks from body when you omit them.

To resolve it, either reword that sentence to rest on resolveThemeValues.ts:248-251 and its tests, or bring those two docs in line in this pull request. Separately, the heading property doc at types.ts:74 keeps the old wording and names a url field that TypographyRole does not have; editors show it on typography.heading, so it is worth aligning too (non-blocking). Built output and the public API are unchanged.

Claims and files checked

Review mode: full; reason: no-earlier-review

  • Claim: the old note overstated heading inheritance: verified (a heading that sets only family gets no body fallbacks; resolveThemeValues.ts:249-251).
  • Claim: a heading with no family takes body's whole font list: verified (resolveThemeValues.ts:248-251; defineTheme.test.ts:1018).
  • Claim: a heading with a family takes only its own fallbacks: verified (resolveThemeValues.ts:163-175; defineTheme.test.ts:1037).
  • Claim: fallbacks with no family build nothing: verified (resolveThemeValues.ts:167-169; themeAdaptations.test.ts:1563).
  • Claim: the note now says exactly that: verified (types.ts:52-54).
  • Claim: defineTheme's doc and the font-setup docs agree on both cases: false for the case with a family (defineTheme.ts:303-304, font-setup.doc.mjs:48, fonts-and-assets.doc.mjs:24).
  • Claim: docs only, no output change: verified (built JavaScript and all seven theme stylesheets are identical; only the declaration comment differs).
  • Changeset: the TypographyConfig note says what Core builds in the three cases: verified (types.ts:52-54 against resolveThemeValues.ts:248-251).
  • File .changeset/core-typography-heading-doc.md: clear.
  • File packages/core/src/theme/types.ts: the changed note is clear; the unchanged heading property doc at line 74 disagrees with it (non-blocking).

Automated review (maintainer link)

Comment thread packages/core/src/theme/types.ts Resolved
@github-actions

github-actions Bot commented Nov 14, 2026 •

Copy link
Copy Markdown
Contributor

PR Analysis Report

🔎 Preview · 4ae7f47

Storybook · Sandbox · built from this PR's head

Modified components

Component Size LoC Visual · A11y · RTL
charts/Chart 237.4 kB (0) · 516 B CSS (0) — — · — · —
Lightbox 145.8 kB (0) · 11.9 kB CSS (0) — — · — · —
Markdown 201.9 kB (0) · 21.7 kB CSS (0) — — · — · —
6 more components
Component Size LoC Visual · A11y · RTL
Overlay 23.0 kB (0) · 3.9 kB CSS (0) — — · — · —
Toast 103.5 kB (0) · 11.1 kB CSS (0) — — · — · —
lab/Comments 369.5 kB (0) · 2.5 kB CSS (0) — — · — · —
lab/CommentThread 362.1 kB (0) · 2.4 kB CSS (0) — — · — · —
lab/DialogHeroHeader 88.4 kB (0) · 372 B CSS (0) — — · — · —
lab/ListInput 93.4 kB (0) · 922 B CSS (0) — — · — · —

Package size:

  • @astryxdesign/cli 4.63 MB packed (+70 B); no new dependencies
  • @astryxdesign/core 7.59 MB packed (+144 B); no new dependencies

Wide change (shared styles: packages/core/src/theme/defineTheme.ts, packages/core/src/theme/types.ts): add ci:run-visual, ci:run-a11y or ci:run-rtl to run them.


Generated by PR Enrichment workflow | View full report

@astracat-bot astracat-bot 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.

Changes requested: the new wording matches what Core builds, but two claims about which docs carry it are not accurate at this head.

  • The description says the change brings every typography doc in line with what Core builds, while the annotated theme template that astryx theme template and astryx init --features theme write into a project (packages/cli/assets/theme.template.ts:155-157) still says "heading inherits family and fallbacks from body when omitted", so an author who copies it still expects body's fallbacks for heading: {family: 'Fraunces'} and ships a heading with none.
  • The changeset says the font-setup page says the rule, but packages/cli/assets/docs/tree/font-setup.doc.mjs:48 now only points to fonts-and-assets, so a reader following the release note will look for a rule that page no longer carries.

Either claim can be met from both ends: give the template's typography block the same one-rule sentence, and say in the changeset that font-setup points to fonts-and-assets. Non-blocking: astryx docs typography/font-setup is where a product builder asks about font families, and one clause inline would answer it there rather than sending them to the theme-packaging guide. Built JavaScript, every published theme's stylesheet and the public API surface are unchanged, and the updated search goldens match the CLI's real output (396 matches on main, 395 here).

Claims and files checked

Review mode: incremental; reason: none

  • Claim: a heading's list is the heading's own family and fallbacks, else body's whole list: verified (resolveThemeValues.ts:248-251).
  • Claim: a family-less role builds nothing: verified (resolveThemeValues.ts:167-169).
  • Claim: a heading with no family takes body's whole font list: verified (probe on the head build; defineTheme.test.ts:1016-1033).
  • Claim: a heading with its own family takes only its own fallbacks: verified (probe: {family: 'Fraunces'} gives Fraunces; defineTheme.test.ts:1051-1063).
  • Claim: fallbacks with no family build nothing: verified (probe; defineTheme.test.ts:1061).
  • Claim: the TypographyConfig note, the heading property doc and its stray url mention, and defineTheme's typography are updated: verified (types.ts:52-54, :74-78, defineTheme.ts:303-306; TypographyRole has only family, fallbacks, weight, weights).
  • Claim: the CLI's font-setup and fonts-and-assets docs are updated: verified that both changed.
  • Claim: every typography doc is in line with what Core builds: false (packages/cli/assets/theme.template.ts:155-157).
  • Changeset claim: font-setup states the rule: false (font-setup.doc.mjs:48 points to fonts-and-assets).
  • Claim: docs only, no output change: verified (built JavaScript and all seven theme stylesheets identical; only declaration comments differ; 0 public API rows).
  • Claim: the typography font-family tests pin all three cases: verified (defineTheme.test.ts:1016-1063, passing at this head).
  • Claim: doc tests, prettier, eslint and changesets are clean: verified (6 test files, 238 tests passing; prettier --check clean; eslint 0 errors; changeset check exit 0).
  • File .changeset/core-typography-heading-doc.md: finding (the font-setup credit); category and both package bumps are valid.
  • File packages/cli/assets/docs/tree/font-setup.doc.mjs: non-blocking note (the rule is replaced by a pointer; the link target resolves).
  • File packages/cli/assets/docs/tree/fonts-and-assets.doc.mjs: clear.
  • Files packages/cli/test/__golden__/no-icon-set/search-icon-set.json and .txt: clear (the 396 to 395 drop reproduces on the two trees).
  • File packages/core/src/theme/defineTheme.test.ts: clear (the new case asserts the absence of body fallbacks, which no earlier test did).
  • File packages/core/src/theme/defineTheme.ts: clear.
  • File packages/core/src/theme/types.ts: clear.

Automated review (maintainer link)

@astracat-bot astracat-bot 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.

Approved pending CI: CI has not finished on this head yet.

The typography type docs, the fonts-and-assets and font-setup pages and the annotated theme template now describe the heading font list exactly as defineTheme builds it, and every claim in the description and changeset checks out. Nothing else is needed from you.

Claims and files checked

Review mode: incremental; reason: none

  • Claim: a heading with its own family builds from its own family and fallbacks, a heading without one takes the body's whole list, and fallbacks with no family build nothing. Verified: resolveThemeValues.ts:163-175, :248-251.
  • Claim: the TypographyConfig note states the rule. Verified: types.ts:52-54.
  • Claim: the heading property doc states it and no longer names a url field. Verified: types.ts:74-78; TypographyRole (types.ts:36-45) has no url.
  • Claim: defineTheme's typography doc states it. Verified: defineTheme.ts:303-306.
  • Claim: the fonts-and-assets page states it. Verified: fonts-and-assets.doc.mjs:24.
  • Claim: the theme template that theme template and init --features theme write states it. Verified: theme.template.ts:157-159.
  • Claim: font-setup gets one clause and a link for the rest. Verified: font-setup.doc.mjs:48.
  • Claim: docs only, with no output change. Verified: Core's built JavaScript and the seven published themes are identical to the base, and the API surface has no changes.
  • Claim: the font-family tests pin all three cases, with one new test. Verified: defineTheme.test.ts:1017-1062; the file's 147 tests pass.
  • Claim: the doc compiler and authoring self-docs tests pass, and prettier, eslint and the changeset check are clean. Verified: each passes at this head.
  • Changeset claim: the one rule matches what Core builds. Verified, as above.
  • Changeset claim: the type docs, defineTheme, fonts-and-assets and the theme template state it. Verified, as above.
  • Changeset claim: font-setup says a heading with no family uses the body's and links to fonts-and-assets. Verified: font-setup.doc.mjs:48.
  • Changeset claim: patch releases for core and cli. Verified: both packages change, and the changeset check passes.
  • Files, all clear: .changeset/core-typography-heading-doc.md, packages/cli/assets/docs/tree/font-setup.doc.mjs, packages/cli/assets/docs/tree/fonts-and-assets.doc.mjs, packages/cli/assets/theme.template.ts, packages/cli/test/__golden__/no-icon-set/search-icon-set.json, packages/cli/test/__golden__/no-icon-set/search-icon-set.txt, packages/core/src/theme/defineTheme.test.ts, packages/core/src/theme/defineTheme.ts, packages/core/src/theme/types.ts.

Automated review (maintainer link)

@josephfarina
josephfarina merged commit 3ef7c41 into main Nov 15, 2026
161 of 163 checks passed
@github-actions
github-actions Bot deleted the core-typography-heading-doc branch November 15, 2026 06:04

This branch was successfully deployed

1 active deployment
Preview — 4ae7f475 Deployed Nov 14, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Meta Open Source bot.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant