diff --git a/layout/theme.liquid b/layout/theme.liquid index 8123ab78..0e3fd39c 100644 --- a/layout/theme.liquid +++ b/layout/theme.liquid @@ -4,6 +4,19 @@ {% # Inlined CSS Variables %} {% render 'css-variables' %} + {% comment %} + Font preloading: + 1. Preconnect to font CDN for faster connection + 2. Preload only the critical font variant (base weight) + 3. Additional variants load on-demand via @font-face + {% endcomment %} + {% unless settings.type_primary_font.system? %} + + + {% comment %} Preload the base font variant for initial page render {% endcomment %} + {{ settings.type_primary_font | font_url | preload_tag: as: 'font', crossorigin: 'anonymous' }} + {% endunless %} + {% # Load and preload the critical CSS %} {{ 'critical.css' | asset_url | stylesheet_tag: preload: true }}