-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
Update custom CSS handling to be consistent with block global styles. #6750
Update custom CSS handling to be consistent with block global styles. #6750
Conversation
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. |
744c065
to
30a66f1
Compare
30a66f1
to
b4a35ec
Compare
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.
Thanks for putting this together @tellthemachines 👍
✅ Code changes align with Gutenberg PR
✅ With separate block assets loading, custom css is only loaded when block is present
✅ Without separate block assets loading, custom css is always loaded
✅ Same results when testing custom css via global styles or theme.json
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.
Code-wise this is looking good to me, too. The one difference I noticed while testing is that with a classic theme active, it appears that the customizer's Additional CSS doesn't update in real-time with this PR applied.
Can anyone reproduce this issue, or is it just my environment?
Trunk
2024-07-10.11.34.59.mp4
This PR
2024-07-10.11.37.02.mp4
This feature is otherwise testing well for me in block themes, the site editor and post editor, and with the styles being output correctly on the site frontend.
265d504
to
3b4926d
Compare
Thanks for reviewing, folks!
I could reproduce that locally; it was due to a missing check that made sure dequeuing customizer CSS only happened for block themes. I've replaced the check now so things should work exactly as they do in trunk. |
I've just put up a PR to fix this in Gutenberg too: WordPress/gutenberg#63331 |
Thanks for the quick fix 🚀 I could replicate the issue and can confirm the latest tweak in 56d5448 fixes it.
|
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.
That's testing nicely for me in classic themes now, while block themes and custom CSS continue to work as expected. Thanks for the follow-up!
Thanks for re-testing! Committed in r58703, |
Thanks for committing this early in the 6.7 cycle ❤️ |
Trac ticket: https://core.trac.wordpress.org/ticket/61395
Syncs changes from WordPress/gutenberg#62357.
Steps for testing:
add_filter( 'should_load_separate_core_block_assets', '__return_false', 11 );
to the theme's functions.php and check that custom CSS for all blocks always loads in the front end.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.