-
Notifications
You must be signed in to change notification settings - Fork 6.8k
demo(card): Add accessibility demo page for card #6358
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
Merged
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,93 @@ | ||
<section> | ||
<h2>Dogs group</h2> | ||
<p>Showing a card with a group of content</p> | ||
<md-card class="example-card" role="group"> | ||
<md-card-content> | ||
<p>Herding Group</p> | ||
<p>Hound Group</p> | ||
<p>Non-Sporting Group</p> | ||
<p>Sporting Group</p> | ||
<p>Terrier Group</p> | ||
<p>Toy Group</p> | ||
<p>Working Group</p> | ||
<p>Foundation Stock Service</p> | ||
<p>Miscellaneous Class</p> | ||
</md-card-content> | ||
</md-card> | ||
</section> | ||
|
||
<section> | ||
<h2>Husky</h2> | ||
<p>Showing a card with title only</p> | ||
<md-card class="example-card"> | ||
Siberian Husky | ||
</md-card> | ||
</section> | ||
|
||
<section> | ||
<h2>Malamute</h2> | ||
<p>Showing a Card with title and subtitle. </p> | ||
<md-card class="example-card"> | ||
<md-card-title>Alaskan Malamute</md-card-title> | ||
<md-card-subtitle>Dog breed</md-card-subtitle> | ||
</md-card> | ||
</section> | ||
|
||
|
||
<section> | ||
<h2>German Shepherd</h2> | ||
<p> | ||
Showing a card with title, subtitle, and a footer. | ||
</p> | ||
<md-card class="example-card"> | ||
<md-card-subtitle>Dog breed</md-card-subtitle> | ||
<md-card-title>German Shepherd</md-card-title> | ||
<md-card-content> | ||
The German Shepherd is a breed of medium to large-sized working dog that originated in | ||
Germany. The breed's officially recognized name is German Shepherd Dog in the English | ||
language. The breed is also known as the Alsatian in Britain and Ireland. | ||
</md-card-content> | ||
<md-card-footer> | ||
People also search for Rottweiler, Siberian Husky, Labrador Retriever, Doberman Pinscher | ||
</md-card-footer> | ||
</md-card> | ||
</section> | ||
|
||
<section> | ||
<h2>Dachshund</h2> | ||
<p>Showing a card with title, subtitle, and avatar as header and a card image.</p> | ||
<md-card class="example-card"> | ||
<md-card-header> | ||
<img md-card-avatar src="a11y/card/assets/dachshund-avatar.jpg" aria-label="Dachshund avatar"> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Each image should have an |
||
<md-card-title>Dachshund</md-card-title> | ||
<md-card-subtitle>Dog breed</md-card-subtitle> | ||
</md-card-header> | ||
<img md-card-image src="a11y/card/assets/dachshund.jpg" | ||
aria-label="Dachshund"> | ||
<md-card-content> | ||
The dachshund is a short-legged, long-bodied, hound-type dog breed. | ||
</md-card-content> | ||
</md-card> | ||
</section> | ||
|
||
<section> | ||
<h2>Shiba Inu</h2> | ||
<p>Showing a card with header, content, image, and two action buttons: "share" and "like".</p> | ||
<md-card class="example-card"> | ||
<md-card-header> | ||
<img md-card-avatar src="a11y/card/assets/shiba-inu-avatar.jpg" aria-label="Shiba Inu avatar"> | ||
<md-card-title>Shiba Inu</md-card-title> | ||
<md-card-subtitle>Dog Breed</md-card-subtitle> | ||
</md-card-header> | ||
<img md-card-image src="a11y/card/assets/shiba-inu.jpg" aria-label="Shiba Inu"> | ||
<md-card-content> | ||
The Shiba Inu is the smallest of the six original and distinct spitz breeds of dog from Japan. | ||
A small, agile dog that copes very well with mountainous terrain, the Shiba Inu was originally | ||
bred for hunting. | ||
</md-card-content> | ||
<md-card-actions align="end"> | ||
<button md-button (click)="openSnackbar('Liked Shiba Inu')">like</button> | ||
<button md-button (click)="openSnackbar('Shared Shiba Inu')">share</button> | ||
</md-card-actions> | ||
</md-card> | ||
</section> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
.example-card button { | ||
text-transform: uppercase; | ||
} | ||
|
||
.example-card { | ||
max-width: 450px; | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import {Component} from '@angular/core'; | ||
import {MdSnackBar} from '@angular/material'; | ||
|
||
@Component({ | ||
moduleId: module.id, | ||
selector: 'card-a11y', | ||
templateUrl: 'card-a11y.html', | ||
styleUrls: ['card-a11y.css'], | ||
}) | ||
export class CardAccessibilityDemo { | ||
showProgress: boolean = false; | ||
|
||
constructor(private snackBar: MdSnackBar) {} | ||
|
||
openSnackbar(message: string) { | ||
this.snackBar.open(message, '', {duration: 2000}); | ||
} | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 any of these
<md-card>
instances haverole="group"
?(to line up with the docs https://material.angular.io/components/card/overview)
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.
Added another example with
role="group"