Column: Migrate to width block support - #13411
Open
aaronrobertshaw wants to merge 1 commit into
Open
Conversation
Handle the Column block's width through the `dimensions.width` block support so it aligns with Global Styles and can be set from theme.json. Columns size themselves with `flex-basis` rather than `width` because they live in a flex container, so `WP_Theme_JSON` converts the computed `width` declaration and pins `flex-grow` to `0`. This runs at the block level, on block style variations, and on variation styles set within a responsive breakpoint. The block.json and theme.json changes arrive separately with the next Gutenberg package update, following the Button block migration. Developed in: WordPress/gutenberg#76684 See #66055.
Test using WordPress PlaygroundThe changes in this pull request can previewed and tested using a WordPress Playground instance. WordPress Playground is an experimental project that creates a full WordPress instance entirely within the browser. Some things to be aware of
For more details about these limitations and more, check out the Limitations page in the WordPress Playground documentation. |
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Backport of Gutenberg PR WordPress/gutenberg#76684
Trac ticket: https://core.trac.wordpress.org/ticket/66055
This migrates the Column block to the
dimensions.widthblock support.Columns are in a flex container and size themselves with
flex-basisrather thanwidth, soWP_Theme_JSONconverts the generatedwidthdeclaration and setsflex-grow: 0.This PR backports:
flex-basisconversion for column widths inWP_Theme_JSON, covering the block level, block style variations, and variation styles set within a responsive breakpointWP_Theme_JSONtests.The
core/columnblock.jsonand theme.json changes arrive with the next Gutenberg package update, as they did for the Button block in #12046.Testing instructions
The
core/columnblock.jsonand theme.json settings changes land with the next Gutenberg package update, so there is no width control in the editor yet.This PR is the CSS generation, so test that directly.
contain:
Without the change these come out as
width, which does not size a flex child, so the columns divide the space evenly instead of honouring the width.Use of AI
AI assistance: Yes
Tool(s): Claude Code
Model(s): Claude Opus 5
Used for: The mechanical port and test drafting; reviewed and edited by me.