Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: restore InterVariable #133

Merged
merged 1 commit into from Dec 7, 2023
Merged

fix: restore InterVariable #133

merged 1 commit into from Dec 7, 2023

Conversation

monospaced
Copy link
Member

@monospaced monospaced commented Dec 7, 2023

So this is a bit crazy. Next.js (not Vercel, it works locally too) now automatcially downloads whatever Inter (and other?) fonts as required from scanning the CSS. So we don't need to declare a @font-face, or host any font files. I also had a mental note to upgrade to Inter 4, but we're already on it!

This behaviour is triggered by the name Inter in a font-family declaration, but that gives you indvidual files per weight/style. Name for variable Inter is InterVariable, so I've updated to use that (in an @supports cause that also works, so why not). I've also added the recommend fix for Chrome.

Quick test with/without InterVariable on the preview branch showed better Lighthouse perf with variable, but we should check again on merge.


Screenshot 2023-12-07 at 12 27 15

Copy link

vercel bot commented Dec 7, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
measuredco-site ✅ Ready (Inspect) Visit Preview 💬 Add feedback Dec 7, 2023 0:13am

Copy link

This pull request has been linked to Shortcut Story #2577: Investigate duplicate Inter issue.

Copy link
Member

@anglepoised anglepoised left a comment

Choose a reason for hiding this comment

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

Super interesting, thanks @monospaced. Hadn't realised Next did that.

I checked in Chrome and Firefox. Had to do some cache clearing, but all looks great!

@monospaced monospaced merged commit a57b506 into main Dec 7, 2023
2 checks passed
@monospaced monospaced deleted the bug/sc-2577 branch December 7, 2023 16:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants