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

Optimization: Ensure text remains visible during webfont load #4173

Closed
rfultz opened this issue Nov 5, 2020 · 0 comments · Fixed by #4555
Closed

Optimization: Ensure text remains visible during webfont load #4173

rfultz opened this issue Nov 5, 2020 · 0 comments · Fixed by #4555

Comments

@rfultz
Copy link
Contributor

rfultz commented Nov 5, 2020

Background

Looking to optimize the site's performance and that of the homepage specifically, the Lighthouse tool in Chromium browsers has made some suggestions. Some of these will have repercussions throughout the app so we're going to make them their own tickets.

Recommendation: Ensure text remains visible during webfont load

Leverage the font-display CSS feature to ensure text is user-visible while webfonts are loading. details

Overview

We could add font-display: swap; to each font rule so text display doesn't have to wait until all of our fonts are loaded. Especially beneficial on the first page of a user's visit to our site in the last month or two before any fonts have ever been loaded. Irrelevant after the fonts have been loaded once.

Benefit (the 80 of 80/20)

Noticeable for first-visit site visitors
Irrelevant for everyone else

Effort (the 20 of 80/20)

Minimal

Complications

  • May cause text to momentarily jitter if the connection is slow enough. As-is, the text wouldn't display at all. Our fonts are close enough to typical system fonts that it may not be an issue.
  • Make sure major browsers aren't negatively impacted by any of these changes (Chrome, Safari, Firefox. IE?)

Related tickets

This was referenced Nov 5, 2020
@rfultz rfultz added this to the Sprint 14.3 milestone Mar 17, 2021
@rfultz rfultz modified the milestones: Sprint 14.3, Sprint 14.4 Apr 6, 2021
@rfultz rfultz self-assigned this Apr 6, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant