Repository navigation
Responsive block instance styles #78384
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
Merged
Merged
Changes from all commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
6fd9e5b
Block Editor: Add viewport states to block instance controls
talldan abc0903
Block Editor: Store block style state selections by type
talldan d3c9b16
Block Editor: Clean up block style state defaults
talldan a173c5c
Block Editor: Preview responsive block style states
talldan 3770734
Fix style output
talldan ef79c49
Implement Show state on canvas for responsive
talldan 7596a2c
Improve naming of $state variables
talldan 2c853dd
Fix viewport dropdown conflicting with state dropdown
talldan d60a657
Fix ambiguous function naming
talldan 680fa3f
Avoid style calculation when styles are not shown on canvas
talldan 4827188
Signal viewport state changes to editor
talldan 78bdb4f
Replace wp_style_engine_get_styles usage with gutenberg version
talldan ec2f681
add to changelog
tellthemachines 323c5f7
Stabilize block hierarchy keyboard test
talldan File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,4 @@ | ||
| https://github.com/WordPress/wordpress-develop/pull/11828 | ||
|
|
||
| * https://github.com/WordPress/gutenberg/pull/76491 | ||
| * https://github.com/WordPress/gutenberg/pull/76491 | ||
| * https://github.com/WordPress/gutenberg/pull/78384 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.
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.
This is working excellently. I'm really excited about this feature.
Kapture.2026-05-18.at.15.46.15.mp4
I think I found an edge case (at least on the frontend) for the Icon block.
The root is
.wp-block-icon svg, but the state class falls back to the wrapper element, e.g.,.wp-states-9fbee793instead of thesvg. It's most obvious when you play around with width for that block.The editor seems to behave properly.
Maybe it affects other such blocks, like table as well (
.wp-block-table > table)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.
Some of the edge cases should be addressed in #78326. It should work for Icon but ultimately we need to test both PRs together to be sure. I listed all the edge cases I could find when testing with my first throwaway PR here; we'll have to work through all of those in follow-ups 😅
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 just ran a local test with #78326 on top of this PR and it fixes:
default:

mobile:

All the remaining issues listed here aren't just selector-related. Most are due to either a custom implementation for that block or being tied to markup changes, and we'll likely have to address them individually in follow-ups.
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 checking! 🙇🏻
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.
If anyone wants to test, I pushed the branch with the two PRs and made a draft here.