Overview
Avatar styling is concentrated in the root identity surface, with child parts inheriting its size and color context.
Public CSS Variables
JD
| Variable | Value | Affects |
|---|---|---|
Overall avatar dimensions.Avatar and child parts | No visible change in this state | |
Border-radius ratio.Avatar | No visible change in this state |
Part-Level Variables
Avatar: root size, color, and clipping surface.AvatarImage: image content clipped to the root.AvatarFallback: text fallback sized against the root.AvatarIcon: icon fallback aligned to the root size.
State And Variant Interaction
sizemaps directly to spacing tokens.variantchanges background and foreground treatment.- Fallback readability depends heavily on chosen size.
Examples
.roundedAvatar {
--avatar-br-ratio: 0.5;
}.compactAvatar {
--avatar-size: 20px;
}Do Not Override
- Do not allow fallback text to outgrow the chosen size.
- Do not remove clipping if images still depend on the root shape.
- Do not rely on color alone to distinguish variant meaning.