- This topic has 7 replies, 3 voices, and was last updated 6 years, 8 months ago by
David.
-
AuthorPosts
-
August 9, 2019 at 5:38 pm #980341
Jim
Hi. I keep getting this kind of thing flagged in some speed tests like Google Lighthouse (see shared URL). Do you think this is part of my minified CSS? Or what is it?
August 9, 2019 at 7:30 pm #980382Leo
StaffCustomer SupportHi there,
That just looks like your CSS for the entire site to me.
Not sure why Google would mark it unused.
Do you get the same warning without any plugins activated?
August 9, 2019 at 9:41 pm #980432Jim
I deactivated the cache/minification plugin (LSC Plugin) and I get these two paths now marked as unused:
wp-includes/css/dist/block-library/style.min.css?ver=5.2.2andwp-content/themes/generatepress/css/all.min.css?ver=2.3.2. When I enable the plugin, the path is as shared in the link.August 10, 2019 at 6:07 am #980539David
StaffCustomer SupportHi there,
It flags this CSS because a significant % of that CSS is not required on that particular page.
What it cannot calculate is that some of the unused CSS is required for other pages, user login status or elements that are loaded after initial page load.Yes you could go to the extent of creating a Critical CSS path so it loads the the necessary CSS first and defers the rest for later loading. But this is a huge task and really not worth it for such a small amount of CSS. So i would ignore it.
One thing however:
Are you using the Gutenberg editor?
If not then the Disable Gutenberg plugin by Jeff Starr has an option to remove front end styles. Haven’t tested it ( and would only do so on a backup / staging site ) but this could remove the first CSS file being loaded.August 10, 2019 at 8:37 am #980748Jim
The LSC plugin has an option to generate critical CSS. So I am not sure if it is working or not. I guess I can ignore that warning. I do use the Gutenberg editor and have converted all my posts to it. But would you tell me why it loads frontend styles while it works backend?
August 10, 2019 at 8:57 am #980758David
StaffCustomer SupportBlocks require their own styling – things such as column layouts, button styles or alignment properties need to be added to the frontend as well.
August 10, 2019 at 1:51 pm #980905Jim
Aha. That makes sense. But both codes are only like 10kb so not worth the hustle. Thanks for the clarification.
August 10, 2019 at 3:59 pm #980964David
StaffCustomer SupportTotally 🙂 You’re welcome
-
AuthorPosts
- You must be logged in to reply to this topic.