Skip to content

feat(md-card): add md-card-footer #1178

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 2 commits into from
Sep 23, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion src/demo-app/card/card-demo.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

<md-card>
<md-card-subtitle>Subtitle</md-card-subtitle>
<md-card-title>Card with title</md-card-title>
<md-card-title>Card with title and footer</md-card-title>
<md-card-content>
<p>This is supporting text.</p>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>
Expand All @@ -22,6 +22,9 @@
<button md-button>LIKE</button>
<button md-button>SHARE</button>
</md-card-actions>
<md-card-footer>
<md-progress-bar mode="indeterminate"></md-progress-bar>
</md-card-footer>
</md-card>

<md-card>
Expand Down
2 changes: 1 addition & 1 deletion src/lib/card/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ We also provide a number of preset sections that you can mix and match within th
* `<md-card-content>`: main content section, intended for blocks of text
* `<img md-card-image>`: stretches image to container width
* `<md-card-actions>`: wraps and styles buttons
* `<md-card-footer>`: anchors section to bottom of card
* `<md-card-footer>`: anchors section to bottom of card (e.g progress bar)

Example markup for a card with section presets:

Expand Down
3 changes: 3 additions & 0 deletions src/lib/card/card.scss
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,10 @@ md-card-actions {

md-card-footer {
position: absolute;
width: 100%;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@kara could you review this change?

min-height: 5px;
bottom: 0;
left: 0;
}

md-card-actions {
Expand Down
12 changes: 10 additions & 2 deletions src/lib/card/card.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,14 @@ export class MdCardSubtitle {}
})
export class MdCardActions {}

/**
* Footer of a card, needed as it's used as a selector in the API.
*/
@Directive({
selector: 'md-card-footer'
})
export class MdCardFooter {}


/*

Expand Down Expand Up @@ -118,11 +126,11 @@ export class MdCardTitleGroup {}
@NgModule({
exports: [
MdCard, MdCardHeader, MdCardTitleGroup, MdCardContent, MdCardTitle, MdCardSubtitle,
MdCardActions
MdCardActions, MdCardFooter
],
declarations: [
MdCard, MdCardHeader, MdCardTitleGroup, MdCardContent, MdCardTitle, MdCardSubtitle,
MdCardActions
MdCardActions, MdCardFooter
],
})
export class MdCardModule {
Expand Down