Skip to content

Conversation

@calebeby
Copy link
Member

@calebeby calebeby commented Aug 5, 2021

Overview

This is a performance improvement, part of https://github.com/cloudfour/cloudfour.com-wp/issues/511.

font-display: swap makes the browser display fallback fonts immediately, until the requested font is loaded. Without this property, the browser displays no text for a short delay, and only displays the fallback font after a timeout, and if the requested font has still not loaded after the timeout.

Testing

I tested it on cloudfour.com locally by editing the font declarations in the node_modules folder. By repeatedly doing a hard-refresh with caching disabled, I could see that with font-display: swap the fallback font gets displayed right away.

@calebeby calebeby requested review from a team and tylersticka August 5, 2021 22:10
@changeset-bot
Copy link

changeset-bot bot commented Aug 5, 2021

🦋 Changeset detected

Latest commit: 24baa46

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@cloudfour/patterns Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@calebeby calebeby merged commit 0853e52 into v-next Aug 9, 2021
@calebeby calebeby deleted the font-display-swap branch August 9, 2021 15:40
@github-actions github-actions bot mentioned this pull request Aug 9, 2021
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

Successfully merging this pull request may close these issues.

3 participants