Repository navigation
feat(fonts): seed heading, body and mono font role tokens on new sites - #638
Merged
Merged
Conversation
New sites had no font tokens and the codebase disagreed on names (docs said font-primary, the AI prompt said font-heading), so content made for one site did not resolve in another. Every brand-new site now starts with fallback-only font-heading, font-body and font-mono tokens, the Core preset adds any a site lacks without touching existing ones, and docs, schema comments and the AI prompt use the role names. Existing sites are not migrated.
Seeding font-heading, font-body and font-mono on new sites made an imported static site that defines one of those variables collide with the seed and get renamed to font-body-2, leaving the role token on the system stack. A role token that is still exactly as seeded is a placeholder, so the conflict now defaults to overwrite; a role token the user edited keeps the rename default.
The rationale now names imported pages, copied sections and AI output as the content the role variables serve.
…nt size tests
applyFrameworkPreset now returns { framework, fonts }, so the root font size tests read .framework; one of them passed only because it read an absent property.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Every brand-new site now starts with three fallback-only font tokens:
font-heading,font-bodyandfont-mono, using system stacks so nothing downloads. Applying the Core preset adds whichever role tokens a site lacks, matched by variable, and site import fills a still-untouched role token in place instead of renaming the imported one. Docs, schema comments, the font tool description and the AI system prompt now use the role names instead offont-primary.Why
New sites had no font tokens and the codebase disagreed on names, so imported pages and copied sections could not rely on one font variable. Existing sites are not migrated: first-run setup and the editor bootstrap seed the tokens, while the read-time settings fallback stays empty.
Verification
New tests cover setup seeding, an untouched existing shell, the preset merge, and importing
--font-bodyinto a new site (overwrite) versus an edited role token (rename).