Repository navigation
Responsive style states for blocks - 7.2 tasks #80388
Description
This succeeds the 7.1 iteration #77817
Public API for 3rd party blocks with custom controls ✅
The following functions from block-editor package would be useful:
useBlockStyleState( clientId?)
getStyleForState( style, styleState ) and setStyleForState( style, styleState, nextStyle ) isDefaultBlockStyleState( styleState )
hasViewportBlockStyleState( styleState ) and hasPseudoBlockStyleState( styleState )
Also getViewportMediaQueries( viewportSettings? ) from global-styles-engine would be handy.
On the PHP side, we might need a public wrapper for get_viewport_media_queries, given that the theme json class isn’t supposed to be used by extenders. (Props @gigitux for raising this question)
#82003 added a group="viewport" InspectorControls slot which can be used for custom controls, so that should be documented.
Counterpart block toolbar slot also needed: #82633
Add support for additional controls
From the lists below, I think Position and Custom CSS should be prioritised as being most useful to set per viewport.
Style controls yet to be supported
- Colors
- Overlay in Cover and Featured image
- All colors on Navigation
- Icon color/background on Social icons
- Background image works but can't be unset for a particular viewport
- Duotone Filter (related: Duotone filter doesn't work for block style variations in global styles. #77539)
- Typography
- Drop cap
- Fit text (also see the issue mentioned here - Site Tagline: Add fit text support #83034 (review), font size can override Fit Text on the frontend, but not in the editor)
- Text-decoration on Navigation block
- Position
- Aspect ratio: allow resetting to default in a viewport state.
Settings that can be converted to style controls
Gallery
- Columns (related: Gallery Block: Allow the number of columns to be maintained on mobile devices)
- Crop to fit
- Aspect ratio (draft PR: Enable viewport state values for Gallery aspect ratio #82233)
Cover
- Fixed/repeated background and focal point
Media text
- Media width
- Stack on mobile (probably not relevant for breakpoint-specific controls)
- Crop to fill/focal point
Social icons
- Icon size
Tag cloud
- Smallest/largest size
Avatar
- Image size
Embed
- Media settings: resize for smaller devices (probably not relevant for breakpoint-specific controls)
Advanced controls
- Advanced > Custom CSS (Support for Responsive control for Custom CSS section Support for Responsive control for Custom Css section #80333)
- Advanced > styles apply globally
Plus, the following are slated to be moved onto the Width block support (see #76525), which will make them per-viewport-editable by default:
Spacer
- Height/Width (replaced with flex child controls if in flex container)
Search
- Width
Site logo
Other todoes
- Replace hardcoded breakpoints in front-end CSS with more modular CSS #35848
- Reintroduce block supports (removed in Update state support to use config instead of block supports #78088) - allow blocks to opt in/out of global and instance styles. Consider any theme.json support for enabling/disabling style states.
- Responsive Styling – UX improvements - in particular, making clear which viewport is being edited seems the most needed change.
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fields✅ Done
Activity
jordesign commentedon Jul 20, 2026
Adding some feedback from recent testing I ran on the current state of Responsive styling:
talldan commentedon Jul 21, 2026
Thanks @jordesign, I think some of these have been addressed to some degree, but might still be areas to iterate on.
For global styles, there are some changes when using the in-editor sidebar (the one that's accessible via the 'styles' icon button next to the 'save' button). That now uses the editor's viewport dropdown control to toggle on responsive editing (Responsive styles: Use viewport dropdown to control states for in-editor global styles sidebar).
The global styles that's accessible via site editor's main menu doesn't change the viewport. It might be something to investigate.
This is now implemented (Responsive editing: Add a Tooltip to the viewport / states badge).
The icon does now change color (Device preview dropdown: use active color for device icon when responsive styles are active). This is still quite subtle, so it's possible more can be done.
To respond to some other points:
Agree there is a disconnect with the positioning. The UI has to account for long translations, and some blocks support multiple states being active, for example users can style the hover state on mobile:

I don't think there's enough space next to the dropdown to adequately show the badges. Perhaps a simple solution is to hide the block description text whenever a state is active (a user probably doesn't need to read that all the time) and move the badges above the 'Show state on canvas' toggle.
tellthemachines commentedon Aug 25, 2026
I removed the Columns custom control from the list because Row/Stack/Grid blocks can be used to replicate Columns layouts and make them responsive. I also removed Column width because it should at some point be migrated to actual width support.
moustakalis commentedon Sep 23, 2026
Some feedback on the public API section, from building a plugin on top of the 7.1 viewport states (Spacery, disclosure: I wrote it. It adds per-breakpoint padding and margin for sites that need more than two tiers).
+1 for a public PHP wrapper around
get_viewport_media_queries. I'd add that extenders need the resolved viewport widths too, not only the query strings. On 7.1 with a theme that doesn't declaresettings.viewport(Twenty Twenty-Five, for example), the defaults don't appear inwp_get_global_settings(),get_merged_data()or core'stheme.json, so I couldn't find a public way to read them and ended up hardcoding 480px and 782px. If those defaults ever change, every plugin that copied them drifts without noticing.Same story on the JS side. I rebuilt the
(480px < width <= 782px)range shape by hand in both PHP and TS so my bands stay disjoint with core's. A publicgetViewportMediaQueries()plus the PHP wrapper would remove both copies.On the positive side,
useStyleOverridewas enough to preview per-viewport styles in the canvas, and the override lands after core's block-support style, so ordering worked without tricks.One question: is letting a plugin register additional viewports in scope for this API, or should
settings.viewportstay the only source? It decides whether a plugin like mine should read core's list or keep its own next to it.tellthemachines commentedon Sep 24, 2026
Thanks for the feedback @moustakalis! The first iteration of the API work just merged in #82741. Currently we're focusing on allowing custom block controls to work with the existing viewports so it's still a minimal toolset.
Not currently, but there has been discussion around allowing themes to configure additional breakpoints (that was why we started prefixing the viewport names with symbols in #79210).
tellthemachines commentedon Oct 7, 2026
Update
Public API for custom controls has mostly shipped; there's just a small change to the inspector slot name in review in #83539.
We've added support for new controls:
Progress on improving the UX/UI for responsive style states:
What's still todo?
Further progress on the UX/UI problems, particularly in clearer flagging of when responsive editing is enabled.
We might tick off a couple more items from the list of style/settings controls still to support, but don't expect to finish the whole list for 7.2. Feedback appreciated on any items from that list that would be particularly desirable, so we can prioritise!
jasmussen commentedon Oct 8, 2026
For any design assistance or input you might need, please continue to ping @WordPress/gutenberg-design on anything. Thank you!
tellthemachines commentedon Oct 20, 2026
With 7.2 Beta 1 just released, I'll go ahead and close this. Further iterations will be tracked in #85243. Thanks everyone!
annezazu commentedon Oct 20, 2026
Great work all around for this 7.2 cycle 🚀