Skip to content

Avatar group/badge ring uses ring-bg, breaks on card and popover surfaces #524

Description

@mehdibha

Problem

The avatar overlap ring is hardcoded to the page background token: AvatarGroup children, AvatarGroupCount, and AvatarBadge all use ring-2 ring-bg (www/src/registry/ui/avatar/base.tsx). On any other surface — a card (bg-card), popover, sidebar — the ring renders as a visible page-colored halo instead of blending into the surface.

Hit on the landing Controls showcase card; worked around locally with *:data-avatar:ring-card / ring-card overrides.

Suggested fix

A ring-follows-surface mechanism instead of a fixed token, e.g. a --surface-bg CSS variable that surface components (card, popover, modal…) set and the avatar ring consumes (ring-(--surface-bg,var(--color-bg))). Fixes every nesting without per-usage overrides. Other ring-bg/outline-bg consumers in the registry likely have the same issue and could share the mechanism.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area: registryRegistry source and generated output (www/src/registry)bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions