Skip to content

Commit

Permalink
feat(card): add alignment shortcuts for md-card-actions
Browse files Browse the repository at this point in the history
  • Loading branch information
kara committed Apr 25, 2016
1 parent 0672356 commit 77be2df
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/components/card/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,11 @@ Output:

<img src="https://material.angularjs.org/material2_assets/cards/sections-card-min.png">

#### Preset shortcuts

`md-card-actions` has a few layout shortcuts. You can add `align="end"` to align the buttons at the end of
the main axis (flex-end). The default is `align="start"` (flex-start).

### Preset layouts

You can also leverage preset layouts that format some of the sections together.
Expand Down
5 changes: 5 additions & 0 deletions src/components/card/card.scss
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,11 @@ md-card-actions {
margin-left: -16px;
margin-right: -16px;
padding: 8px 0;

&[align='end'] {
display: flex;
justify-content: flex-end;
}
}

[md-card-image] {
Expand Down
4 changes: 4 additions & 0 deletions src/demo-app/card/card-demo.html
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@
<md-card-content>
<p>Here is some content</p>
</md-card-content>
<md-card-actions align="end">
<button md-button>LIKE</button>
<button md-button>SHARE</button>
</md-card-actions>
</md-card>

<md-card>
Expand Down

0 comments on commit 77be2df

Please sign in to comment.