Skip to content

Commit 30a3152

Browse files
committed
fixup! fix(material/card): don't add extra padding around mat-card-title-group
1 parent a6a53f8 commit 30a3152

File tree

1 file changed

+10
-8
lines changed

1 file changed

+10
-8
lines changed

src/material/card/card.scss

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
@use 'sass:math';
21
@use '../core/mdc-helpers/mdc-helpers';
32
@use '@material/card' as mdc-card;
43

@@ -44,13 +43,6 @@ $mat-card-default-padding: 16px !default;
4443
// Apply default padding for the header region. Omit any bottom padding because we assume
4544
// this region will be followed by another region that includes top padding.
4645
padding: $mat-card-default-padding $mat-card-default-padding 0;
47-
48-
// When a subtitle is inside of a header, we want to move it up slightly to reduce the space with
49-
// the title, and add a margin bottom to create space underneath the header.
50-
.mat-mdc-card-subtitle {
51-
margin-top: -(math.div($mat-card-default-padding, 2));
52-
margin-bottom: $mat-card-default-padding;
53-
}
5446
}
5547

5648
// Primary card content. MDC does not have a pre-made section for primary content.
@@ -93,10 +85,20 @@ $mat-card-default-padding: 16px !default;
9385
width: $mat-card-header-size;
9486
border-radius: 50%;
9587
flex-shrink: 0;
88+
margin-bottom: $mat-card-default-padding;
9689

9790
// Makes `<img>` tags behave like `background-size: cover`. Not supported
9891
// in IE, but we're using it as a progressive enhancement.
9992
object-fit: cover;
93+
94+
// When a title and subtitle are used alongside an avatar,
95+
// reduce the spacing between them to better align with the avatar.
96+
& ~ .mat-mdc-card-header-text {
97+
.mat-mdc-card-subtitle,
98+
.mat-mdc-card-title {
99+
line-height: normal;
100+
}
101+
}
100102
}
101103

102104
// Specifically sized small image, specific to Angular Material.

0 commit comments

Comments
 (0)