-
Notifications
You must be signed in to change notification settings - Fork 6.8k
docs(button): enhance button docs and examples #8536
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
4193930
to
325d956
Compare
@@ -0,0 +1,3 @@ | |||
.spacer { | |||
flex: 1; | |||
} |
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.
Should end w/ new line
<button mat-icon-button> | ||
<mat-icon aria-label="Example icon-button with a more vertical icon">more_vert</mat-icon> | ||
</button> | ||
</mat-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.
Should end w/ new line
templateUrl: 'button-toolbar-example.html', | ||
styleUrls: ['button-toolbar-example.css'], | ||
}) | ||
export class ButtonToolbarExample {} |
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.
Should end w/ new line
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.
Overall looks good but need to go back through and ensure files end w/ new line.
325d956
to
7e88ab6
Compare
fixed |
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.
FYI the docs site also needs to be updated once this is merged:
(someday we'll get around to auto-generating this)
<mat-card-title>Card with action buttons</mat-card-title> | ||
</mat-card-header> | ||
<mat-card-actions align="end"> | ||
<button mat-button>CANCEL</button> |
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 normal text case for buttons, the docs site capitalizes them via CSS. If screen-readers encounter ALL CAPS, it reads it as "A. L. L. C. ..."
(here and elsewhere)
@@ -1 +1,16 @@ | |||
/** No CSS for this example */ | |||
.button-row { |
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.
Prefix all example styles with .example-
(here and elsewhere)
This makes it super obvious which styles are from the example vs. the docs site (docs-
) vs. material
</mat-card-header> | ||
<mat-card-actions align="end"> | ||
<button mat-button>CANCEL</button> | ||
<button mat-button color="primary">ACCEPT</button> |
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.
These should have an aria-label
along the lines of "Example button, no action"
(here and elsewhere, where the label can be expanded with what the button is an example of)
<h3>Icon Buttons</h3> | ||
<div class="button-row"> | ||
<button mat-icon-button> | ||
<mat-icon aria-label="Example icon-button with a heart icon">favorite</mat-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.
https://material.angular.io/components/icon/overview#accessibility
In cases like this the aria-label
should go on the interactive element (the button or anchor)
@@ -17,10 +17,11 @@ import {AutocompleteDisplayExample} from './autocomplete-display/autocomplete-di | |||
import {AutocompleteFilterExample} from './autocomplete-filter/autocomplete-filter-example'; | |||
import {AutocompleteOverviewExample} from './autocomplete-overview/autocomplete-overview-example'; | |||
import {AutocompleteSimpleExample} from './autocomplete-simple/autocomplete-simple-example'; | |||
import {ButtonCardExample} from './button-card/button-card-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.
Not sure if you knew this but this file is auto-generated
(I'm not sure why it's in source control... @amcdnl?)
angular/material.angular.io#330 here's the pr for the material.angular.io website |
7e88ab6
to
40c2e00
Compare
@jelbourn it seems like once i removed |
40c2e00
to
b0ea290
Compare
The changes to example-module are necessary, but you shouldn't need to make them by hand. The file also probably shouldn't need to be in source control (a matter for another PR) |
@EladBezalel could you rebase this PR? |
@EladBezalel could you rebase this PR (again)? |
Closing as we are going on ~6 months of inactvity on this PR. Feel free to open up a new PR with these changes if you would like to get them into the library. |
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. |
changed the overview example to

and change examples section to

showing use cases