logoalt Hacker News

cryzingerlast Monday at 9:02 PM1 replyview on HN

This drove me crazy on one of my (very lightweight) static sites... even on incredibly fast connections you'd always see that FOUT. I managed to solve it with font-display: fallback.

https://developer.mozilla.org/en-US/docs/Web/CSS/Reference/A...

I also had to make sure I was preloading my fonts properly... not sure if this is the same guide I followed, but it's close. The only difference is that I swapped that "&display=swap" to "&display=fallback":

https://dev.to/pilcrowonpaper/preloading-google-fonts-37h1


Replies