Skip to content

Commit

Permalink
fix(card): remove unnecessary intermediate div (#1068)
Browse files Browse the repository at this point in the history
  • Loading branch information
jelbourn authored Aug 17, 2016
1 parent 32eacd2 commit b5e1e33
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 8 deletions.
4 changes: 1 addition & 3 deletions src/components/card/card.html
Original file line number Diff line number Diff line change
@@ -1,3 +1 @@
<div class="md-card">
<ng-content></ng-content>
</div>
<ng-content></ng-content>
10 changes: 5 additions & 5 deletions src/components/card/card.scss
Original file line number Diff line number Diff line change
Expand Up @@ -171,13 +171,13 @@ md-card-title-group {

// top els in md-card-content and md-card can't have their default margin-tops (e.g. <p> tags)
// or they'll incorrectly add to card's top padding
.md-card > :first-child, md-card-content > :first-child {
md-card > :first-child, md-card-content > :first-child {
margin-top: 0;
}

// last els in md-card-content and md-card can't have their default margin-bottoms (e.g. <p> tags)
// or they'll incorrectly add to card's bottom padding
.md-card > :last-child, md-card-content > :last-child {
md-card > :last-child, md-card-content > :last-child {
margin-bottom: 0;
}

Expand All @@ -189,7 +189,7 @@ md-card-title-group {

// actions panel on bottom should be 8px from bottom of card
// so must strip 16px from default card padding of 24px
.md-card > md-card-actions:last-child {
md-card > md-card-actions:last-child {
margin-bottom: -16px;
padding-bottom: 0;
}
Expand All @@ -216,12 +216,12 @@ md-card-header md-card-subtitle:not(:first-child) {

// xl image should always have 16px on top.
// when it's the first el, it'll need to remove 8px from default card padding of 24px
.md-card > [md-card-xl-image]:first-child {
md-card > [md-card-xl-image]:first-child {
margin-top: -8px;
}

// xl image should always have 16px on bottom
// when it's the last el, it'll need to remove 8px from default card padding of 24px
.md-card > [md-card-xl-image]:last-child {
md-card > [md-card-xl-image]:last-child {
margin-bottom: -8px;
}
4 changes: 4 additions & 0 deletions src/demo-app/card/card-demo.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
<div class="demo-card-container">
<md-card>
Hello
</md-card>

<md-card>
<md-card-title-group>
<md-card-title>Card with title</md-card-title>
Expand Down

0 comments on commit b5e1e33

Please sign in to comment.