Skip to content

Commit 1c2a3f1

Browse files
Nightapeskara
authored andcommitted
feat(md-card): add md-card-footer (#1178)
1 parent 2306244 commit 1c2a3f1

File tree

4 files changed

+18
-4
lines changed

4 files changed

+18
-4
lines changed

src/demo-app/card/card-demo.html

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313

1414
<md-card>
1515
<md-card-subtitle>Subtitle</md-card-subtitle>
16-
<md-card-title>Card with title</md-card-title>
16+
<md-card-title>Card with title and footer</md-card-title>
1717
<md-card-content>
1818
<p>This is supporting text.</p>
1919
<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>
@@ -22,6 +22,9 @@
2222
<button md-button>LIKE</button>
2323
<button md-button>SHARE</button>
2424
</md-card-actions>
25+
<md-card-footer>
26+
<md-progress-bar mode="indeterminate"></md-progress-bar>
27+
</md-card-footer>
2528
</md-card>
2629

2730
<md-card>

src/lib/card/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ We also provide a number of preset sections that you can mix and match within th
2727
* `<md-card-content>`: main content section, intended for blocks of text
2828
* `<img md-card-image>`: stretches image to container width
2929
* `<md-card-actions>`: wraps and styles buttons
30-
* `<md-card-footer>`: anchors section to bottom of card
30+
* `<md-card-footer>`: anchors section to bottom of card (e.g progress bar)
3131

3232
Example markup for a card with section presets:
3333

src/lib/card/card.scss

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,10 @@ md-card-actions {
7272

7373
md-card-footer {
7474
position: absolute;
75+
width: 100%;
76+
min-height: 5px;
7577
bottom: 0;
78+
left: 0;
7679
}
7780

7881
md-card-actions {

src/lib/card/card.ts

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,14 @@ export class MdCardSubtitle {}
4040
})
4141
export class MdCardActions {}
4242

43+
/**
44+
* Footer of a card, needed as it's used as a selector in the API.
45+
*/
46+
@Directive({
47+
selector: 'md-card-footer'
48+
})
49+
export class MdCardFooter {}
50+
4351

4452
/*
4553
@@ -118,11 +126,11 @@ export class MdCardTitleGroup {}
118126
@NgModule({
119127
exports: [
120128
MdCard, MdCardHeader, MdCardTitleGroup, MdCardContent, MdCardTitle, MdCardSubtitle,
121-
MdCardActions
129+
MdCardActions, MdCardFooter
122130
],
123131
declarations: [
124132
MdCard, MdCardHeader, MdCardTitleGroup, MdCardContent, MdCardTitle, MdCardSubtitle,
125-
MdCardActions
133+
MdCardActions, MdCardFooter
126134
],
127135
})
128136
export class MdCardModule {

0 commit comments

Comments
 (0)