Opened 6 weeks ago
Last modified 6 weeks ago
#66055 new enhancement
Editor: Migrate the Column block to the width block support
| Reported by: | aaronrobertshaw | Owned by: | |
|---|---|---|---|
| Priority: | normal | Milestone: | 7.2 |
| Component: | Editor | Version: | |
| Severity: | normal | Keywords: | gutenberg-merge has-patch has-unit-tests |
| Cc: | Focuses: | css |
Description
Backport of Gutenberg PR https://github.com/WordPress/gutenberg/pull/76684.
Migrates the Column block from its ad-hoc width attribute to the standard
dimensions.width block support, so column widths can be set from global styles
and theme.json while existing columns keep working.
Columns sit in a flex container and size themselves with flex-basis rather than
width, so WP_Theme_JSON converts the computed width declaration and sets
flex-grow to 0. This covers the block level, block style variations, and
variation styles set within a responsive breakpoint.
The block.json and theme.json changes arrive with the next Gutenberg package
update, as they did for the Button block in #65388.
Change History (1)
This ticket was mentioned in PR #13411 on WordPress/wordpress-develop by @aaronrobertshaw.
6 weeks ago
#1
- Keywords has-patch has-unit-tests added
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
Backport of Gutenberg PR https://github.com/WordPress/gutenberg/pull/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.
"styles": { "blocks": { "core/column": { "dimensions": { "width": "25%" }, "@mobile": { "dimensions": { "width": "100%" } } } } }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.