Skip to content

🚀 [Story performance] Remove FOUT on font loading of amp-story-education#37928

Merged
mszylkowski merged 19 commits intoampproject:mainfrom
mszylkowski:education_fout
Mar 22, 2022
Merged

🚀 [Story performance] Remove FOUT on font loading of amp-story-education#37928
mszylkowski merged 19 commits intoampproject:mainfrom
mszylkowski:education_fout

Conversation

@mszylkowski
Copy link
Copy Markdown
Contributor

@mszylkowski mszylkowski commented Mar 21, 2022

Amp-story-education installs 40kB of Open Sans fonts (3 weights) that load after amp-story-education so the critical path to install the fonts takes a significant time. Currently we don't specify any loading strategy which makes a FOUT (flash of unstyled text) that is registered as a CLS.

We can use https://www.industrialempathy.com/perfect-ish-font-fallback/?font=Open%20Sans to remove the FOUT by setting the fallback height of Arial to match the height of the font.

@mszylkowski mszylkowski requested a review from gmajoulet March 21, 2022 17:44
@mszylkowski mszylkowski self-assigned this Mar 21, 2022
@amp-owners-bot
Copy link
Copy Markdown

Hey @gmajoulet! These files were changed:

extensions/amp-story-education/0.1/amp-story-education.css

@mszylkowski mszylkowski requested a review from gmajoulet March 21, 2022 19:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants