Repository navigation
Fix block library and global styles stylesheet ordering when a block style variation is active - #63918
Conversation
…style variation is active
|
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message. To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
andrewserong
left a comment
There was a problem hiding this comment.
Nice simple fix, good work identifying it @aaronrobertshaw, and thanks for the quick PR @talldan!
This is testing nicely for me and follows the order in which these are registered normally in core, too (outside of block style variations) 👍
| Before | After |
|---|---|
![]() |
![]() |
I also quickly smoke tested that custom block style variations are working as expected for me, too (screenshot includes a style variation for paragraph and button blocks):
LGTM! 🚀
aaronrobertshaw
left a comment
There was a problem hiding this comment.
LGTM as well 👍
✅ Could replicate issue
✅ Applying the fix resolves the problem
✅ Fix works regardless of whether core block assets are loaded separately
…pplied. Adjusts the dependency order to ensure stylesheets are output in the correct order. Syncs the PHP changes from WordPress/gutenberg#63918. Props talldanwp, aaronrobertshaw, andrewserong, aristath, mukesh27, ramonopoly, ytfeldrawkcab. Fixes #61748. git-svn-id: https://develop.svn.wordpress.org/trunk@58850 602fd350-edb4-49c9-b593-d223f7449a82
…pplied. Adjusts the dependency order to ensure stylesheets are output in the correct order. Syncs the PHP changes from WordPress/gutenberg#63918. Props talldanwp, aaronrobertshaw, andrewserong, aristath, mukesh27, ramonopoly, ytfeldrawkcab. Fixes #61748. Built from https://develop.svn.wordpress.org/trunk@58850 git-svn-id: http://core.svn.wordpress.org/trunk@58246 1a063a9b-81f0-0310-95a4-ce76da25c4cd
…pplied. Adjusts the dependency order to ensure stylesheets are output in the correct order. Syncs the PHP changes from WordPress/gutenberg#63918. Props talldanwp, aaronrobertshaw, andrewserong, aristath, mukesh27, ramonopoly, ytfeldrawkcab. Fixes #61748. Built from https://develop.svn.wordpress.org/trunk@58850 git-svn-id: https://core.svn.wordpress.org/trunk@58246 1a063a9b-81f0-0310-95a4-ce76da25c4cd
…pplied. Adjusts the dependency order to ensure stylesheets are output in the correct order. Syncs the PHP changes from WordPress/gutenberg#63918. Reviewed by hellofromTonya. Merges [58850] to the 6.6 branch. Props talldanwp, aaronrobertshaw, andrewserong, aristath, mukesh27, ramonopoly, ytfeldrawkcab. Fixes #61748. git-svn-id: https://develop.svn.wordpress.org/branches/6.6@58861 602fd350-edb4-49c9-b593-d223f7449a82
|
Removed the |
…pplied. Adjusts the dependency order to ensure stylesheets are output in the correct order. Syncs the PHP changes from WordPress/gutenberg#63918. Reviewed by hellofromTonya. Merges [58850] to the 6.6 branch. Props talldanwp, aaronrobertshaw, andrewserong, aristath, mukesh27, ramonopoly, ytfeldrawkcab. Fixes #61748. Built from https://develop.svn.wordpress.org/branches/6.6@58861 git-svn-id: http://core.svn.wordpress.org/branches/6.6@58257 1a063a9b-81f0-0310-95a4-ce76da25c4cd
…style variation is active (#63918) * Fix block library and global styles stylesheet ordering when a block style variation is active * Add backport changeglog * Update core backport ---- Co-authored-by: talldan <talldanwp@git.wordpress.org> Co-authored-by: andrewserong <andrewserong@git.wordpress.org> Co-authored-by: ramonjd <ramonopoly@git.wordpress.org> Co-authored-by: aaronrobertshaw <aaronrobertshaw@git.wordpress.org> Co-authored-by: eric-michel <ytfeldrawkcab@git.wordpress.org>
|
I've cherry picked this to the |
…pplied. Adjusts the dependency order to ensure stylesheets are output in the correct order. Syncs the PHP changes from WordPress/gutenberg#63918. Props talldanwp, aaronrobertshaw, andrewserong, aristath, mukesh27, ramonopoly, ytfeldrawkcab. Fixes #61748. git-svn-id: https://develop.svn.wordpress.org/trunk@58850 602fd350-edb4-49c9-b593-d223f7449a82
…ary styles (#80062) * Fix custom CSS support reordering global-styles ahead of wp-block-library Block-level custom CSS registered `wp-block-custom-css` with a dependency on `global-styles` only, then enqueued it at priority 1. This pulled `global-styles` ahead of `wp-block-library` in the print order, so block library fallbacks (e.g. the static `--wp--preset--font-size--*` values in common.scss) overrode the global styles and broke fluid typography. List `wp-block-library` before `global-styles` in the dependency array so block library prints first and global styles keep winning the cascade, mirroring the block style variations fix in #63918. Fixes #79974 Co-Authored-By: Claude <noreply@anthropic.com> * Add backport changelog * Update docblock Co-authored-by: Weston Ruter <westonruter@gmail.com> --------- Unlinked contributors: goutetsuguma. Co-authored-by: t-hamano <wildworks@git.wordpress.org> Co-authored-by: ramonjd <ramonopoly@git.wordpress.org> Co-authored-by: westonruter <westonruter@git.wordpress.org>






Fixes #63912
Core backport: WordPress/wordpress-develop#7088
Trac Ticket: https://core.trac.wordpress.org/ticket/61748
What?
Reorders the dependencies for
block-style-variations-stylesWhy?
The order of the dependencies here was causing different ordering of stylesheets on the page
When a theme is using theme.json presets that match the naming used by core, this can suddenly cause those core styles to override those from the theme.json (the css variables from core take precedence over those generated from the theme.json.
Props to @aaronrobertshaw for spotting the problematic line of code
Testing Instructions
theme.jsonfile to include a font size with the slugnormalthat is something fairly large, like2rem2remExpected: the text is still
2remBefore: the text was incorrectly
16pxScreenshots or screencast
Before
After