Skip to content

fix: re-add manual font fetching in <Head> - #782

Merged
mathiazom merged 1 commit into
mainfrom
mom/fix-font
Sep 3, 2026
Merged

fix: re-add manual font fetching in <Head>#782
mathiazom merged 1 commit into
mainfrom
mom/fix-font

Conversation

@mathiazom

@mathiazom mathiazom commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

Turns out this is required because of some differences between dev and production build. Seems like the relevant font @import is not respected when combined with other stylesheets (which is only the case for production build). Might be possible to avoid this manual declaration, but leaving that for another time.

see MDN:

An @import rule must be defined at the top of the stylesheet, before any other at-rule (except @charset and @layer) and style declarations, or it will be ignored.

more or less a revert of daf4e96

Pre-fix (dev left, docker build right)

image

Turns out this is required because of some differences between dev and production build. Seems like the relevant font @import is not respected when combined with other stylesheets. Might be possible to avoid this manual declaration, but leaving that for another time.

more or less a revert of daf4e96
@vercel

vercel Bot commented Sep 2, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
planner-web Ready Ready Preview Sep 2, 2026 2:17pm UTC

Request Review

@rosvik rosvik left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚀

Comment thread src/pages/_document.tsx
return (
<Html lang={language} data-theme={theme}>
<Head>
<link rel="preconnect" href="https://fonts.googleapis.com/" />

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My understanding is that this doesn't do anything when there's a <link> with fonts.googleapis.com right below.

Suggested change
<link rel="preconnect" href="https://fonts.googleapis.com/" />

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Usikker, det er slik Google Fonts bruker det 🤔 Så tenker det er ryddigst.

Image

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, ok then 🤷

@mathiazom
mathiazom merged commit 9ee978f into main Sep 3, 2026
5 checks passed
@mathiazom
mathiazom deleted the mom/fix-font branch September 3, 2026 07:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants