[wp-trac] [WordPress Trac] #60280: Ensure base global styles are loaded before block styles.
WordPress Trac
noreply at wordpress.org
Thu Jan 18 05:42:29 UTC 2024
#60280: Ensure base global styles are loaded before block styles.
---------------------------+--------------------
Reporter: isabel_brison | Owner: (none)
Type: enhancement | Status: new
Priority: normal | Milestone: 6.5
Component: Script Loader | Version: trunk
Severity: normal | Keywords:
Focuses: css |
---------------------------+--------------------
When `should_load_separate_core_block_assets` is true, block-library
stylesheets for each block are enqueued separately, so they only get
loaded if the block is on the page.
Global styles are enqueued later on, and any block-specific global styles
are appended to the above block stylesheets, so they end up sitting above
base global styles in the CSS cascade.
Base global styles should instead be loaded before block styles (or at
least before global block styles, so they are applied in the correct
order.
Having the correct style loading order in place is essential to reduce the
specificity of block global styles, in progress in
https://github.com/WordPress/gutenberg/pull/57841. This in turn will allow
section styles: https://github.com/WordPress/gutenberg/issues/57537 to be
generated with sustainable levels of specificity.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/60280>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list