#Performant way to add external fonts?

4 messages · Page 1 of 1 (latest)

solar prawn
#

Hey. I would like to add Roboto from Google fonts to my website, but when I add the necessary tags to the <head> of my SiteLayout, https://pagespeed.web.dev/ gives a warning about those tags saying that they are blocking the page rendering.

Is there a more performant way to do this?

#

Performant way to add external fonts?

hasty moat
#

You could use https://fontsource.org
All you have to do is npm install the font you want and add import "@fontsource/<name>" in the frontmatter (between ---) in your layout/header file!

#

It will be combined with the rest of your CSS and should be faster, especially if you have an ok CDN