woocommerce / storefront

Official theme for WooCommerce
https://wordpress.org/themes/storefront/
960 stars 472 forks source link

Add &display=swap to googlefont URLs #2097

Open ciderpunx opened 1 year ago

ciderpunx commented 1 year ago

Google fonts will add font-display: swap if you pass a parameter to it. This fixes FOIT in many modern browsers which probably makes the user experience a little better.

This PR just adds the display=swap parameter to the two places where the google font URL is used.

As I understand it this shouldn't be a problem for older browsers, and will be better on newer ones.

How to test the changes in this Pull Request:

You could review the score given on google's pagespeed tool. Before patch you will get a fail on " All text remains visible during webfont loads ", after the patch you won't.

Changelog

Improvement – Add &display=swap to googlefont URLs