Hi Dave,
there are two scenarios for stylesheets, controlled by the wp_should_load_separate_core_block_assets function:
1. Load all stylesheets, no matter whether the block is in use or not. This is the default for classic themes.
In this scenario, the core block styles will all be part of the wp-block-library-css
.
All styles that come from the theme.json
(or modifications the user did via the global styles sidebar in the site editor) will be part of the global-styles-inline-css
stylesheet.
2. Only the stylesheets for the blocks in use are loaded. This is the default for block themes.
In this case, there is no block-library-stylesheet
. Instead, if the block itself has a stylesheet, it’ll be loaded as wp-block-quote-css
.
The global-styles-inline-css
stylesheet still exists, though it only contains the styles that are not block-specific: classes for the color palette, styles that are for the body, etc.
If the theme provided block-specific styles via theme.json
, these are enqueued as inline stylesheet for the blocks that are in use: wp-block-quote-inline-css
if there is any quote, etc. Note that these stylesheets have the -inline-css
suffix.
Hope this helps clarify how styles are enqueued.
Best,
André