You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Consider adding support for content alignment on parent blocks #57346
[Block] ColumnsAffects the Columns Block[Block] GroupAffects the Group Block (and row, stack and grid variants)[Feature] Design ToolsTools that impact the appearance of blocks both to expand the number of tools and improve the experi[Type] EnhancementA suggestion for improvement.
I've noticed recently that a common use case is setting a unified content/text alignment on nested blocks. For example, centering all headings and paragraphs in a group block. Currently, the only way to do this is to set the text alignment on each block individually.
What is your proposed solution?
Allow blocks that are often used as parents (group, column) to set alignment that propagates to any nested blocks. This might need to cover both text alignment and justification settings, depending on the nested blocks, and depending on how many blocks we'd want this to affect.
Reacted by Rich Hawkins, Justin Tadlock and Benoît Chantre
@Mamaduka Thank you for your feedback. I have directly updated the block.json file, but I don't remember exactly what I did. This was the first time I used the wp-env environment and maybe I missed something during the Contributor Day, as I was also working on a patch for core.
I checked again today and can confirm this is working as expected with the same result as your screenshot 🎉
What are your thoughts on this issue? That seems to be a nice enhancement for the content editors.
Sorry for the late reply, @benoitchantre, I was on vacation.
What are your thoughts on this issue? That seems to be a nice enhancement for the content editors.
@t-hamano, worked on this feature. He might have more details on why it's not implemented in core for container blocks. Meanwhile, the snippet I shared can be used to enable the feature on the consumer side.
I don't have a strong opinion on whether to add text alignment support to container blocks. However, the problem is that text alignment cannot be overridden at the block instance level. This is why none of the core blocks support text alignment yet. See #62260 (comment) for more details.
To be more specific, if we add support for this to the Group block in the following way:
[Block] ColumnsAffects the Columns Block[Block] GroupAffects the Group Block (and row, stack and grid variants)[Feature] Design ToolsTools that impact the appearance of blocks both to expand the number of tools and improve the experi[Type] EnhancementA suggestion for improvement.
Activity
Marc-pi commentedon Dec 25, 2023
yep, frequent usage, i do confirm the need for whoever builds frequently his theme from the UI.
Nyiriland commentedon Apr 17, 2024
Came here to say I would also gladly use this feature.
benoitchantre commentedon Jun 5, 2025
@Mamaduka I have tried to add textAlign support to the group block. My expectation was to get the related control, but it didn't appear.
https://developer.wordpress.org/block-editor/reference-guides/block-api/block-supports/#typography-textalign
Mamaduka commentedon Jun 12, 2025
@benoitchantre, how are you modifying the
supportsarguments for the Group block? The following example works in my tests.Screenshot
benoitchantre commentedon Jun 12, 2025
@Mamaduka Thank you for your feedback. I have directly updated the block.json file, but I don't remember exactly what I did. This was the first time I used the wp-env environment and maybe I missed something during the Contributor Day, as I was also working on a patch for core.
I checked again today and can confirm this is working as expected with the same result as your screenshot 🎉
What are your thoughts on this issue? That seems to be a nice enhancement for the content editors.
Mamaduka commentedon Jun 24, 2025
Sorry for the late reply, @benoitchantre, I was on vacation.
@t-hamano, worked on this feature. He might have more details on why it's not implemented in core for container blocks. Meanwhile, the snippet I shared can be used to enable the feature on the consumer side.
t-hamano commentedon Jun 24, 2025
I don't have a strong opinion on whether to add text alignment support to container blocks. However, the problem is that text alignment cannot be overridden at the block instance level. This is why none of the core blocks support text alignment yet. See #62260 (comment) for more details.
To be more specific, if we add support for this to the Group block in the following way:
If we center text via the global styles and then left-justify text in a block instance, the style won't actually be prioritized.
f1e02f653e4dad3d00871679bde5857d.mp4
benoitchantre commentedon Jun 24, 2025
Thank you for your feedbacks and the additional information.