Third-party fonts

It is incredibly important to deliver fonts quickly: faster font delivery not only means that text will be visible to the user sooner - but it also has a large impact on whether a font causes layout shifts. If a font cannot be delivered before it is needed, there will typically be a layout shift when the font is swapped. The size of this layout shift can vary depending on how closely the fallback font matches the web font. To see this phenomena in action, view the demo and compare the layout shifts that occur on a fast connection versus a slow connection.

The example below combines two performance techniques to load a third-party font as quickly as possible: use of inline font declarations and use of preconnect resource hints. Although this code snippet demonstrates how to load fonts from Google Fonts, these techniques also apply to other third-party font providers.


版本号 #2
由 壳壳虫 创建于 2026-10-31 23:06:59 UTC
由 壳壳虫 更新于 2026-10-31 23:07:00 UTC