Skip to content

Fix headline fonts in light mode - #14

Merged
mehfuzh merged 1 commit into
mainfrom
fix/font-vars-root
Nov 16, 2026
Merged

mehfuzh merged 1 commit into
mainfrom
fix/font-vars-root

Conversation

@mehfuzh

@mehfuzh mehfuzh commented Nov 16, 2026

Copy link
Copy Markdown
Member

Since #12, headlines look wrong in light mode, which is the default for first-time visitors.

Cause: the type variables (--sl-mono, --sl-display, --sl-headline, --sl-serif) were defined inside [data-theme='dark'] only. In light mode they were undefined, so:

  • headlines fell back to Space Grotesk, but still got Inter Tight's tight tracking and 600 weight
  • the pink accent phrase got a synthesized italic instead of Instrument Serif

Fix: move the four variables into :root. Type doesn't change between themes; colors stay in their theme blocks.

Testing: npm run build succeeds, and the built CSS defines --sl-headline in :root. I confirmed Google Fonts serves Inter Tight 500/600 and Instrument Serif (regular and italic). Not yet checked visually in a browser.

--sl-mono, --sl-display, --sl-headline and --sl-serif sat inside
[data-theme='dark']. In light mode (the default) they were undefined, so
headlines fell back to Space Grotesk with Inter Tight's tracking and weight,
and the accent became a synthesized italic. Type is theme-independent; it
now lives in :root.
@mehfuzh
mehfuzh merged commit 6b3288b into main Nov 16, 2026
1 check passed
@mehfuzh
mehfuzh deleted the fix/font-vars-root branch November 16, 2026 07:46
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