Typography: Add column-width support for text columns#76450
Typography: Add column-width support for text columns#76450Shekhar0109 wants to merge 1 commit intoWordPress:trunkfrom
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. |
|
@Shekhar0109 Thank you for addressing my issue so quickly! This would be such a great addition to the Columns feature. I have one question: will this include a unit selector for the setting? I see that a |
|
@eric-michel Thanks for the feedback! Currently the control uses That said, your point about units makes sense — supporting something like Appreciate the suggestion and thanks again for raising the issue! |
What?
Closes #76363
Adds support for setting a minimum column width for text columns in the Typography panel. This introduces a new control called "Column minimum width" that maps to the CSS
column-widthproperty.Why?
Currently the text columns feature only supports the
column-countCSS property through the Columns control. This forces a fixed number of columns regardless of available width, which can cause readability issues on smaller screens.Supporting
column-widthallows the browser to automatically determine the number of columns based on the available container width while maintaining a minimum column width. This improves responsiveness and readability.How?
This PR implements the feature in three areas:
1. Typography Panel UI
Added a new
NumberControllabeled Column minimum width in:packages/block-editor/src/components/global-styles/typography-panel.jsThe value is stored in:
typography.textColumnMinWidth2. Style Engine
Added a new style generator mapping:
typography.textColumnMinWidth → column-widthin:
packages/style-engine/src/styles/typography/index.ts3. Type Definitions
Added the new property to the typography style interface:
textColumnMinWidth?: CSSProperties['columnWidth']in:
packages/style-engine/src/types.tsTesting Instructions
column-widthproperty and the layout updates accordingly.Testing Instructions for Keyboard