Skip to content

Ring primary and tint secondary actions inside toasts - #729

Merged
czarandy merged 1 commit into
mainfrom
toast-action-styles
Oct 15, 2026
Merged

czarandy merged 1 commit into
mainfrom
toast-action-styles

Conversation

@czarandy

Copy link
Copy Markdown
Owner

Problem

  • A primary action inside a toast became ghost text and looked like plain copy.
  • A secondary action kept the app's neutral gray chip, which was never picked to sit on a status fill.
  • An outline action was invisible. Its label and border take their colour from --silver-button-primary-bg, which a toast sets to transparent.

Change

Every toast action now follows the toast's text colour via currentColor: white on the dark fills, dark on warning, with no per-type values. Importance is shown by treatment, not by a fill colour:

Action Treatment
primary / outline 60% currentColor ring, 15% tint on hover
secondary 15% currentColor tint (22% on hover, 28% when pressed)
dismiss ✕ ghost (unchanged)

To make this possible, Button gains hooks a surface can set:

  • --silver-button-primary-border: drawn as an inset box-shadow so the button's size is unchanged. It defaults to transparent, so primary buttons elsewhere look exactly as before.
  • --silver-button-outline-fg / -border / -bg-hover / -bg-active: each falls back to the previous value.

Inside a toast, outline renders the same as primary. The only difference is that its real 1px border makes it 2px wider.

Stories

  • New: Toast / With Primary And Secondary Actions and Toast / With Outline Action.
  • Updated: the With Primary Action docs.

Tests

  • Toast tests cover the primary ring, the secondary tint and the outline vars.
  • Button tests check that the primary ring defaults to transparent and that outline falls back to the primary colour.
  • The full suite, typecheck and lint pass.

🤖 Generated with Claude Code

A primary action inside a toast collapsed to ghost text and read as plain
copy, while a secondary action kept the app's gray chip, which was never
picked against a status fill. An outline action rendered invisibly, since it
takes its colour from the primary background a toast sets to transparent.

All three now follow the toast's text colour via currentColor. Primary and
outline get a 60% ring, secondary a soft 15% tint one step below it, and the
dismiss button stays ghost.

Button gains two hooks a surface can set: --silver-button-primary-border
(drawn as an inset shadow so the box is unchanged, transparent by default)
and --silver-button-outline-{fg,border,bg-hover,bg-active}.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@vercel

vercel Bot commented Oct 15, 2026 •

Copy link
Copy Markdown

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

Project Deployment Actions Updated
silver-ui-site Ready Ready Preview Oct 15, 2026 10:17pm UTC
1 Skipped Deployment
Project Deployment Actions Updated
silver-ui Ignored Ignored Preview Oct 15, 2026 10:17pm UTC

@czarandy
czarandy merged commit b93ae9d into main Oct 15, 2026
4 checks passed
@czarandy
czarandy deleted the toast-action-styles branch October 15, 2026 22:17

This branch was successfully deployed

1 active deployment
Preview – silver-ui-site — 653d2835 Deployed Oct 15, 2026 by vercel[bot]
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