Skip to content
This repository was archived by the owner on Sep 5, 2024. It is now read-only.
This repository was archived by the owner on Sep 5, 2024. It is now read-only.

Material buttons should be accessible #197

@marcysutton

Description

@marcysutton

Material Buttons currently have an interior button or anchor element that is not accessible. Buttons must be focusable and have text content or ARIA equivalents. To improve the accessibility of material-button, we should alter the component structure. It's actually not too far off in its current state, but the text content needs to go inside of the button element so it will be read aloud on focus:

<material-button class="material-button-raised">
    <canvas class="material-ink-ripple " style="top:0px; left:0px"></canvas>
    <button class="material-button-inner"></button>
    <span class="ng-scope">Button</span>
</material-button>

A more accessible button might look like this:

<material-button class="material-button-raised">
     <button class="material-button-inner">
        <canvas class="material-ink-ripple " style="top:0px; left:0px" 
                aria-hidden="true"></canvas>
        <span class="ng-scope">Button</span>
    </button>
</material-button>

The associated CSS should apply hover and focus styles to the internal button element. By using the native element, the role is communicated to assistive technologies by default, and tabIndex is also natively supported.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions