-
Notifications
You must be signed in to change notification settings - Fork 4.6k
Enable grid block to be responsive when columns are set #73662
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
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: +3 B (0%) Total Size: 2.58 MB
ℹ️ View Unchanged
|
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 well for me:
I checked the editor and frontend, and also the generated values. The CSS output is the same.
Grid blocks build in trunk also show no regressions for me.
Kapture.2025-12-02.at.15.18.41.mp4
The UI is also simplified by removing the Auto/Manual toggle.
This is one of the top advantages in my opinion. No longer are we asking users to understand what Auto and Manual mean.
Do you think it's worth adding tests in packages/block-editor/src/layouts/test/grid.js to cover the combined mode (when both minimumColumnWidth and columnCount are set)?
Other than that it LGTM
cc @jasmussen for 👀
Yeah worth adding another test!
I think you meant @jasmussen 😄 |
🤦🏻 Oof, yes I did. Sorry |
|
Also, cc @ObliviousHarmony who suggested we add this feature ages ago! |
|
Updated to apply @jasmussen's suggestion! |


What?
A minimal iteration on #57478.
This PR allows both "minimum column width" and "columns" controls to be used simultaneously and removes the toggle between Auto and Manual modes.
Currently in trunk users have to choose between setting a minimum column width, which allows the grid to be responsive, or a number of columns, which stays fixed.
In this branch, that behaviour is maintained if users set only one of the controls. However, if they choose to set both, "columns" will now behave as "max columns", and will become responsive according to the minimum column width set.
The UI is also simplified by removing the Auto/Manual toggle.
Testing Instructions
The below video shows the difference between setting only a min width, and setting both min width and columns.
grid_always_auto.mp4