• Beda

    (@bedas)


    I just noticed that (not sure since when/what release) WP Core loads a whole lot of wp-blocks related CSS in the front end, even if my theme does not make a single usage of any block, nor does any post (in fact, the classic editor plugin is installed and active).

    This is the style sheet loaded:
    wp-includes/css/dist/block-library/style.min.css?ver=6.0.2

    Is it expected that this style is loaded even if blocks are never used?
    (again, note that there is not even a single block used on the website. Neither in posts, nor in widgets, or in the theme. WP is used only as a CMS, not as a page builder, on this project).

    While not a showstopper, I feel this is a bit trespassing.
    Perhaps I miss something, like “we cannot detect if a block is actually ever used so we just load a bunch of CSS just in case”?
    In that case, I still would consider this a “doing it wrong”. Loading CSS “just because” has never been the best approach.

Viewing 1 replies (of 1 total)
  • Moderator bcworkz

    (@bcworkz)

    Hiya Beda!

    AFAIK this and similar issues have been an ongoing problem — blindly loading resource, needed or not. Then there’s the entire “defer loading anything not needed above the fold” issue on top of it all. Apparently the thought is it takes more processing to broadly determine if something is needed or not and any added bandwidth is a lesser concern.

    On a site by site basis, we can dequeue unneeded resource, conditionally or absolute. But a any size fits all solution is difficult to implement.

Viewing 1 replies (of 1 total)
  • The topic ‘Core loading a bunch of block styles, even when not needed’ is closed to new replies.