-
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: Update utils for scoping CSS selectors #61026
Conversation
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. |
Size Change: +5 B (0%) Total Size: 1.74 MB
ℹ️ View Unchanged
|
Flaky tests detected in ac51ff2. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/8812471906
|
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.
Kind of unrelated but I thought about this when reading this PR: The style generation is getting more and more complex, same for theme.json but I think our documentation their doesn't follow yet.
For contributors, we should be explaining how the style generation work... and the different decisions. I'd love it if we add a page dedicated to that to the architecture docs https://developer.wordpress.org/block-editor/explanations/architecture/
Thanks for the review @youknowriad 👍
For the most part, the "Styles in the editor" page within the architecture docs seem to cover a lot around style generation. Reading through it, there are a few inaccuracies as well e.g. the second noted limitation on global styles not being able to target some styles to inner nodes etc. I can give those docs a freshen-up when I get to add details around block style variations. Updating this documentation has been added to the Section Styling tracking issue. |
Backport for the PHP changes here is available in: WordPress/wordpress-develop#6478 |
Related:
Note: The changes in this PR are being split out from #57908 to make that more manageable
What?
Adds early returns for existing utils that scope CSS selectors to make them more robust and ready for extended block style variations in #57908.
This PR also adds a new util for scoping a collection of feature selectors.
Why?
Testing Instructions
npm run test:unit packages/block-editor/src/components/global-styles/test/utils