Skip to content

fix: use @theme inline so Geist variables resolve (fixes #553) - #561

Merged
cevheri merged 2 commits into
libredb:mainfrom
v01dst:fix/issue-553-geist-font
Sep 5, 2026
Merged

fix: use @theme inline so Geist variables resolve (fixes #553)#561
cevheri merged 2 commits into
libredb:mainfrom
v01dst:fix/issue-553-geist-font

Conversation

@v01dst

@v01dst v01dst commented Sep 5, 2026

Copy link
Copy Markdown
Contributor

Problem

Fixes #553 — production build renders in the OS system font, not Geist. document.fonts lists GeistSans/GeistMono as unloaded though the woff2 files download, and computed font-family on body is a system stack.

Root cause

src/app/globals.css mapped --font-sans/--font-mono inside a plain @theme block. Tailwind v4 emits plain @theme values on :root, but next/font defines --font-geist-sans/mono on body via the .variable class (see src/app/layout.tsx), so at :root the var() reference resolves to nothing. The color mappings lower in the same file already correctly use @theme inline.

Fix

@theme to @theme inline for the font block. 1-line CSS-only diff; the var() reference now stays live and resolves at use time on body.

Verification

  • grep confirms no remaining plain @theme font block
  • Layout chain verified: GeistSans/GeistMono .variable classes on body, globals.css maps them to --font-sans/--font-mono
  • Suggested e2e follow-up from the issue (document.fonts.check assertion) left to maintainers

@cevheri

cevheri commented Sep 5, 2026

Copy link
Copy Markdown
Member

Thank you for the fix, and welcome as a first-time contributor here. Confirmed on a production build with Playwright Chromium, side by side with main: on main both GeistSans and GeistMono report unloaded and body computes to Tailwind's preflight system stack; with your change both load and body computes to GeistSans, so the cause was exactly the one #553 suspected.

I pushed one commit on top of yours with the e2e assertion the issue's second done-when asked for (e2e/login.spec.ts). It fails on main and passes on this branch, so the fix and its guard land together. Merging once CI is green.

Pins the second "done when" of libredb#553: document.fonts must report GeistSans
and GeistMono as loaded and body must compute to GeistSans. Fails on main,
where both faces sit at unloaded and body renders Tailwind's preflight
system stack, and passes with the @theme inline change.
@cevheri
cevheri force-pushed the fix/issue-553-geist-font branch from 45b7508 to da5270a Compare September 5, 2026 07:37
@codecov

codecov Bot commented Sep 5, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@cevheri cevheri added bug Something isn't working help wanted Extra attention is needed hacktoberfest-accepted Merged Hacktoberfest PR; counts for the participant labels Sep 5, 2026
@cevheri
cevheri merged commit 9780cd3 into libredb:main Sep 5, 2026
22 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working hacktoberfest-accepted Merged Hacktoberfest PR; counts for the participant help wanted Extra attention is needed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Geist never applies: the app renders in the system font

2 participants