Skip to content

feat(Toast): cascade color to inner Avatar#30

Open
IgorShevchik wants to merge 1 commit into
mainfrom
feat/toast-avatar-color
Open

feat(Toast): cascade color to inner Avatar#30
IgorShevchik wants to merge 1 commit into
mainfrom
feat/toast-avatar-color

Conversation

@IgorShevchik
Copy link
Copy Markdown
Collaborator

Summary

  • The existing top-level color prop on B24Toast now also tints the inner B24Avatar by default.
  • Explicit avatar.color still wins, since v-bind="props.avatar" is applied after :color="props.color".
  • The progress-bar already cascades Toast color; this PR closes the loop for the Avatar slot.
  • Toast.variants.color is a superset of AvatarProps['color'], so the binding casts to the Avatar color type at the template site — no API change, no theme change.

Follow-up to #24 (Avatar/AvatarGroup color), #27 (User), #28 (ChatMessage), #29 (Alert).

Test plan

  • pnpm run lint passes
  • pnpm run typecheck passes
  • pnpm run test passes — new renders with color and avatar correctly snapshot witnesses the cascade
  • Verify in app: a toast with color: 'air-primary-success' and an avatar now renders a success-tinted avatar
  • Verify explicit avatar.color overrides the cascade

🤖 Generated with Claude Code

The existing top-level `color` prop now also tints the inner `B24Avatar`
by default. An explicit `avatar.color` still wins, since
`v-bind="props.avatar"` is applied after `:color="props.color"`. The
progress-bar already inherited Toast `color`; this closes the loop for
the Avatar slot. `Toast.variants.color` is a superset of
`AvatarProps['color']`, so the binding casts to the Avatar color type at
the template site.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@IgorShevchik IgorShevchik force-pushed the feat/toast-avatar-color branch from c296d88 to 4d63bf0 Compare May 13, 2026 07:06
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