Skip to content

feat(Alert): cascade color to inner Avatar#29

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

feat(Alert): cascade color to inner Avatar#29
IgorShevchik wants to merge 1 commit into
mainfrom
feat/alert-avatar-color

Conversation

@IgorShevchik
Copy link
Copy Markdown
Collaborator

Summary

  • The existing top-level color prop on B24Alert now also tints the inner B24Avatar by default.
  • Explicit avatar.color still wins, since v-bind="props.avatar" is applied after :color="props.color".
  • Alert.variants.color is a superset of AvatarProps['color'] (it includes legacy entries like 'default'), 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 color), #28 (ChatMessage color).

Test plan

  • pnpm run lint passes
  • pnpm run typecheck passes (root + docs + both playgrounds)
  • pnpm run test passes — new renders with color and avatar correctly snapshot witnesses the cascade (style-filled-success on the Avatar root when Alert is air-primary-success)
  • Open the docs page → Alert → Color section, the second example renders a tinted avatar
  • Verify explicit avatar.color overrides the cascade (set :avatar="{ src: '...', color: 'air-tertiary-accent' }" while color="air-primary-alert" on B24Alert — avatar should be tertiary-accent)

🤖 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"`.

`Alert.variants.color` is a superset of `AvatarProps['color']` (legacy
`'default'` etc.), 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/alert-avatar-color branch from c13b748 to d2502cf 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