Skip to content

Conversation

@retlehs
Copy link
Contributor

@retlehs retlehs commented Aug 27, 2025

This PR adds font preloading to improve initial page render performance

  • Adds preconnect to the fonts CDN
  • Uses preload_tag for the primary font variant

(Shopify still needs to fix the crossorigin bug in preload_tag — see #46)

This is the new markup added with this PR on a deployed skeleton theme:

      <link rel="preconnect" href="https://fonts.shopifycdn.com" crossorigin>
      
      
      <link href="//slug.myshopify.com/cdn/fonts/work_sans/worksans_n4.b7973b3d07d0ace13de1b1bea9c45759cdbe12cf.woff2?h1=eG5taWRuLW41LmFjY291bnQubXlzaG9waWZ5LmNvbQ&amp;hmac=f9a9f15cab2f3b8d2aca3dffa1584677c8e3d881c0cea9532487b9246e27f611" as="font" rel="preload">

@retlehs

This comment was marked as resolved.

@karreiro karreiro self-requested a review September 29, 2025 11:10
Copy link
Contributor

@karreiro karreiro left a comment

Choose a reason for hiding this comment

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

Thank you for this PR, @retlehs!

I have discussed this with a few peers to understand the usage that balances performance and context well in most of the themes, and I have left only one minor suggestion with that context in mind.

Please let me know your thoughts, and thanks again for this PR!

Co-authored-by: Guilherme Carreiro <karreiro@gmail.com>
@retlehs
Copy link
Contributor Author

retlehs commented Nov 7, 2025

@karreiro Done!

Copy link
Contributor

@karreiro karreiro left a comment

Choose a reason for hiding this comment

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

Thank you for this PR, @retlehs! 🚀

@karreiro karreiro merged commit 04069e0 into Shopify:main Nov 14, 2025
1 check passed
@retlehs retlehs deleted the font-preloading branch November 14, 2025 15:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants