Skip to content

Commit

Permalink
feat(md-card): add md-card-footer (#1178)
Browse files Browse the repository at this point in the history
  • Loading branch information
Nightapes authored and kara committed Sep 23, 2016
1 parent 2306244 commit 1c2a3f1
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 4 deletions.
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 @@ -72,7 +72,10 @@ md-card-actions {

md-card-footer {
position: absolute;
width: 100%;
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

0 comments on commit 1c2a3f1

Please sign in to comment.