internetarchive / internetarchive/openlibrary

Avoid flash of invisible text

Open
#3,226 1 comment 0 reactions 0 assignees View on GitHub
Lead: @jimchamp Module: Carousels Priority: 4 Theme: Performance Type: Bug Type: Subtask of Epic
Dominant language
Python
Stars
6.7k
Forks
2k
Avg merge
2d 19h
Merged PRs (30d)
138

Description

Fonts are often large files that take awhile to load. Some browsers hide text until the font loads, causing a flash of invisible text (FOIT).

**Pages:**

- [ ] Homepage

### Evidence / Screenshot (if possible)
#### Home Page delay:
![Screenshot from 2020-03-20 19-13-33](https://user-images.githubusercontent.com/31198893/77169118-f7bf1300-6ade-11ea-86a9-9d6e85de6636.png)

### Proposal & Constraints

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

- The easiest way to avoid showing invisible text while custom fonts load is to temporarily show a system font. By including font-display: swap in your @font-face style, you can avoid FOIT in most modern browsers:
[https://web.dev/font-display/?utm_source=lighthouse&utm_medium=devtools](https://web.dev/font-display/?utm_source=lighthouse&utm_medium=devtools)

### Stakeholders

@tabshaikh

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.