Skip to content

feat(card): add alignment shortcuts for md-card-actions #356

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 25, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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