Skip to content
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

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

Merged
merged 19 commits into from
Mar 22, 2022

Conversation

mszylkowski
Copy link
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 self-assigned this Mar 21, 2022
@amp-owners-bot
Copy link

Hey @gmajoulet! These files were changed:

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

@mszylkowski mszylkowski merged commit 0d4a798 into ampproject:main Mar 22, 2022
@mszylkowski mszylkowski deleted the education_fout branch March 22, 2022 15:19
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