-
-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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
Ensure text remain visible during webfont load with font-display #11814
Conversation
The `swap` argument on `font-display` instruct browsers to use fallback font for displaying texts until `@font-face` have been fully downloaded. Not specifying `font-display` cause PageSpeed Insights to complain on "Opportunities" category.
@silverwind what do you think? |
@6543 just make pagespeed happy and for slow internet access |
https://drafts.csswg.org/css-fonts-4/#font-display-desc
This is not really a solution, especially for emoji or CJK fonts which will most likely be rendered using font without necessary character set, which is imo worse than not rendering at all. |
Our implementation giving URL to download Any specific reason why we are explicitly forcing UA to download remote fonts for generic ones like Roboto? @zeripath you introduced that in #6007 |
I'd rather like to remove the Roboto webfont and use a system-native font stack. Imho, webfonts are not worth the trouble they bring. We have the option between rendering a invisible font until font has loaded (default browser behaviour) or render system font and accept a flash of wrong font (what this pr does), both seem bad. |
Would also like to remove Roboto webfont |
Created #11818 about native font stack. |
- Use system fonts only for text to avoid FOUT - Move font-awesome to npm/webpack - Move NotoColorEmoji to web_src - Remove presumably unneccesary 'PT Sans Narrow' - Simplify webpack import exclusions Fixes: go-gitea#11818 Fixes: go-gitea#11814
- Use system fonts only for text to avoid FOUT - Move font-awesome to npm/webpack - Move NotoColorEmoji to web_src - Remove presumably unneccesary 'PT Sans Narrow' - Simplify webpack import exclusions Fixes: #11818 Fixes: #11814 Co-authored-by: zeripath <art27@cantab.net> Co-authored-by: Lauris BH <lauris@nix.lv>
- Use system fonts only for text to avoid FOUT - Move font-awesome to npm/webpack - Move NotoColorEmoji to web_src - Remove presumably unneccesary 'PT Sans Narrow' - Simplify webpack import exclusions Fixes: go-gitea#11818 Fixes: go-gitea#11814 Co-authored-by: zeripath <art27@cantab.net> Co-authored-by: Lauris BH <lauris@nix.lv>
The
swap
argument onfont-display
instruct browsers to use fallbackfont for displaying texts until
@font-face
have been fully downloaded.Not specifying
font-display
cause PageSpeed Insights to complain on"Opportunities" category.
GIF Example on my LXD container: