-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Global Styles: Prevent duplicate block style variations CSS #62465
Conversation
This pull request has changed or added PHP files. Please confirm whether these changes need to be synced to WordPress Core, and therefore featured in the next release of WordPress. If so, it is recommended to create a new Trac ticket and submit a pull request to the WordPress Core GitHub repository soon after this pull request is merged. If you're unsure, you can always ask for help in the #core-editor channel in WordPress Slack. Thank you! ❤️ View changed files❔ lib/block-supports/block-style-variations.php ❔ lib/class-wp-theme-json-gutenberg.php ❔ phpunit/class-wp-theme-json-test.php |
Flaky tests detected in e1514bd. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/9514841936
|
e9441f2
to
b4dc34a
Compare
Size Change: +18 B (0%) Total Size: 1.76 MB
ℹ️ View Unchanged
|
15e8087
to
8fb3105
Compare
While backporting this one I found there's a difference between Gutenberg's and Core's |
a10b31e
to
9801d67
Compare
I tracked the divergence between Core and Gutenberg As No further changes on that front should be required here, so I'll flag this one ready for review. |
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. |
The test failures appear unrelated so I've kicked off a re-run of those tests. If they don't pass, I'll dig into them first thing tomorrow. |
9801d67
to
3c2de51
Compare
60194a0
to
a3be836
Compare
…s#62465) Co-authored-by: aaronrobertshaw <[email protected]> Co-authored-by: oandregal <[email protected]> Co-authored-by: colorful-tones <[email protected]>
The PHP changes were backported and merged in time for 6.6 beta 3. I missed the backport label on this one for the JS changes to be cherry-picked, sorry. |
Co-authored-by: aaronrobertshaw <[email protected]> Co-authored-by: oandregal <[email protected]> Co-authored-by: colorful-tones <[email protected]>
I just cherry-picked this PR to the wp/6.6-rc-1 branch to get it included in the next release: 5d940ff |
Co-authored-by: aaronrobertshaw <[email protected]> Co-authored-by: oandregal <[email protected]> Co-authored-by: colorful-tones <[email protected]>
Fixes: #62457
What?
As the new section styles feature requires styles generated per application of block style variations so they can be nested, there's superfluous CSS generated in the frontend theme.json stylesheet. This PR removes that.
Why?
Less CSS.
How?
Adds option in theme json to opt out of style generation for block style variations. A similar option is added to the
useGlobalStylesOutput
hook in the editor.Testing Instructions
/styles/partial.json
Custom
block style variation.is-style-custom-*
css class matchedNote: Core blocks with variations can also be used for testing, e.g. Button or Image. These blocks those also have other styles from the block library enqueued that would match. The removal of redundant CSS is clearer when testing with a custom variation.
Screenshots or screencast