close
Skip to content

Add Text Alignment support for Button Block#70181

Closed
Rishit30G wants to merge 1 commit intoWordPress:trunkfrom
Rishit30G:fix/button-text-align-support
Closed

Add Text Alignment support for Button Block#70181
Rishit30G wants to merge 1 commit intoWordPress:trunkfrom
Rishit30G:fix/button-text-align-support

Conversation

@Rishit30G
Copy link
Contributor

What ?

Closes core/button for #60763

How ?

This PR adds the updated text alignment support in block.json for button block and moves away from the older textAlignment way which required code changes in edit.js as well

Testing Instructions

  1. Add a new post
  2. Insert a button block
  3. Notice it has text alignment options

Screenshots or screencast

Screen.Recording.2025-05-22.at.10.29.00.AM.mov

@github-actions
Copy link

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 props-bot label.

If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.

Co-authored-by: Rishit30G <rishit30g@git.wordpress.org>

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

@Rishit30G Rishit30G changed the title Add textAlign support for Button Block Add Text Alignment support for Button Block May 22, 2025
Copy link
Contributor

@t-hamano t-hamano left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR!

Unfortunately, we are currently unable to move forward with #60763 because text alignment support cannot be overridden on block instances. See the screenshot below:

.
image

As you can see, even though the block-level alignment should be centered, the global style default value (right) is respected.

To solve this, we need to move forward with #62260, but we haven't found an ideal approach yet.

For now, let's close this PR.

@t-hamano t-hamano added [Type] Enhancement A suggestion for improvement. [Package] Block library /packages/block-library labels May 22, 2025
@t-hamano t-hamano closed this May 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[Package] Block library /packages/block-library [Type] Enhancement A suggestion for improvement.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants