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

What font-display technique is best for us? #50

Closed
peterbe opened this issue Jul 15, 2019 · 1 comment
Closed

What font-display technique is best for us? #50

peterbe opened this issue Jul 15, 2019 · 1 comment

Comments

@peterbe
Copy link
Contributor

peterbe commented Jul 15, 2019

We're currently using font-display:swap (It's by default when using typeface-zilla-slab)

It means it renders the default OS font (or whatever we configure as number 2 in font-family) until the webfont loads. If the webfont comes in after 1s the headers will flash as they change style.

An attractive alternative might be to try fallback or optional as it'll display nothing for the first 100ms which hopefully avoids the flash of unstyled text.

This site explains the differences: https://font-display.glitch.me/

Note, we're using web fonts of headlines only. Which might be an important factor as evaluate this.

@peterbe
Copy link
Contributor Author

peterbe commented Jul 25, 2019

font-display: swap is the right thing to do for headers. They look prettier that way and if the load very slow (e.g. 1,000ms) when the browser swaps out the system font for the pretty webfont, it won't cause reflow and jumping in the text that the user has hopefully started digesting.

@peterbe peterbe closed this as completed Jul 25, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant