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

add font swap to google font css api #2080

Closed
wants to merge 1 commit into from
Closed

Conversation

dowands
Copy link

@dowands dowands commented Dec 13, 2022

Add font swap to google font css display:swap to resolve "Ensure text remains visible" problem on web.dev

@imanish003 imanish003 self-requested a review December 20, 2022 10:00
@imanish003 imanish003 added the type: enhancement The issue is a request for an enhancement. label Dec 20, 2022
@imanish003
Copy link

Hey @dowands, Thank you for taking the time to create this PR; we appreciate your contribution 🙏🏻

I had an internal discussion with the team regarding this. A store might prefer to display the content as soon as possible and replace the font when downloaded (font-display: swap). Still, other stores might prefer to block rendering until the font has completely downloaded font-display: auto/block. Therefore we don't want to hard-code swap as font-display value.

Also, FYI, In future, we plan to remove Google Fonts because Google Fonts cause a GPDR issue for EU websites. You can find more info about it in issue #2077.

One alternative way to change font-display value could be to unregister Google Fonts with the methods proposed in #2077 & then register the fonts directly with a CSS file, so you can add the font-display property as you want.

I will close this PR for now, but we can continue our discussion in the comments. Thanks again for your contribution 🙂

@imanish003 imanish003 closed this Dec 22, 2022
@imanish003 imanish003 removed their request for review December 22, 2022 06:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: enhancement The issue is a request for an enhancement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants