-
Notifications
You must be signed in to change notification settings - Fork 4.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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! 🚀
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 |
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-styles
Why?
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.json
file to include a font size with the slugnormal
that is something fairly large, like2rem
2rem
Expected: the text is still
2rem
Before: the text was incorrectly
16px
Screenshots or screencast
Before
After