feat(button): add a warning variant, and text and button warning tokens - #129
Merged
Conversation
Buttons could say "destructive" but not "pause and read this". `danger` was the only cautionary variant, so reversible actions either borrowed red and overstated themselves, or went unmarked. `Button/Warning` mirrors `Button/Danger` — Fill at Yellow 500/400, Border at Yellow 600/500 — with one deliberate break: its text is black, not white. Yellow is far lighter than red, so white on Yellow 500 measures 2.43:1 and on Yellow 400 just 1.99:1, under the 3:1 threshold for UI text. Black reads 8.65:1 and 10.54:1. Darkening the fill to Yellow 600 would let white clear 4:1, but #A27630 is a brown-olive that stops reading as caution, so the asymmetry sits in the text rather than the fill. It is the only filled variant with dark text, and the docs say why. `Text/Warning` needs no such compromise and mirrors `Text/Danger` exactly, at Yellow 500/400. Rendered in both themes and read back from the DOM: dark is a #DCB169 fill with a #D39D39 border, light is #D39D39 with #A27630, black text in both. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
- Change button text colour to white for consistency as it meets APCA standards
Shrinks99
approved these changes
Sep 3, 2026
Shrinks99
left a comment
Member
There was a problem hiding this comment.
Made a few edits to the colours for the buttons so we don't have to invert the text. Will be changing these soon anyways with the new styling hopefully!
Also added the warning variant to dropdown-menu items
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.
Summary
Buttons could say destructive but not pause and read this.
dangerwas the only cautionary variant, so reversible actions either borrowed red and overstated themselves, or went unmarked. Archiving is the case that surfaced it — it can be undone, so red is wrong, but it still wants a beat of hesitation.Fills the two gaps: a
warningButton variant, and thetext-warningtoken thattext-dangerhas had all along.Tokens
button-warning-fill#D39D39#DCB169button-warning-border#A27630#D39D39button-warning-texttext-warning#D39D39#DCB169Fill and border mirror
Button/Danger's Red 500/400 and Red 600/500 exactly.Text/WarningmirrorsText/Danger.The one deliberate break: dark text
Button/Dangergets white text because red is dark enough to carry it. Yellow is not:#BC3934(danger, light)#CF6A60(danger, dark)#D39D39#DCB169#A27630White on yellow misses even the 3:1 threshold for UI text. Darkening the fill to Yellow 600 would let white clear 4:1, but
#A27630is a brown-olive that stops reading as caution — so the asymmetry sits in the text rather than the fill.It is the only filled variant with dark text. The docs page says so, and the CSS carries a one-line comment, so the next person doesn't "fix" it back to white.
Not included
No
archivedvariant. Under the rule that variants communicate how the user should pay attention to a thing, archived isn't its own attention level — it'swarningwhere the consequence matters in context, and neutral grey where it doesn't. This supersedes #128, which added anarchivedBadge variant and abrand-orangetoken; that PR is closed in favour of this one.Testing
pnpm buildpasses. Rendered the variant in the demo site in both themes and read the computed values back from the DOM rather than trusting the token pipeline:color(display-p3 0.863 0.6958 0.4108), border0.8263 0.6154 0.2247, text0 0 00.8263 0.6154 0.2247, border0.6345 0.463 0.1863, text0 0 0pnpm lintfails onpackages/demo/src/components/demo/avatar.tsxand two gitignoreddist/files, identically with these changes stashed — pre-existing, untouched here.Note
The tokens were hand-authored in
equality-tokens.pinwheeland the exported JSON together, mirroring theDangerentries alias for alias, rather than round-tripped through Pinwheel. Worth opening the project once to confirmButton/WarningandText/Warningappear where you'd expect before merging.🤖 Generated with Claude Code