User avatar — accessibility
Keyboard
- Not focusable and not interactive. In the account menu or a picker the host button is the control.
ARIA
- The face is
aria-hidden="true"and carriestitlewith the user's name. It is a compressed, decorative rendering of a name that is already in the DOM beside it. - Consequence: like every mark in this system, it must be accompanied by the name in text. A face on its own is silent to assistive technology, and unlike initials it does not even encode letters.
- An uploaded photo is an
<img alt="">for the same reason.
Focus
- Nothing focusable, so no focus ring. The surrounding control keeps the foundation ring.
Contrast
Computed from the palette tokens:
- The eyes and mouth use the paired
--uav-N-inkfor each colour, so the drawing never sits on a ground it cannot be read against — the two light colours (yellow, orange) get dark ink, the three dark ones get white. - The face is decoration: nothing in it is load-bearing text, so it is not held to a text contrast ratio.
Known limits
- The distinction is visual only. "Colleague" versus "contact from outside" is carried by the drawing; a screen-reader user gets the name and whatever the surrounding text says about the role. Where the difference matters for a decision — attendee lists, owner fields — the text must say it, not the face alone.
- Two colleagues can land on a similar colour pair; the face is a memory aid, never an identifier.
- The drawing is generated, so it cannot be described.
alt/titlecarry the name, and that is all a reader gets — which is the same amount of information an initials avatar gives.
Source: docs/avatar/user-avatar.a11y.md · GitLab