Skip to content

Breadcrumbs block: CSS separator character announced by screen readers #78523

@SteveJonesDev

Description

@SteveJonesDev

Description

The breadcrumbs block stylesheet uses CSS generated content to render the separator character between items:

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

This causes screen readers to announce the separator character (e.g. "slash") between each breadcrumb item, adding unnecessary noise for assistive technology users.

The CSS content property supports an alt text syntax where an empty string after a forward slash instructs screen readers to treat the generated content as presentational:

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

Expected: Screen readers skip the separator character and announce only the breadcrumb link text.
Current: Screen readers announce the separator character between each breadcrumb item.

Step-by-step reproduction instructions

  1. Add the Breadcrumbs block to a template part (e.g. header)
  2. View a page with a breadcrumb trail on the front end
  3. Navigate with a screen reader (e.g. VoiceOver or NVDA)
  4. Observe that the separator character is announced between items

Screenshots, screen recording, code snippet

Image

Environment info

Gutenberg 23.x (WordPress 7.0)
File: packages/block-library/src/breadcrumbs/style.scss

Please confirm that you have searched existing issues in the repo.

  • Yes

Please confirm that you have tested with all plugins deactivated except Gutenberg.

  • Yes

Please confirm which theme type you used for testing.

  • Block
  • Classic
  • Hybrid (e.g. classic with theme.json)
  • Not sure

Metadata

Metadata

Assignees

Labels

[Block] BreadcrumbsAffects the Breadcrumbs Block[Status] In ProgressTracking issues with work in progress[Type] BugAn existing feature does not function as intended

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions