Repository navigation
docs(core): the README setup loads the theme's fonts - #12886
josephfarina wants to merge 2 commits into
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
AI review status for this pull request.
|
There was a problem hiding this comment.
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) listsfonts.cssaftertheme.css, so Tailwind inlines its font@importafter other rules and the Next.js build warns that "@importrules must precede all rules" and drops it under both Turbopack and webpack; move the line directly under the@layerline. - The plain and StyleX boxes (
packages/core/README.md:112and:261) listfonts.csslast, sonext build --webpackemits the font@importat the end of the CSS chunk, where the browser ignores it; listfonts.cssfirst, abovereset.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 addalready importsfonts.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.cssfirst 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.
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]
aae35eb to
510e56c
Compare
There was a problem hiding this comment.
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 addalready importsfonts.css. Verified in the generated theme module writer. - Claim: the boxes now import
fonts.cssfirst, right under the@layerline 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.cssholds a remote@import, which a browser ignores once other rules come before it. Verified: withfonts.csslast, 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
@importat the top of the built CSS. Verified with Vite 8. - Claim: listing it first avoids the Next.js case where a later remote
@importis 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.cssastheme adddoes, 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.
|
/approve-spec 510e56c |
…rules and requests nothing outside the app [skip ci]
|
/approve-spec 562b22a |
There was a problem hiding this comment.
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.cssgoes first and that leaving it out is a supported choice, but the note atpackages/core/README.md:115now says neither, so please update that paragraph and the two test-plan bullets about the font@importto 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 neutraltheme.cssnames Figtree and loads no font);astryx theme addalready importsfonts.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.cssholds a remote@import(true of this branch, not ofmain, and contradictsREADME.md:115); each box lists it first, under the@layerline 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@importon top, and the first position avoids Next.js dropping a later one (true of this branch'sfonts.css, moot withmain's); docs-only (verified). - Changeset: the boxes import
fonts.cssasastryx theme adddoes (verified); it holds@font-facerules for font files the theme package ships, so the page requests nothing outside the app (verified onmainand in this branch merged withmain; not true of this branch's ownfonts.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.mdclear;packages/core/README.mdclear (its note describesmain'sfonts.css; see the suggestion above).
| ``` | ||
|
|
||
| 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. |
There was a problem hiding this comment.
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.
- #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
|
Landed in #12992. |
Stack: #12886 → #12887
The Core README's stylesheet setup boxes (Next.js, Next.js + Tailwind, Next.js + StyleX) import
reset.css,astryx.cssand the theme'stheme.css, but not the theme'sfonts.css. A page set up from those boxes makes no font request and falls back to the system font stack.astryx theme addalready importsfonts.css; these boxes now do too. (The CDN setup already loads the font with its own link and is unchanged.)fonts.cssholds 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@layerline). The cascade note says why it goes first and that leaving it out is a supported choice.Test plan
vite buildkeeps the theme's font@importat the top of the built CSS.@importlands after other rules and is dropped.preflight: pass 0a3647c