-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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 … #7088
Conversation
…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 Core Committers: Use this line as a base for the props when committing in SVN:
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.
I've given this another run using this PR's specific branch. LGTM
✅ Could replicate issue
✅ Applying the fix resolves the problem
✅ Fix works regardless of whether core block assets are loaded separately
✅ Code changes match WordPress/gutenberg#63918
I used the following font size definition within my theme.json under settings.typography.fontSizes
:
{
"fluid": false,
"name": "Normal",
"size": "4.05rem",
"slug": "normal"
},
To toggle separate loading of core assets in TT4 I added the following to the functions.php file:
add_filter( 'should_load_separate_core_block_assets', '__return_false', 11 );
Separate Assets
Before | After |
---|---|
Consolidated Assets
Before | After |
---|---|
Visual Results
Before | After |
---|---|
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.
Test using WordPress PlaygroundThe changes in this pull request can previewed and tested using a WordPress Playground instance. WordPress Playground is an experimental project that creates a full WordPress instance entirely within the browser. Some things to be aware of
For more details about these limitations and more, check out the Limitations page in the WordPress Playground documentation. |
Mark ready for commit. |
committed to trunk in r58850 |
Trac ticket: https://core.trac.wordpress.org/ticket/61748
Gutenberg issue: WordPress/gutenberg#63912
Gutenberg PR: WordPress/gutenberg#63918
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
This Pull Request is for code review only. Please keep all other discussion in the Trac ticket. Do not merge this Pull Request. See GitHub Pull Requests for Code Review in the Core Handbook for more details.