Site logo

Archived topic

How to get rid of block-library/style.min.css

7 replies · Started by Bernhard on July 24, 2022

Viewing posts 1–8 of 8

Hello, I extracted the critical CSS of the style.min.css as described here and inserted it in a hook before header called Preload style.min.css. Now I want to defer /wp-includes/css/dist/block-library/style.min.css but I don't know how to.
I tried with <link rel="stylesheet" href="/wp-includes/css/dist/block-library/style.min.css" media="print" onload="this.media='all'"> but maybe it does not work or I don't use it correct in Elements.
Thank you,

Hi Bernhard,

Can you tell me what's your purpose of doing all this?

I'm trying to figure out what you want to achieve.

Let me know!

Hi Ying,
it's to reduce LCP. Pagespeed insight gives me this CSS file with a size of 12,9 KiB and potential savings of 12,8 KiB.

Very good, thank you :)

You’re welcome Bernhard! :)

After testing the new setup, I believe that the file block-library/style.min.css is not necessary when building a site from scratch with GenerateBlocks Pro. Currently I still use the old image block and the spacer, but it can easily be replaced with the various formatting options in GenerateBlocks Pro and the new image block is much more powerful. Eliminating block-library/style.min.css and inserting a few lines of CSS for the old images and the spacer brought my LCPs to green in PSI on most of my pages, even having a lot of JS originated by Ezoic Ads.

That’s great to hear! Thank you for sharing!

This archived topic is closed to new replies.