Skip to content

fix(fuselage): improve ghost badge contrast - #2144

Open
ivans-netto wants to merge 1 commit into
mainfrom
fix/ghost-badge-contrast
Open

fix(fuselage): improve ghost badge contrast#2144
ivans-netto wants to merge 1 commit into
mainfrom
fix/ghost-badge-contrast

Conversation

@ivans-netto

@ivans-netto ivans-netto commented Aug 6, 2026

Copy link
Copy Markdown

Summary

The ghost badge variant used pure-white text over stroke-dark, which had two problems:

  • Light theme: stroke-dark (#6C737A) is the same color as badge-level-1, so ghost was visually identical to secondary, and the white text sat at a borderline ~4.8:1 contrast.
  • Dark theme: stroke-dark resolves to #9EA2A8, dropping white text to ~2.5:1 — failing WCAG AA.

It now uses font-titles-labels over badge-background-level-0 (the previously unused neutral badge token, already paired with a dark font by the message highlight styles):

Theme Colors Contrast
Light #1F2329 on #E4E7EA ~13:1
Dark #F2F3F5 on #404754 ~8:1
High contrast #1F2329 on #E4E7EA ~13:1

All meet WCAG AA (4.5:1) for the badge's micro font size, and ghost is now visually distinct from secondary.

Before / After

Before

ghost badge before: identical to secondary in the light theme, 2.5:1 contrast in the dark theme

After

ghost badge after: distinct from secondary, ~13:1 contrast in the light theme and ~8:1 in the dark theme

Storybook

  • Adds a Ghost story (there was none) with a smoke test.
  • Reworks WithValue to show every badge variant with its value and a label with the variant name.

Testing

  • yarn jest Badge.spec — 12/12 passing
  • Full visual regression suite — 506/506 passing; new golden for Ghost, regenerated golden for WithValue, no other goldens changed
  • Changeset included (patch)

🤖 Generated with Claude Code

The ghost badge used pure-white text over stroke-dark, which made it
identical to the secondary variant in the light theme and unreadable
(~2.5:1) in the dark theme. It now uses font-titles-labels over
badge-background-level-0, meeting WCAG AA in all themes.

Also adds a Ghost story and reworks the WithValue story to show every
badge variant labeled with its name.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@changeset-bot

changeset-bot Bot commented Aug 6, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 4ed21b3

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@rocket.chat/fuselage Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant