Skip to content
This repository was archived by the owner on Sep 5, 2024. It is now read-only.

Commit 5610dc9

Browse files
author
Marcy Sutton
committed
fix(card): md-action-bar renamed to .md-actions
-Margins adjusted on Card and Dialog action buttons -Alt text added to images in card demos Closes #2472
1 parent 9dc6240 commit 5610dc9

4 files changed

Lines changed: 35 additions & 10 deletions

File tree

src/components/card/card.js

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,17 @@ angular.module('material.components.card', [
2626
* container will wrap text content and provide padding. An `<md-card-footer>` element can be
2727
* optionally included to put content flush against the bottom edge of the card.
2828
*
29+
* Action buttons can be included in an element with the `.md-actions` class, also used in `md-dialog`.
30+
* You can then position buttons using layout attributes.
31+
*
2932
* Cards have constant width and variable heights; where the maximum height is limited to what can
3033
* fit within a single view on a platform, but it can temporarily expand as needed.
3134
*
3235
* @usage
36+
* ###Card with optional footer
3337
* <hljs lang="html">
3438
* <md-card>
35-
* <img src="card-image.png" class="md-card-image">
39+
* <img src="card-image.png" class="md-card-image" alt="image caption">
3640
* <md-card-content>
3741
* <h2>Card headline</h2>
3842
* <p>Card content</p>
@@ -43,6 +47,21 @@ angular.module('material.components.card', [
4347
* </md-card>
4448
* </hljs>
4549
*
50+
* ###Card with actions
51+
* <hljs lang="html">
52+
* <md-card>
53+
* <img src="card-image.png" class="md-card-image" alt="image caption">
54+
* <md-card-content>
55+
* <h2>Card headline</h2>
56+
* <p>Card content</p>
57+
* </md-card-content>
58+
* <div class="md-actions" layout="row" layout-align="end center">
59+
* <md-button>Action 1</md-button>
60+
* <md-button>Action 2</md-button>
61+
* </div>
62+
* </md-card>
63+
* </hljs>
64+
*
4665
*/
4766
function mdCardDirective($mdTheming) {
4867
return {

src/components/card/card.scss

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
1-
$card-margin: 8px !default;
21
$card-padding: 16px !default;
32
$card-box-shadow: $whiteframe-shadow-z1 !default;
43

54
md-card {
65
box-sizing: border-box;
76
display: flex;
87
flex-direction: column;
9-
margin: $card-margin;
8+
margin: $baseline-grid;
109

1110
box-shadow: $card-box-shadow;
1211

@@ -18,12 +17,14 @@ md-card {
1817
md-card-content {
1918
padding: $card-padding;
2019
}
21-
md-action-bar {
20+
.md-actions {
2221
margin: 0;
2322

2423
.md-button {
25-
margin-bottom: $card-margin;
26-
margin-top: $card-margin;
24+
margin-bottom: $baseline-grid;
25+
margin-top: $baseline-grid;
26+
margin-right: $baseline-grid * .5;
27+
margin-left: $baseline-grid * .5;
2728
}
2829
}
2930
md-card-footer {

src/components/card/demoBasicUsage/index.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@ <h2 class="md-title">Paracosm</h2>
1212
two most important words in Ernest Greene's musical language: feel it. It's a simple request, as well...
1313
</p>
1414
</md-card-content>
15-
<md-action-bar layout="row" layout-align="end center">
15+
<div class="md-actions" layout="row" layout-align="end center">
1616
<md-button>Action 1</md-button>
1717
<md-button>Action 2</md-button>
18-
</md-action-bar>
18+
</div>
1919
</md-card>
2020

2121
<md-card>

src/components/dialog/dialog.scss

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,14 +54,19 @@ md-dialog {
5454
box-sizing: border-box;
5555
align-items: center;
5656
justify-content: flex-end;
57-
padding: $baseline-grid;
57+
margin-bottom: 0;
58+
padding-right: $baseline-grid;
5859
padding-left: $baseline-grid * 3;
59-
min-height: $baseline-grid * 5;
60+
min-height: $baseline-grid * 6.5;
6061

6162
> * {
6263
margin-left: $baseline-grid / 2;
6364
margin-right: 0;
6465
}
66+
.md-button {
67+
margin-bottom: $baseline-grid;
68+
margin-top: $baseline-grid;
69+
}
6570
}
6671
&.md-content-overflow .md-actions {
6772
border-top: 1px solid;

0 commit comments

Comments
 (0)