-
Notifications
You must be signed in to change notification settings - Fork 3
Improve avatar status accessibility and update CSS hash #232
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -70,19 +70,19 @@ Add a `.avatar-status` element inside the avatar to show a status indicator. Eac | |
| {{< example >}} | ||
| <span class="avatar"> | ||
| <img class="avatar-img" src="https://github.com/coliff.png" alt="CO"> | ||
| <span class="avatar-status status-online"></span> | ||
| <span class="avatar-status status-online" role="status" aria-label="Online"></span> | ||
| </span> | ||
| <span class="avatar"> | ||
| <img class="avatar-img" src="https://github.com/coliff.png" alt="CO"> | ||
| <span class="avatar-status status-offline"></span> | ||
| <span class="avatar-status status-offline" role="status" aria-label="Offline"></span> | ||
| </span> | ||
| <span class="avatar"> | ||
| <img class="avatar-img" src="https://github.com/coliff.png" alt="CO"> | ||
| <span class="avatar-status status-busy"></span> | ||
| <span class="avatar-status status-busy" role="status" aria-label="Busy"></span> | ||
| </span> | ||
| <span class="avatar"> | ||
| <img class="avatar-img" src="https://github.com/coliff.png" alt="CO"> | ||
| <span class="avatar-status status-away"></span> | ||
| <span class="avatar-status status-away" role="status" aria-label="Away"></span> | ||
| </span> | ||
| {{< /example >}} | ||
|
|
||
|
|
@@ -93,23 +93,23 @@ The status indicator scales with the avatar size. | |
| {{< example >}} | ||
| <span class="avatar avatar-xs"> | ||
| <img class="avatar-img" src="https://github.com/coliff.png" alt="CO"> | ||
| <span class="avatar-status status-online"></span> | ||
| <span class="avatar-status status-online" role="status" aria-label="Online"></span> | ||
| </span> | ||
| <span class="avatar avatar-sm"> | ||
| <img class="avatar-img" src="https://github.com/coliff.png" alt="CO"> | ||
| <span class="avatar-status status-online"></span> | ||
| <span class="avatar-status status-online" role="status" aria-label="Online"></span> | ||
| </span> | ||
| <span class="avatar"> | ||
| <img class="avatar-img" src="https://github.com/coliff.png" alt="CO"> | ||
| <span class="avatar-status status-online"></span> | ||
| <span class="avatar-status status-online" role="status" aria-label="Online"></span> | ||
| </span> | ||
| <span class="avatar avatar-lg"> | ||
| <img class="avatar-img" src="https://github.com/coliff.png" alt="CO"> | ||
| <span class="avatar-status status-online"></span> | ||
| <span class="avatar-status status-online" role="status" aria-label="Online"></span> | ||
| </span> | ||
| <span class="avatar avatar-xl"> | ||
| <img class="avatar-img" src="https://github.com/coliff.png" alt="CO"> | ||
| <span class="avatar-status status-online"></span> | ||
| <span class="avatar-status status-online" role="status" aria-label="Online"></span> | ||
|
Comment on lines
+96
to
+112
|
||
| </span> | ||
| {{< /example >}} | ||
|
|
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The use of
role="status"for avatar status indicators is semantically incorrect. The ARIAstatusrole is intended for live regions that provide advisory information that changes dynamically (e.g., "5 results found" or "Saving..."). Avatar status indicators are static visual decorations that don't change content dynamically in the DOM.For these purely decorative status indicators, consider one of these approaches:
role="img"witharia-labelif the status is important enough to be announcedaria-hidden="true"if the status is conveyed through other means (e.g., the avatar is in a list that textually indicates status)The
role="status"with its implicitaria-live="polite"will cause screen readers to announce these every time they encounter them, which may not be the intended behavior for static status indicators.