-
Notifications
You must be signed in to change notification settings - Fork 6.8k
a11y(toolbar): Add toolbar accessibility demo page #6145
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
Conversation
@@ -0,0 +1,28 @@ | |||
<div class="demo-toolbar"> | |||
<section> | |||
<h2>Display</h2> |
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.
Put use case in h2
|
||
<section> | ||
<h2>Multiple Lines Toolbar</h2> | ||
<md-toolbar>Line 1</md-toolbar> |
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.
Use real world example?
<md-toolbar> | ||
<span>My App</span> | ||
<span class="example-spacer"></span> | ||
<md-icon class="example-icon">favorite</md-icon> |
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.
Add aria-label
for icon
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.
md-icons actually are aria-hidden
by default. They should only be made aria-hidden="false"
if they're communicating some information. See the accessibility section of the icon docs.
In this case, having an icon sitting by itself in the toolbar isn't very realistic to a real app; it would either be an indicator for something or an action.
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 PR title says "a11y(checkbox)"
<div class="demo-toolbar"> | ||
<section> | ||
<h2>Basic Toolbar with Text (e.g. Only display app’s name)</h2> | ||
<md-toolbar>My App</md-toolbar> |
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.
A toolbar by itself isn't really representative of how the component will be used. It typically acts as a header for some content. In this capacity, it should either use role="heading"
and aria-level
OR it should contain a header element (h1
-> h6
).
The examples should represent a real use-case as much as possible.
src/demo-app/a11y/a11y.ts
Outdated
@@ -26,6 +26,7 @@ export class AccessibilityDemo { | |||
{name: 'Grid list', route: 'grid-list'}, | |||
{name: 'Input', route: 'input'}, | |||
{name: 'Radio buttons', route: 'radio'}, | |||
{name: 'Slider', route: 'slider'}, | |||
{name: 'Toolbar', route: 'toolbar'}, |
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.
nit: put 'Toolbar' after 'Slider'
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.
done :)
<md-toolbar> | ||
<span>My App</span> | ||
<span class="example-spacer"></span> | ||
<md-icon aria-label="favorite">favorite</md-icon> |
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.
Is aria-label
working on md-icon
? Consider adding a span with cdk-visually-hidden or make it a button/link?
https://material.angular.io/components/icon/overview
<h2>Basic Toolbar with Text (e.g. Only display app’s name)</h2> | ||
<md-toolbar role="heading"> | ||
<h1>My App</h1> | ||
</md-toolbar> |
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.
I wasn't very clear in the last comments: each toolbar should have some actual content under it as well (that the toolbar describes; can just be a <p>
)
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.
LGTM
@amcdnl Can you rebase this? |
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
Created accessibility demo page demonstrating: