Skip to content

fix(#4421): add non-color indicator to current breadcrumb item - #4605

Merged
cixzhang merged 1 commit into
meta:mainfrom
gonzoblasco:fix/breadcrumb-use-of-color
Aug 24, 2026
Merged

cixzhang merged 1 commit into
meta:mainfrom
gonzoblasco:fix/breadcrumb-use-of-color

Conversation

@gonzoblasco

Copy link
Copy Markdown
Contributor

What

Fixes #4421 — the current page breadcrumb item relied solely on color (--color-text-primary vs --color-text-secondary) to distinguish it from links, failing WCAG 2.1 SC 1.4.1 (Use of Color).

Changes

Added --font-weight-semibold (600) to the current item's style so it is visually distinguishable by weight in addition to color. The aria-current="page" attribute was already present for screen readers.

Validation

  • pnpm test -- --run packages/core/src/Breadcrumbs/Breadcrumbs.test.tsx: 25/25 tests pass
  • pnpm lint: clean
  • pnpm check:sync: clean
  • pnpm check:package-boundaries: clean

Fixes #4421

@vercel

vercel Bot commented Jul 31, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
astryx Error Error Aug 22, 2026 8:07pm

Request Review

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Meta Open Source bot. label Jul 31, 2026
@github-actions github-actions Bot added community Authored by a community contributor (not on the eng/design team) needs:code-review High-risk change (new package/component/API) — needs human code review before merge needs:design-review Affects visuals — Design should review labels Jul 31, 2026
cixzhang added a commit that referenced this pull request Aug 22, 2026
…nly current state

Review of #5332 found four defects in the audit's own work.

The RTL separator "fix" was a double flip. U+203A has Unicode
Bidi_Mirrored=Yes, so Chromium already mirrors it under RTL and
rtlStyles.mirror flipped it back to pointing the wrong way. The mirror now
applies only where the glyph is not bidi-mirrored: the arrow in the block
template keeps it, the angle-quote chevron in the template and the story does
not, and an Icon separator keeps it because an SVG is never bidi-mirrored.

The supporting variant's current crumb goes back to --color-text-secondary.
Distinguishing the current item by colour alone is the defect in issue #4421,
not the remedy, and #4605 fixes it properly with a non-colour indicator.

pngjs was a dependency of the audit harness, not of the repo, so it leaves
package.json and the lockfile; the harness runs from outside the tree.

Night Watch - Component Auditor
cixzhang added a commit that referenced this pull request Aug 22, 2026
…RTL separator guidance (#5332)

* fix(breadcrumbs): hit target, theme targets, focus ring and the supporting current state

Findings from the nightly component audit, all measured in Chromium against a
locally built Storybook.

A10: the menu-trigger and onClick-only crumbs rendered a 20px-tall button next
to 28px links, under the 24px WCAG 2.5.8 floor and 8px out of vertical
alignment inside the same trail. buttonReset applied a blanket `padding: 0`
after `link` set paddingBlock, so the block padding was wiped along with the
inline padding it was there to reset. Now paddingInline only.

T12: `breadcrumb-item-menu-trigger` is documented as a theme target but never
reached the DOM. A sibling stylex.props() spread replaced the className that
themeProps() built, so a theme rule for that target matched nothing. Merged
through mergeProps, which is what the rule asks for. The className-clobber lint
rule does not see this shape because both sides are JSX spreads rather than a
literal className attribute.

T6: `variant` selects between style objects on breadcrumb-item and on the menu
trigger, and neither themeProps() call carried it, so .astryx-breadcrumb-item
rendered with no data attribute at all and a theme could not target the
supporting crumb. Both targets now reflect it, and the docs list it under
visualProps.

A15: the link, the onClick button and the menu trigger fell through to the
browser default focus ring instead of the shared focusOutlineProps.focusVisible
that Link uses, so a theme's focus accent never reached a breadcrumb.

B8: with variant="supporting" the current crumb was pixel-identical to a link,
because supportingCurrent and supportingLink both resolved to
--color-text-secondary. It now takes --color-text-primary, matching how the
default variant separates the two.

I10: the shipped custom-separator block recommends a chevron and an arrow, and
neither mirrored under RTL, so a directional separator pointed against the
reading direction. Both now carry rtlStyles.mirror, and the docs say to do that.

Also: stories for a disabled menu item (the A20 and A21 sweeps saw zero
disabled elements on this component before it), a long label in a narrow
container, a single-item trail, and the mirrored icon separator; menu and
menuSize added to the sub-component prop list in Breadcrumbs.doc.mjs, which had
drifted from BreadcrumbItem.doc.mjs; and the APG patterns named in the docs.

Night Watch - Component Auditor

* fix(breadcrumbs): mirror the chevron in the custom-separator story

The story taught the same unmirrored directional glyph the block did. Measured
in Chromium: the separator now resolves to matrix(-1, 0, 0, 1, 0, 0) under
dir="rtl" and to none in LTR.

Night Watch - Component Auditor

* fix(breadcrumbs): correct the RTL separator advice, drop the colour-only current state

Review of #5332 found four defects in the audit's own work.

The RTL separator "fix" was a double flip. U+203A has Unicode
Bidi_Mirrored=Yes, so Chromium already mirrors it under RTL and
rtlStyles.mirror flipped it back to pointing the wrong way. The mirror now
applies only where the glyph is not bidi-mirrored: the arrow in the block
template keeps it, the angle-quote chevron in the template and the story does
not, and an Icon separator keeps it because an SVG is never bidi-mirrored.

The supporting variant's current crumb goes back to --color-text-secondary.
Distinguishing the current item by colour alone is the defect in issue #4421,
not the remedy, and #4605 fixes it properly with a non-colour indicator.

pngjs was a dependency of the audit harness, not of the repo, so it leaves
package.json and the lockfile; the harness runs from outside the tree.

Night Watch - Component Auditor
@gonzoblasco
gonzoblasco force-pushed the fix/breadcrumb-use-of-color branch from 0ba84e7 to 5edc039 Compare August 22, 2026 20:05
@gonzoblasco
gonzoblasco force-pushed the fix/breadcrumb-use-of-color branch from 5edc039 to 55541c6 Compare August 22, 2026 20:06
@gonzoblasco

Copy link
Copy Markdown
Contributor Author

Rebased + scope cleaned. This PR now contains only the fix for #4421.

Context on the scope change: the branch previously carried commits from the color-contrast work (#3654, which lives in its own open PR #4022). That was my mistake - unrelated changes leaked into this PR. I've rebased fix/breadcrumb-use-of-color onto current main so it now contains exactly one change: the non-color current-page indicator on BreadcrumbItem.

On the fix itself: the Breadcrumbs audit (#5332) identified the same issue as open finding B8 and explicitly deferred it to this PR (and to #4421), rather than landing a colour-only change that would conflict with this fix:

"Making the supporting variant's current crumb --color-text-primary distinguishes the current item by colour alone. That is precisely #4421 ... and #4605 by @gonzoblasco has been open since 31 July fixing it properly with a non-colour indicator (semibold weight on the shared current style, which covers both variants) on the same style object."

The fix lands font-weight: var(--font-weight-semibold) on the shared current style, which covers both the default and supporting variants, in addition to the existing aria-current="page". I rebased onto the post-audit main and re-verified the merge is clean.

  • pnpm test -- --run packages/core/src/Breadcrumbs/Breadcrumbs.test.tsx: 25/25 pass
  • pnpm lint: clean

Ready for review. Thanks.

@github-actions

Copy link
Copy Markdown
Contributor

PR Analysis Report

📚 Storybook Preview

View Storybook for this PR
GitHub Pages may take up to a minute to hydrate after deploy.

🧪 Sandbox Preview

View Sandbox for this PR
GitHub Pages may take up to a minute to hydrate after deploy.

Modified Components

Breadcrumbs (@astryxdesign/core) · View in Storybook
Metric Before After Delta
Bundle Size (ESM) N/A N/A N/A
Lines of Code N/A 623 -
Complexity N/A Very High (48) -

Bundle Size Summary

Package Size (ESM) Size (CJS) Gzipped
@astryxdesign/core N/A 4.8KB 1.2KB

Accessibility Audit

Status: No accessibility violations detected.


Generated by PR Enrichment workflow | Storybook | Sandbox | View full report

@cixzhang cixzhang left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks, this is the fix the Breadcrumbs audit pointed at — the supporting variant now reads as current without colour. Nit: semibold runs ~4px wider, so long labels wrap sooner.

[Reviewed by Robohands]

github-actions Bot added a commit that referenced this pull request Aug 23, 2026
@github-actions github-actions Bot removed the needs:code-review High-risk change (new package/component/API) — needs human code review before merge label Aug 23, 2026
@cixzhang
cixzhang enabled auto-merge (squash) August 24, 2026 00:48
@cixzhang
cixzhang merged commit b89b3f0 into meta:main Aug 24, 2026
20 of 21 checks passed
@gonzoblasco
gonzoblasco deleted the fix/breadcrumb-use-of-color branch August 24, 2026 00:55
cixzhang added a commit that referenced this pull request Aug 24, 2026
- add the PR reference to all 45 pending changesets, in prose rather than
  on the handle line (a bare @handle line is what check-changesets requires)
- credit @rubyycheung, not @RubyCheung, for the Dialog responsive work in
  #5352; those are two different real GitHub accounts
- add two missing changesets for merged work that changes published
  behaviour: #4605 (Breadcrumbs current-item weight) and #5259 (CLI unified
  search includes integration components)
cixzhang added a commit that referenced this pull request Aug 24, 2026
- add the PR reference to all 45 pending changesets, in prose rather than
  on the handle line (a bare @handle line is what check-changesets requires)
- credit @rubyycheung, not @RubyCheung, for the Dialog responsive work in
  #5352; those are two different real GitHub accounts
- add two missing changesets for merged work that changes published
  behaviour: #4605 (Breadcrumbs current-item weight) and #5259 (CLI unified
  search includes integration components)
cixzhang added a commit that referenced this pull request Aug 24, 2026
* docs: consolidate + credit changesets for v0.5.0

- add the PR reference to all 45 pending changesets, in prose rather than
  on the handle line (a bare @handle line is what check-changesets requires)
- credit @rubyycheung, not @RubyCheung, for the Dialog responsive work in
  #5352; those are two different real GitHub accounts
- add two missing changesets for merged work that changes published
  behaviour: #4605 (Breadcrumbs current-item weight) and #5259 (CLI unified
  search includes integration components)

* docs: add the PR reference to the PowerSearch operator-menu changeset

#5242 landed while this PR was open.

* docs: add the PR reference to the merged-refs stability changeset

#5429 landed while this PR was open.

This branch had an error being deployed

1 failed deployment
Preview — 55541c69 Deployed Aug 22, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Meta Open Source bot. community Authored by a community contributor (not on the eng/design team) needs:design-review Affects visuals — Design should review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] WCAG 2.1 A 1.4.1 fail - use of colour failure, accessibility - Breadcrumb Item

2 participants