Skip to content

Commit

Permalink
chore(button): add unique aria labels to buttons with icons
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 602512735
  • Loading branch information
asyncLiz authored and copybara-github committed Jan 29, 2024
1 parent 6ecda49 commit e18d913
Showing 1 changed file with 20 additions and 5 deletions.
25 changes: 20 additions & 5 deletions button/demo/stories.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,27 +63,37 @@ const buttons: MaterialStoryInit<StoryKnobs> = {
</md-text-button>
</div>
<div class="row">
<md-filled-button ?disabled=${disabled}>
<md-filled-button
?disabled=${disabled}
aria-label="${label || 'Filled'} button with icon">
<md-icon slot="icon">upload</md-icon>
${label || 'Filled'}
</md-filled-button>
<md-outlined-button ?disabled=${disabled}>
<md-outlined-button
?disabled=${disabled}
aria-label="${label || 'Outlined'} button with icon">
<md-icon slot="icon">upload</md-icon>
${label || 'Outlined'}
</md-outlined-button>
<md-elevated-button ?disabled=${disabled}>
<md-elevated-button
?disabled=${disabled}
aria-label="${label || 'Elevated'} button with icon">
<md-icon slot="icon">upload</md-icon>
${label || 'Elevated'}
</md-elevated-button>
<md-filled-tonal-button ?disabled=${disabled}>
<md-filled-tonal-button
?disabled=${disabled}
aria-label="${label || 'Tonal'} button with icon">
<md-icon slot="icon">upload</md-icon>
${label || 'Tonal'}
</md-filled-tonal-button>
<md-text-button ?disabled=${disabled}>
<md-text-button
?disabled=${disabled}
aria-label="${label || 'Text'} button with icon">
<md-icon slot="icon">upload</md-icon>
${label || 'Text'}
</md-text-button>
Expand Down Expand Up @@ -137,6 +147,7 @@ const links: MaterialStoryInit<StoryKnobs> = {
</div>
<div class="row">
<md-filled-button
aria-label="${label || 'Filled'} link with trailing icon"
href="https://google.com"
target="_blank"
trailing-icon>
Expand All @@ -145,6 +156,7 @@ const links: MaterialStoryInit<StoryKnobs> = {
</md-filled-button>
<md-outlined-button
aria-label="${label || 'Outlined'} link with trailing icon"
href="https://google.com"
target="_blank"
trailing-icon>
Expand All @@ -153,6 +165,7 @@ const links: MaterialStoryInit<StoryKnobs> = {
</md-outlined-button>
<md-elevated-button
aria-label="${label || 'Elevated'} link with trailing icon"
href="https://google.com"
target="_blank"
trailing-icon>
Expand All @@ -161,6 +174,7 @@ const links: MaterialStoryInit<StoryKnobs> = {
</md-elevated-button>
<md-filled-tonal-button
aria-label="${label || 'Tonal'} link with trailing icon"
href="https://google.com"
target="_blank"
trailing-icon>
Expand All @@ -169,6 +183,7 @@ const links: MaterialStoryInit<StoryKnobs> = {
</md-filled-tonal-button>
<md-text-button
aria-label="${label || 'Text'} link with trailing icon"
href="https://google.com"
target="_blank"
trailing-icon>
Expand Down

0 comments on commit e18d913

Please sign in to comment.