-
Notifications
You must be signed in to change notification settings - Fork 9.3k
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
Unexpected results for font-display ('Ensure text remains visible during webfont load') audit #6628
Comments
similar to #483, are you able to send us a URL so we can test and verify? thank you! |
Not sure if it's similar as I see that ligthouse is picking up the new CSS rules related to the font. This is the URL: https://botsociety.io |
Cool site :) I tried changing all of your @font-face styles over to using |
To add more context, I created a Glitch to test: The glitch seems to pass the audits in DevTools |
@erlapso thanks for reporting! Feel free to correct me if I'm wrong. 👍 There is something weird going on between pagespeedinsights and lighthouse. lighthouse latest master seems to pass lighthouse devtools isn't: (v3.0.3) Actually devtools v3.0.3 is correct 👀 . The site is using critical-css which is great! 🎉 I see lots of font-face declarations in here without font-display. When the stylesheets kick in the font-faces are loaded again which do have a font-display value. Does this make sense? |
Ah thanks @blue2blond your issue is a little bit different, and I can confirm the problem. I'll file a separate issue for this 👍 |
Also reported with bombacarta DOT com |
Any further development in this thread??? Facing the same issue after deploying all available suggestions from my many of websites.??? for ref. https://www.truecadd.com/ |
Current state of this issue:
I'm going to reassign this to @exterkamp for now as it's a LR-specific issue (seems like it'd be difficult for ward to figure this one out without LR debug access, but feel free to pass on to the appropriate person @exterkamp 😃). @TheDutchCoder if you have a URL for us to add to this list while debugging that'd be great! |
Same issue here: https://gkstyle.net/ Passes locally, fails on PageSpeed Insights. |
Not sure this is the reason for all the above failures, but I had a similar issue, so I checked and turns out that the code that Lighthouse uses to find a declared font-display property is |
Thanks very much @Diklla! Interested in picking up a PR for that? :) |
@Diklla good find, adding semicolon at the end of the line fixed the issue for me. |
@Diklla Thank you very much! that fixed it for me too. |
fixed by #7191 |
same problem is here: https://hastadoktor.com can you explain the answer for non-coder ? |
Did have the same issue with Looking at the lighthouse code shows that only Any reason why |
@maersu the audit is all about picking a behavior other than the default behavior. It's not about setting any valid value. Ideally use |
@patrickhulce thanks for the reply and clarification! I was not aware, that
|
Hmm, you're right we never explicitly say what font display to be using 👍 |
Filed #7342 |
I still get this even when |
@sdennett55 what is your lighthouse version? This was fixed relatively recently. |
@patrickhulce I'm on the most recent version of chrome, but to clarify, I don't have the issue here https://web.dev/ but I do in the audit tab of devtools. Chrome: Version 73.0.3683.103 (Official Build) (64-bit) |
@sdennett55 stable Chrome runs very far behind current Lighthouse due to its release cadence. This has been fixed 👍 |
So how do you set the font-display if external CSS is bringing in fonts and you can't edit the CSS? |
@chrisSowerby you have a couple options as outlined by this article, the ideal solution isn't widely available yet but still ways to get the job done :) |
Hello @Diklla /* Typography */ {{ settings.heading_font | font_face: font_display: 'fallback' }} {%- assign text_font_bold = settings.text_font | font_modify: 'weight', 'bolder' -%} {{ text_font_bold | font_face: font_display: 'fallback' }} $heading-font-family : {{settings.heading_font.family}}, {{ settings.heading_font.fallback_families }}; $text-font-family : {{settings.text_font.family}}, {{ settings.text_font.fallback_families }}; $uppercase-heading: {% if settings.uppercase_heading %}true{% else %}false{% endif %}; $base-text-font-size : {{settings.base_text_font_size}}px; Thanks |
I'm still having this issue in web.dev too: |
@antoinerousseau those fonts it is flagging are indeed missing |
@patrickhulce I published an experiment since then, but you can see here what I was talking about: |
Ah thanks for the repro URL @antoinerousseau! There's something very different going wrong there, so I've filed #8493 for it. |
Same deal for https://lighthouse-dot-webdotdevsite.appspot.com/lh/html?url=https://sesamecare.com If you look at the source for the site the @font-face{font-family:'Gilroy';src:url('/assets/fonts/Gilroy-ExtraBold.woff2') format('woff2'),url('/assets/fonts/Gilroy-ExtraBold.woff') format('woff');font-display:fallback;font-weight:800;font-style:normal;} @font-face{font-family:'Gilroy';src:url('/assets/fonts/Gilroy-Bold.woff2') format('woff2'),url('/assets/fonts/Gilroy-Bold.woff') format('woff');font-display:fallback;font-weight:700;font-style:normal;} @font-face{font-family:'Gilroy';src:url('/assets/fonts/Gilroy-SemiBold.woff2') format('woff2'),url('/assets/fonts/Gilroy-SemiBold.woff') format('woff');font-display:fallback;font-weight:600;font-style:normal;} @font-face{font-family:'Gilroy';src:url('/assets/fonts/Gilroy-Medium.woff2') format('woff2'),url('/assets/fonts/Gilroy-Medium.woff') format('woff');font-display:fallback;font-weight:500;font-style:normal;} @font-face{font-family:'Gilroy';src:url('/assets/fonts/Gilroy-MediumItalic.woff2') format('woff2'),url('/assets/fonts/Gilroy-MediumItalic.woff') format('woff');font-display:fallback;font-weight:500;font-style:italic;} @font-face{font-family:'Gilroy';src:url('/assets/fonts/Gilroy-Regular.woff2') format('woff2'),url('/assets/fonts/Gilroy-Regular.woff') format('woff');font-display:fallback;font-weight:400;font-style:normal;} |
@probablyup follow up this issue #8493 |
Hi, I encounter the same issue. Lighthouse audit shows 'Ensure text remains visible during webfont load' diagnostic. Right now, I have
Here's a few things that my team has tried:
Hereby, I attached the lighthouse audit of https://www.blibli.com. (refer to point number 4 where we can't test with PageSpeed Insights / lighthouse-dot-webdotdevsite) Your help would be really appreciated. Thank you. |
I adjusted all the ‘font-display’ so that is optional or fallback as explained in the documentation, but I still get ‘Ensure text remains visible during webfont load‘ performance warning
The text was updated successfully, but these errors were encountered: