-
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
Query: Remove color block supports #46147
Conversation
Size Change: +301 B (0%) Total Size: 1.32 MB
ℹ️ View Unchanged
|
698d39d
to
9022fcf
Compare
This looks like a safer approach than the previous one - there is still the potential for it to be a breaking change if themes are targeting children based on them being direct children of the query block, but that is a much lesser risk than problems with adding color to all children, and 🤞will be a reasonable small subset of usage. Will give it a full review next week. |
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.
Worked as advertised for me:
✅ Query blocks with color were migrated to a nested group with color attached
✅ Deprecation fixture tests ran successfully
✅ Color option gone from new query blocks but available on post template block
I added the Needs dev note
flag as we should alert people to the potential new dom structure for migrated blocks.
Query blocks with colors support styles applied directly to them should be infrequent enough that a simple note in the Block Editor misc dev notes should suffice. Dev NoteStarting from WordPress 6.2, the Query block will no longer opt into color block supports. Existing Query blocks with set colors will be migrated. This may potentially involve a new DOM structure due to an introduced inner Group block to which the previously set colors will be moved. For more info, see #46147. |
Fixes: #46472
Related:
What?
Removes the Query block's color supports, moving them to the inner blocks.
Note: This could be a potentially breaking change due to the potential introduction of a wrapping Group block to enable reapplying the prior Query block colors.
Why?
The Query block is to be a "settings only" block. Applying the colors at such a high level has inconsistent results as well.
This direction for the Query block was identified through feedback on the block inspector tabs experiment introduced in #45005
How?
Alternative Approach Tried: Reapply colors to all inner blocks
This approach fell short in a couple of key ways:
It would have the benefit of not introducing additional markup though. In trialling this approach the lack of new markup doesn't make up for its failure to maintain colors.
Testing Instructions
npm run test:unit test/integration/full-content/full-content.test.js
Example Deprecated Query Blocks
The following query blocks have a mixed of applied color support styles, inner blocks, or no customization.
Screenshots or screencast
Screen.Recording.2022-12-08.at.3.34.41.pm.mp4