Skip to content

Add text align controls to breadcrumbs#76747

Open
n2erjo00 wants to merge 1 commit intoWordPress:trunkfrom
n2erjo00:add-typographty-text-align-control-to-breadcrumbs
Open

Add text align controls to breadcrumbs#76747
n2erjo00 wants to merge 1 commit intoWordPress:trunkfrom
n2erjo00:add-typographty-text-align-control-to-breadcrumbs

Conversation

@n2erjo00
Copy link
Copy Markdown
Contributor

What?

Closes #76739

This PR add text align controls breadcrumbs block.

Why?

Breadcrumbs benefit from text align support

How?

Added typography.textAlign support block and wrote couple lines of CSS to create the support.

Testing Instructions

  1. Open page or post
  2. Add "Breadcrumbs" block
  3. See the text align control block toolbar

Testing Instructions for Keyboard

Screenshots or screencast

Screenshot 2026-03-21 at 19 16 56
Before After

Use of AI Tools

@github-actions
Copy link
Copy Markdown

github-actions bot commented Mar 21, 2026

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.

Unlinked Accounts

The following contributors have not linked their GitHub and WordPress.org accounts: @jonashellwig.

Contributors, please read how to link your accounts to ensure your work is properly credited in WordPress releases.

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

Unlinked contributors: jonashellwig.

Co-authored-by: n2erjo00 <n2erjo00@git.wordpress.org>
Co-authored-by: t-hamano <wildworks@git.wordpress.org>
Co-authored-by: ntsekouras <ntsekouras@git.wordpress.org>

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

@github-actions github-actions bot added the [Package] Block library /packages/block-library label Mar 21, 2026
@t-hamano t-hamano added [Type] Enhancement A suggestion for improvement. [Block] Breadcrumbs Affects the Breadcrumbs Block labels Mar 23, 2026
Copy link
Copy Markdown
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!

The textAlign block support is intended to apply the text-align CSS property, so using justify-content instead seems a bit odd to me.

I'm curious why this block uses the flex layout in the first place.

In my testing, just using the default layout works well for me.

diff --git a/packages/block-library/src/breadcrumbs/block.json b/packages/block-library/src/breadcrumbs/block.json
index 597e36c41ae..acbc77e19a9 100644
--- a/packages/block-library/src/breadcrumbs/block.json
+++ b/packages/block-library/src/breadcrumbs/block.json
@@ -68,7 +68,8 @@
                        "__experimentalLetterSpacing": true,
                        "__experimentalDefaultControls": {
                                "fontSize": true
-                       }
+                       },
+                       "textAlign": true
                },
                "interactivity": {
                        "clientNavigation": true
diff --git a/packages/block-library/src/breadcrumbs/style.scss b/packages/block-library/src/breadcrumbs/style.scss
index 7111f1130bb..081e64e3db5 100644
--- a/packages/block-library/src/breadcrumbs/style.scss
+++ b/packages/block-library/src/breadcrumbs/style.scss
@@ -6,15 +6,12 @@
                list-style: none;
                margin: 0;
                padding: 0;
-               display: flex;
-               flex-wrap: wrap;
-               align-items: center;
        }
 
        li {
                margin: 0;
                padding: 0;
-               display: flex;
+               display: inline-flex;
                align-items: center;
 
                &:not(:last-child)::after {

cc @ntsekouras

@n2erjo00
Copy link
Copy Markdown
Contributor Author

Putting some my own thoughts here. From technical standpoint it is not text alignment so from that point of view it is maybe bit "hacky" but from user standpoint it is setting text alignment so based on this I decided to use textAlign control (familiar icon and familiar workflow for users) @t-hamano

But lets see what @ntsekouras has on his mind and then lets hussle 😸

@ntsekouras
Copy link
Copy Markdown
Contributor

Thanks for the PR! I commented on the issue and I think it should be closed.

That said, textAlign shouldn't be used to do something different than it's supposed to ( like justify-content here). If we needed control over justify-content we should consider layout.support.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[Block] Breadcrumbs Affects the Breadcrumbs Block [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.

Breadcrumbs block: Add option to center items

3 participants