Skip to content

Breadcrumbs block: Hide separator from screen readers#78524

Merged
talldan merged 1 commit into
WordPress:trunkfrom
SteveJonesDev:fix/breadcrumbs-separator-accessibility
May 22, 2026
Merged

Breadcrumbs block: Hide separator from screen readers#78524
talldan merged 1 commit into
WordPress:trunkfrom
SteveJonesDev:fix/breadcrumbs-separator-accessibility

Conversation

@SteveJonesDev
Copy link
Copy Markdown
Contributor

What?

Closes #78523

Adds CSS content alt text syntax to the breadcrumbs block separator so screen readers treat it as presentational and do not announce it.

Why?

The breadcrumbs block uses a CSS pseudo-element to render the separator character between items:

content: var(--separator, "/");

The CSS content property supports an alt text syntax, content: value / "", where an empty string after the slash instructs assistive technologies to skip the generated content entirely. Without this, screen readers such as VoiceOver and NVDA announce the separator character (e.g. "slash") between every breadcrumb item, adding noise that is not useful to the user.

How?

Single line change in packages/block-library/src/breadcrumbs/style.scss:

- content: var(--separator, "/");
+ content: var(--separator, "/") / "";

Testing Instructions

  1. Add the Breadcrumbs block to a header template part in the Site Editor
  2. Navigate to a page with a breadcrumb trail on the front end
  3. Enable a screen reader (VoiceOver on macOS: Cmd+F5, NVDA on Windows)
  4. Navigate through the breadcrumb items
  5. Confirm the separator character is no longer announced between items
  6. Confirm the breadcrumb link text is still announced correctly

Testing Instructions for Keyboard

  1. Tab through the breadcrumb links on the front end
  2. Confirm focus order is correct and each link is reachable
  3. Confirm no unexpected announcements occur between items

Screenshots or screencast

Before After
Screenshot 2026-05-21 at 3 46 23 PM 2026-05-21 15 56 15

Use of AI Tools

Claude (Anthropic) was used to assist in drafting the PR description.
The code change was authored and reviewed by the contributor.

@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 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.

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: SteveJonesDev <[email protected]>
Co-authored-by: talldan <[email protected]>
Co-authored-by: pattonwebz <[email protected]>

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 May 21, 2026
@pattonwebz
Copy link
Copy Markdown
Member

I have used this exact pattern when building my own breadcrumbs recently and can confirm that screen readers will skip over without reading the separator with this style rule pattern.

@talldan talldan added [Block] Breadcrumbs Affects the Breadcrumbs Block [Type] Bug An existing feature does not function as intended [Package] A11y /packages/a11y labels May 22, 2026
Copy link
Copy Markdown
Contributor

@talldan talldan left a comment

Choose a reason for hiding this comment

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

This fixes the issue in testing for me. Thanks for the contribution!

@talldan talldan added the props-bot Manually triggers Props Bot to ensure the list of props is up to date. label May 22, 2026
@github-actions github-actions Bot removed the props-bot Manually triggers Props Bot to ensure the list of props is up to date. label May 22, 2026
@talldan talldan merged commit 9a4affc into WordPress:trunk May 22, 2026
57 of 59 checks passed
@github-actions github-actions Bot added this to the Gutenberg 23.3 milestone May 22, 2026
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] A11y /packages/a11y [Package] Block library /packages/block-library [Type] Bug An existing feature does not function as intended

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Breadcrumbs block: CSS separator character announced by screen readers

3 participants