-
Notifications
You must be signed in to change notification settings - Fork 27.5k
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
docs: Add explanation about font-display #44001
Conversation
461f5f7
to
9041fe6
Compare
Ping @leerob |
@@ -22,6 +22,12 @@ To get started, install `@next/font`: | |||
npm install @next/font | |||
``` | |||
|
|||
### Choosing font-display | |||
|
|||
[`font-display`](https://developer.mozilla.org/en-US/docs/Web/CSS/@font-face/font-display) lets you to control how your font is displayed while it's loading. `@next/font` uses `font-display: optional` by default. When the primary font used by `@next/font` does not load within 100ms, the auto generated fallback font will be displayed in the browser. While it is automatically generated to be as visually similar to the primary font as possible to reduce layout shift, it does come with the tradeoff that your intended font might not be shown on slower networks unless it's cached. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"might not be shown on slower networks unless it's cached."
I don't understand how caching affects the first display of the font. If the network is slow, and it takes longer than 100ms, it doesn't matter if it's cached - right?
Or is this trying to say that on the next visit it would be shown since it is now cached in the user's browser from the first session?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Or is this trying to say that on the next visit it would be shown since it is now cached in the user's browser from the first session?
Yeah, this. Unless it's in cache.
Add explanation and recommendation of
font-display
.Bug
fixes #number
contributing.md
Feature
fixes #number
contributing.md
Documentation / Examples
pnpm build && pnpm lint