Skip to content

Commit b5e1e33

Browse files
authored
fix(card): remove unnecessary intermediate div (#1068)
1 parent 32eacd2 commit b5e1e33

File tree

3 files changed

+10
-8
lines changed

3 files changed

+10
-8
lines changed

src/components/card/card.html

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1 @@
1-
<div class="md-card">
2-
<ng-content></ng-content>
3-
</div>
1+
<ng-content></ng-content>

src/components/card/card.scss

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -171,13 +171,13 @@ md-card-title-group {
171171

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

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

@@ -189,7 +189,7 @@ md-card-title-group {
189189

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

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

223223
// xl image should always have 16px on bottom
224224
// when it's the last el, it'll need to remove 8px from default card padding of 24px
225-
.md-card > [md-card-xl-image]:last-child {
225+
md-card > [md-card-xl-image]:last-child {
226226
margin-bottom: -8px;
227227
}

src/demo-app/card/card-demo.html

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
11
<div class="demo-card-container">
2+
<md-card>
3+
Hello
4+
</md-card>
5+
26
<md-card>
37
<md-card-title-group>
48
<md-card-title>Card with title</md-card-title>

0 commit comments

Comments
 (0)