-
Notifications
You must be signed in to change notification settings - Fork 383
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve page experience for fonts in core themes via preloading, preconnecting, and using font-display:optional
#6036
Comments
For Genericons, we definitely will need to use In the table, Genericons should be added to Twenty Fifteen and Twenty Sixteen. Note there is a For the amp-wp/includes/sanitizers/class-amp-style-sanitizer.php Lines 2433 to 2570 in 2d0de18
This is where we'd need to add the amp-wp/includes/sanitizers/class-amp-style-sanitizer.php Lines 2566 to 2570 in 2d0de18
For Google Fonts, the amp-wp/includes/sanitizers/class-amp-style-sanitizer.php Lines 1374 to 1402 in 2d0de18
For Google Fonts, we'd be adding |
As noted in #5678 (comment), let's only worry about maximizing the performance of the three most recent core themes. These are the ones bundled with core now, and they are the three that we'll always show as Reader themes (even if not installed). |
I've filed an issue to address this separately: #6156. |
For Google Fonts needing to use |
I've also identified that core is adding |
font-display:optional
One of the areas of optimization is to force the |
QA Passed:
|
Bug Description
Improve page experience of core themes by preloading and preconnecting fonts, as suggested by Pixi let's preload core theme fonts which are loaded through URL also use font-display property suggested
font-display: optional
As we discussed core themes are still widely used, and also used as Reader Mode themes, so let's add these small improvements.
Ref: ampproject/amp.dev#5531
Core themes and fonts Tested
Expected Behaviour
preconnect and dns-prefetch
<link href=https://fonts.gstatic.com rel="dns-prefetch preconnect" crossorigin>
preload
<link rel="preload" href="https://mywebsite.com/wp-content/themes/twentytwenty/assets/fonts/inter/Inter-italic-var.woff2" as="font" crossorigin>
Steps to reproduce
Screenshots
Additional context
Do not alter or remove anything below. The following sections will be managed by moderators only.
Acceptance criteria
Implementation brief
QA testing instructions
Demo
Changelog entry
The text was updated successfully, but these errors were encountered: