Skip to content

docs(core): the README setup loads the theme's fonts - #12886

Closed
josephfarina wants to merge 2 commits into
mainfrom
josephfarina/tweet-readme-theme-fonts
Closed

josephfarina wants to merge 2 commits into
mainfrom
josephfarina/tweet-readme-theme-fonts

Conversation

@josephfarina

@josephfarina josephfarina commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

Stack: #12886 → #12887

The Core README's stylesheet setup boxes (Next.js, Next.js + Tailwind, Next.js + StyleX) import reset.css, astryx.css and the theme's theme.css, but not the theme's fonts.css. A page set up from those boxes makes no font request and falls back to the system font stack. astryx theme add already imports fonts.css; these boxes now do too. (The CDN setup already loads the font with its own link and is unchanged.)

fonts.css holds a remote @import, which a browser ignores once other rules come before it, so each box lists it first (in the Tailwind box, right under the @layer line). The cascade note says why it goes first and that leaving it out is a supported choice.

Test plan

  • A new Vite React app with these imports: vite build keeps the theme's font @import at the top of the built CSS.
  • Placing it first avoids the Next.js case where a later remote @import lands after other rules and is dropped.
  • Docs-only change; no code paths change.

preflight: pass 0a3647c

@vercel

vercel Bot commented Nov 19, 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 19, 2026 8:03pm UTC

Request Review

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

astracat-bot Bot commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

AI review status for this pull request.

Review status Updated
🟡 Reviewed (for maintainers only) Nov 19, 2026, 8:13 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 font import sits where two of the README's Next.js setups lose it, so pages built from them still render in the system font.

  • The Tailwind box (packages/core/README.md:169) lists fonts.css after theme.css, so Tailwind inlines its font @import after other rules and the Next.js build warns that "@import rules must precede all rules" and drops it under both Turbopack and webpack; move the line directly under the @layer line.
  • The plain and StyleX boxes (packages/core/README.md:112 and :261) list fonts.css last, so next build --webpack emits the font @import at the end of the CSS chunk, where the browser ignores it; list fonts.css first, above reset.css.
  • The changeset says a page set up from the README loaded no theme font with nothing saying why, but the README's CDN setup already loaded Figtree and explained it; scope that sentence to the Next.js and Vite stylesheet boxes.

With fonts.css first, each box's built CSS started with the font import and the browser requested the font under Turbopack, webpack and Vite. One clause at the cascade note saying that fonts.css goes first would keep a later edit from moving it back.

Claims and files checked

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

  • Claim: the setup boxes imported the reset, base and theme stylesheets but not the font stylesheet. Verified against the base README.
  • Claim: a page set up from the README made no font request and fell back to the system font stack, with nothing saying why. Verified for the stylesheet boxes; false for the CDN setup, which already loaded the font and explained it (finding above).
  • Claim: astryx theme add already imports fonts.css. Verified in the generated theme module writer and the getting-started guide.
  • Claim: the plain, Tailwind and StyleX boxes now import fonts.css. Verified in the diff; the Tailwind box's import does not survive a Next.js build (finding above).
  • Claim: the cascade note says what the file does and that leaving it out is supported. Verified.
  • Claim: a Vite build keeps the font import and places it first, with fonts.css first or last. Verified with Vite 8.
  • Claim: docs-only, no code paths change. Verified; the built public surface of Core and every theme is unchanged.
  • File .changeset/core-readme-theme-fonts.md: changeset finding above.
  • File packages/core/README.md: import-position finding above; the count and cascade-note edits are clear.

Automated review (maintainer link)

Comment thread packages/core/README.md Resolved
Comment thread packages/core/README.md Resolved
Comment thread .changeset/core-readme-theme-fonts.md Resolved
The quick-start stylesheets imported reset.css, astryx.css and the theme's
theme.css, but not its fonts.css, so a page set up from the README fell
back to the system font. astryx theme add imports fonts.css; the README
now does too, and says what leaving it out does.

[skip ci]

@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 run on this head yet, since the pull request is a draft and its head commit message carries [skip ci].

All three setup boxes now list fonts.css first (directly under the @layer line in the Tailwind box), and production builds of each box with Next.js (Turbopack and webpack) and Vite keep the font @import as a valid first rule, so the browser requests the theme font. The changeset now scopes its claim to the three stylesheet boxes, which resolves the three points of the earlier review.

Claims and files checked

Review mode: full; reason: history

  • Claim: the three stylesheet boxes imported the reset, component and theme stylesheets but not the font stylesheet. Verified in the base README.
  • Claim: a page set up from them made no font request and used the system font stack. Verified: the theme stylesheet names Figtree but loads no font, and no other imported sheet does.
  • Claim: astryx theme add already imports fonts.css. Verified in the generated theme module writer.
  • Claim: the boxes now import fonts.css first, right under the @layer line in the Tailwind box. Verified in the diff.
  • Claim: the CDN setup already loads the font with its own link and is unchanged. Verified; that section is not in the diff.
  • Claim: fonts.css holds a remote @import, which a browser ignores once other rules come before it. Verified: with fonts.css last, the webpack build put it after other rules and the browser registered no import.
  • Claim: the cascade note says why it goes first and that leaving it out is a supported choice. Verified.
  • Claim: a Vite build keeps the font @import at the top of the built CSS. Verified with Vite 8.
  • Claim: listing it first avoids the Next.js case where a later remote @import is dropped. Verified for the plain and Tailwind boxes under Turbopack and webpack.
  • Claim: docs-only, no code paths change. Verified; the built public surface of Core and every theme is unchanged.
  • Changeset claim: the three boxes now import the theme's fonts.css as theme add does, placed first so bundlers keep its @import. Verified.
  • Changeset claim: before, a page set up from those boxes loaded no theme font. Verified.
  • File .changeset/core-readme-theme-fonts.md: clear.
  • File packages/core/README.md: clear.

Automated review (maintainer link)

@josephfarina
josephfarina marked this pull request as ready for review November 19, 2026 13:32
@josephfarina

Copy link
Copy Markdown
Contributor Author

/approve-spec 510e56c

…rules and requests nothing outside the app [skip ci]
@josephfarina

Copy link
Copy Markdown
Contributor Author

/approve-spec 562b22a

@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 README and changeset now describe the theme's fonts.css as local @font-face rules, but the pull request description still explains the box order with a remote @import.

  • The description says the cascade note explains why fonts.css goes first and that leaving it out is a supported choice, but the note at packages/core/README.md:115 now says neither, so please update that paragraph and the two test-plan bullets about the font @import to match the README and changeset.

Suggested, not blocking: merge main into the branch. The new note is true of main, where the built-in themes now ship their font files, and of this branch merged with main (every box builds with the eight Figtree files served by the app), but this branch's own packages/themes/neutral/fonts.css is still the Google Fonts @import, and the head commit skips CI.

Claims and files checked

Review mode: incremental; reason: none

  • Description: the three boxes lacked fonts.css (verified, base README); such a page makes no font request and falls back to the system stack (verified: the neutral theme.css names Figtree and loads no font); astryx theme add already imports fonts.css (verified, theme-state.mjs:452-453); the boxes now import it (verified, README.md:109, :164, :258); the CDN setup already loads the font and is unchanged (verified, README.md:294-296); fonts.css holds a remote @import (true of this branch, not of main, and contradicts README.md:115); each box lists it first, under the @layer line in the Tailwind box (verified); the cascade note says why it goes first and that leaving it out is a supported choice (false, README.md:115); a Vite build keeps the font @import on top, and the first position avoids Next.js dropping a later one (true of this branch's fonts.css, moot with main's); docs-only (verified).
  • Changeset: the boxes import fonts.css as astryx theme add does (verified); it holds @font-face rules for font files the theme package ships, so the page requests nothing outside the app (verified on main and in this branch merged with main; not true of this branch's own fonts.css); before, those pages loaded no theme font (verified).
  • Title: the README setup loads the theme's fonts (verified).
  • Files: .changeset/core-readme-theme-fonts.md clear; packages/core/README.md clear (its note describes main's fonts.css; see the suggestion above).

Automated review (maintainer link)

Comment thread packages/core/README.md
```

The import order maps to the layer cascade: `reset.css` (`@layer reset`) → `astryx.css` component styles (`@layer astryx-base`) → `theme.css` token overrides (`@layer astryx-theme`).
The import order maps to the layer cascade: `reset.css` (`@layer reset`) → `astryx.css` component styles (`@layer astryx-base`) → `theme.css` token overrides (`@layer astryx-theme`). `fonts.css` loads the theme's fonts: `@font-face` rules for font files the theme package ships, so the page requests nothing outside your app. Without it the page falls back to the system font stack.

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.

This sentence is true of main's packages/themes/neutral/fonts.css, which now holds eight local @font-face rules, but on this branch that file is still @import url('https://fonts.googleapis.com/css2?family=Figtree:wght@400;500;600;700&display=swap'). Merging main makes the branch carry the fonts this line describes.

The pull request description still says this note explains why fonts.css goes first and that leaving it out is a supported choice; please update the description to match this line.

josephfarina added a commit that referenced this pull request Nov 19, 2026
josephfarina added a commit that referenced this pull request Nov 19, 2026
- #12941 fix(Table): the default cell renderer shows an Invalid Date as an empty cell
  Author: @josephfarina
- #12886 docs(core): the README setup loads the theme's fonts
  Author: @josephfarina
- #12887 fix(cli): doctor --built reads the setup stylesheet as wiring, not page styling
  Author: @josephfarina
- #12456 fix(cli): a doc may leave out a value the code deprecates everywhere
  Author: @josephfarina
- #12857 docs(cli): the styling and typography pages state their core rules
  Author: @josephfarina
- #12994 test(cli): the doctor golden leaves out a check only some computers report
  Author: @josephfarina
- #13001 test(cli): the swizzle proof renders Lab's MediaPlayer with its required label
  Author: @josephfarina
@josephfarina

Copy link
Copy Markdown
Contributor Author

Landed in #12992.

@github-actions
github-actions Bot deleted the josephfarina/tweet-readme-theme-fonts branch November 20, 2026 06:05

This branch was successfully deployed

1 active deployment
Preview — 562b22ab Deployed Nov 19, 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