fix(web): stop the brand gradient bleeding through button variants - #202
Merged
Conversation
The base `button` rule paints `--gradient-brand` with the `background` shorthand, which sets background-image. Every variant tried to override it with the `background-color` longhand, which cannot clear an image, so the gradient kept rendering on top of the fill each variant asked for. .btn-ghost was the worst case: transparent background, `--color-primary` label, so it rendered the brand color on the brand gradient at 1.00:1 and the label was invisible. The Refresh button on Today's Visits is one of 29 such buttons. .btn-secondary sat at 2.36:1, and .btn-primary/.btn-danger showed the gradient rather than their own fill. <Link className="btn-ghost"> was unaffected, since the `button` element selector does not match an anchor, which is why the breakage looked arbitrary from the outside. Convert every variant to the `background` shorthand, reset the inherited brand glow on the variants that are not brand-filled, and take the labels from --color-on-brand instead of a hardcoded white. Same fix for the six inline `backgroundColor: 'transparent'` buttons, which leak identically.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This was referenced Aug 18, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The Refresh button on Today's Visits had no visible label. It was not missing — it was teal text on a teal background at 1.00:1.
buttonpaints--gradient-brandwith thebackgroundshorthand, which setsbackground-image. Every variant tried to override it with thebackground-colorlonghand, which cannot clear an image, so the gradient kept rendering on top of the fill each variant asked for..btn-ghost(29 sites)#107480on the leaked gradient — 1.00:1.btn-secondary(10 sites)#0F172Aon the leaked gradient — 2.36:1.btn-primary.btn-danger<Link className="btn-ghost">was unaffected, since thebuttonelement selector does not match an anchor — which is why the breakage looked arbitrary from the outside.Introduced in 56421d8, which changed the base rule from
background-colorto thebackgroundshorthand without converting the variants.What changed
backgroundshorthand, which resets the image layer..btn-primary/.btn-dangerlabels take--color-on-brandinstead of a hardcodedwhite.backgroundColor: 'transparent'buttons leak identically and get the same treatment.Review note
This changes the rendered background of ~106 buttons. That is the correction, not a regression —
.btn-primaryhas never actually rendered flat teal and.btn-secondaryhas never rendered white — but it is a visible delta worth a look.First of five. Merge order: this →
fix/color-mix-tints→feat/agency-theme-resolver→fix/contrast-offenders→chore/css-contract-guards.