Skip to content

feat(fonts): seed heading, body and mono font role tokens on new sites - #638

Merged
DavidBabinec merged 4 commits into
mainfrom
feat/framework-font-roles
Oct 13, 2026
Merged

DavidBabinec merged 4 commits into
mainfrom
feat/framework-font-roles

Conversation

@DavidBabinec

Copy link
Copy Markdown
Contributor

What

Every brand-new site now starts with three fallback-only font tokens: font-heading, font-body and font-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 of font-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-body into a new site (overwrite) versus an edited role token (rename).

BUILD_EXIT=0
LINT_EXIT=0
TEST_EXIT=0
 7142 pass
 0 fail

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.
@DavidBabinec
DavidBabinec merged commit 60a4973 into main Oct 13, 2026
11 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