From e76a9317844fb5b040ea1860e470d7997fc044a7 Mon Sep 17 00:00:00 2001 From: Sebastian Beisch Date: Mon, 5 Sep 2016 09:09:30 +0200 Subject: [PATCH 1/2] fix(md-card): add md-card-footer --- src/demo-app/card/card-demo.html | 5 ++++- src/lib/card/README.md | 2 +- src/lib/card/card.scss | 5 ++++- src/lib/card/card.ts | 12 ++++++++++-- 4 files changed, 19 insertions(+), 5 deletions(-) diff --git a/src/demo-app/card/card-demo.html b/src/demo-app/card/card-demo.html index f0be370dd7e7..1bb780497625 100644 --- a/src/demo-app/card/card-demo.html +++ b/src/demo-app/card/card-demo.html @@ -13,7 +13,7 @@ Subtitle - Card with title + Card with title and footer

This is supporting text.

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.

@@ -22,6 +22,9 @@ + + +
diff --git a/src/lib/card/README.md b/src/lib/card/README.md index 14c28409ac0c..63867c319b0e 100644 --- a/src/lib/card/README.md +++ b/src/lib/card/README.md @@ -27,7 +27,7 @@ We also provide a number of preset sections that you can mix and match within th * ``: main content section, intended for blocks of text * ``: stretches image to container width * ``: wraps and styles buttons - * ``: anchors section to bottom of card + * ``: anchors section to bottom of card (e.g progress bar) Example markup for a card with section presets: diff --git a/src/lib/card/card.scss b/src/lib/card/card.scss index 6d8683269b80..17ab41c5d284 100644 --- a/src/lib/card/card.scss +++ b/src/lib/card/card.scss @@ -76,7 +76,10 @@ md-card-actions { md-card-footer { position: absolute; - bottom: 0; + min-height: 5px; + width: 100%; + bottom: 0; + left: 0; } md-card-actions { diff --git a/src/lib/card/card.ts b/src/lib/card/card.ts index 9a9f761d70fc..2a249ffdce6b 100644 --- a/src/lib/card/card.ts +++ b/src/lib/card/card.ts @@ -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 {} + /* @@ -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 { From 5c348a02977c856efdf31f7260f39f0c47b10588 Mon Sep 17 00:00:00 2001 From: Sebastian Beisch Date: Mon, 5 Sep 2016 09:35:52 +0200 Subject: [PATCH 2/2] fix(md-card): fix scss-lint issue --- src/lib/card/card.scss | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lib/card/card.scss b/src/lib/card/card.scss index 17ab41c5d284..d80ffb66d7b1 100644 --- a/src/lib/card/card.scss +++ b/src/lib/card/card.scss @@ -76,9 +76,9 @@ md-card-actions { md-card-footer { position: absolute; - min-height: 5px; width: 100%; - bottom: 0; + min-height: 5px; + bottom: 0; left: 0; }