WAIT: Dreadful Flash of Unstyled Content on Fonts

So I finished porting a site from Elementor to Bricks, and I’m very happy with everything EXCEPT for the utterly jarring flash of unstyled content on the fonts. It’s really, really noticeable.

I’ve tried offloading fonts via OMGF, but it seems like they’re being loaded by Bricks in such a way that is preventing that from happening correctly (I can get the fonts to pull locally, but they’re still being called from Google when I check the network tab of inspector).

No matter what I seem to do - change hosting, caching, no caching, OMGF on, OMGF off, autoptimize on to disable Google Fonts complete, autoptimize off - it’s still there and it’s so bad I can’t in good conscience put the site live

Here’s a video showing the FOUC, the site ONLY has Bricks active. Zero plugins.

https://app.vmaker.com/record/jh3DskUZjliVBayu

What can we do to fix this? Is there a snippet that we can use to completely disable Google Fonts?

So to update on this…

Using OMGF I offloaded the fonts and set to preload, then using Autoptimize I set display to block instead of swap.

Because the fonts are preloaded there’s no flash of invisible text like there would be otherwise.

The new issue is that I can’t disable the external google font calls despite the fonts coming from the local host now.

It would be great if we could have some font handling options within Bricks. Something like:

  • Disable Google Fonts (on/off)
  • Font display (auto/swap/fallback/block)
  • Serve Google Fonts locally (font family, type and weight selector to choose which fonts get copied into a directory like bricks/local-fonts and have the style sheet updated accordingly)

That would all be spectacular, but at the very least the option to turn off Google Fonts and let us manually do the rest with OMGF would be almost as good!

Hello @Pete

If you use Google fonts, Bricks already is using the display:swap technique to avoid the FOUC effect.

Could you please share the URL of your website so we could check it?

Sure. Is there any way to share with you privately?

It’s the display:swap that’s causing the issues from what I can tell. Forcing display:block and preloading the fonts via Autoptimize and OMGF stops the flashes (but the fonts are still being called from Google later on in the waterfall despite being loaded already locally)

You may send us an email to help@bricksbuilder.io or send me a private message on the forum.
Thank you

Ha! I had no idea we could message on here. Sent :slight_smile:

1 Like

Any update on this? Went with Oxygen for the build in the end and wanted to delete the Bricks install if you’re done looking at it :slight_smile:

Cheers!

Hello @Pete
We’re still investigating it.

Hello @Pete,

Sorry for the late reply, did you get the chance to test the new Bricks feature released with 1.3.4 to set a different Webfont loading mechanism:

Hi, @luistinygod ,
My “Webfont Loading Method” use Webfont Loader (JS), anything is fine. But when I use some speed optimization plugins(wprocket and SiteGround Optimizer) and still Flash, should I exclude some js or css file from minifying or lazy loading?

Update: I found that the “Combine JavaScript Files” feature makes the “Webfont Loader (JS)” useless even if I exclude “/themes/bricks/assets/js/libs/webfont.min.js”

Hello @Lee

If you are using the Lazy Loading mechanism provided by WP Rocket or SG optimizer please disable the Bricks lazy loading mechanism under Bricks > Settings > Performance.