Skip to content

fix: Improve ButterBar text contrast on banners#7684

Merged
talissoncosta merged 3 commits into
Flagsmith:mainfrom
mmaslov007:banner-pr
Jun 4, 2026
Merged

fix: Improve ButterBar text contrast on banners#7684
talissoncosta merged 3 commits into
Flagsmith:mainfrom
mmaslov007:banner-pr

Conversation

@AAshGray
Copy link
Copy Markdown
Contributor

@AAshGray AAshGray commented Jun 2, 2026

Thanks for submitting a PR! Please check the boxes below:

  • [ x ] I have read the Contributing Guide.
  • [ x ] I have added information to docs/ if required so people know about the feature.
  • [ x ] I have filled in the "Changes" section below.
  • [ x ] I have filled in the "How did you test this code" section below.

Contributes to #7604

Changes

  • Added Utils.getContrastColour(...) to frontend/common/utils/utils.tsx
  • Updated frontend/web/components/ButterBar.tsx to use Utils.getContrastColour(...) for environment banner text colour instead of hardcoding white

How did you test this code?

  • Ran the frontend locally
  • Used an environment with a custom banner_colour and banner text
  • Verified the banner text switched to black or white based on contrast

@vercel
Copy link
Copy Markdown

vercel Bot commented Jun 2, 2026

@AAshGray is attempting to deploy a commit to the Flagsmith Team on Vercel.

A member of the Team first needs to authorize it.

@github-actions github-actions Bot added the front-end Issue related to the React Front End Dashboard label Jun 2, 2026
@AAshGray AAshGray changed the title fix: update ButterBar text color based on banner background for better contrast Fix: update ButterBar text color based on banner background for better contrast Jun 2, 2026
@AAshGray AAshGray changed the title Fix: update ButterBar text color based on banner background for better contrast Fix(ui): improve ButterBar text contrast on banners Jun 2, 2026
@AAshGray AAshGray changed the title Fix(ui): improve ButterBar text contrast on banners fix: improve ButterBar text contrast on banners Jun 2, 2026
@AAshGray AAshGray changed the title fix: improve ButterBar text contrast on banners fix: Improve ButterBar text contrast on banners Jun 2, 2026
@AAshGray AAshGray marked this pull request as ready for review June 2, 2026 17:56
@AAshGray AAshGray requested a review from a team as a code owner June 2, 2026 17:56
@AAshGray AAshGray requested review from talissoncosta and removed request for a team June 2, 2026 17:56
@vercel
Copy link
Copy Markdown

vercel Bot commented Jun 4, 2026

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

Project Deployment Actions Updated (UTC)
flagsmith-frontend-preview Ready Ready Preview, Comment Jun 4, 2026 5:14pm
flagsmith-frontend-staging Ready Ready Preview, Comment Jun 4, 2026 5:14pm
1 Skipped Deployment
Project Deployment Actions Updated (UTC)
docs Ignored Ignored Preview Jun 4, 2026 5:14pm

Request Review

Copy link
Copy Markdown
Contributor

@talissoncosta talissoncosta 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 contribution! 🙏 Solid fix, reusable helper, WCAG luminance, the right 0.179 threshold, nicely scoped. The two notes above are minor and non-blocking. Looking forward to merging once they're sorted. 🎉

Comment thread frontend/common/utils/utils.tsx
Comment thread frontend/web/components/ButterBar.tsx Outdated
@AAshGray
Copy link
Copy Markdown
Contributor Author

AAshGray commented Jun 4, 2026

Thanks for the clear explanations, let me know if there's anything else! 😄

Comment thread frontend/web/components/ButterBar.tsx Outdated
Copy link
Copy Markdown
Contributor

@talissoncosta talissoncosta left a comment

Choose a reason for hiding this comment

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

Looks great! thanks for your contribution. 😃

@talissoncosta talissoncosta merged commit cf0d7b0 into Flagsmith:main Jun 4, 2026
21 of 22 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

front-end Issue related to the React Front End Dashboard

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants