Typography: Add column-width support to text columns block support#76781
Typography: Add column-width support to text columns block support#76781sidhant-tomar-003 wants to merge 4 commits into
Conversation
|
Warning: Type of PR label mismatch To merge this PR, it requires exactly 1 label indicating the type of PR. Other labels are optional and not being checked here.
Read more about Type labels in Gutenberg. Don't worry if you don't have the required permissions to add labels; the PR reviewer should be able to help with the task. |
|
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. |
|
👋 Thanks for your first Pull Request and for helping build the future of Gutenberg and WordPress, @sidhant-tomar-003! In case you missed it, we'd love to have you join us in our Slack community. If you want to learn more about WordPress development in general, check out the Core Handbook full of helpful information. |
Could a maintainer please add the |
What?
Related: #27118
Follow up to: #74656, #33587
Adds CSS
column-widthsupport to the existingtextColumnsblock support, enabling responsive multi-column text layouts.Why?
The existing
textColumnssupport only outputscolumn-count, which forces a fixed number of columns at all viewport widths. On narrow screens, columns become unreadably narrow or cause overflow. The CSScolumn-widthproperty works together withcolumn-countas a responsive pair --column-countsets the maximum number of columns, andcolumn-widthsets the minimum width before the browser drops a column. This is the behavior described in #27118.How?
textColumnMinWidthstyle property to the JS and PHP style engines, mapping to the CSScolumn-widthproperty.lib/class-wp-theme-json-gutenberg.php).lib/block-supports/typography.php).TextColumnsControlcomponent (packages/block-editor/src/components/text-columns-control/) that bundles column count and minimum width into a singleToolsPanelItem.16emis automatically applied. The user can adjust via S/M/L presets or switch to a custom value input with unit selection (em, rem, px).column-countandcolumn-width.Testing Instructions
12emand confirm it applies.column-countandcolumn-widthare removed from the block's inline styles.Testing Instructions for Keyboard
Screenshots or screencast
Changelog
Use of AI Tools
Claude was used as a coding assistant throughout this PR for guidance on Gutenberg architecture, component patterns, debugging, and drafting code. All code was reviewed, tested, and manually integrated.