Skip to content

Commit 533e9a6

Browse files
committed
fix(card): remove extra margin if header doesn't have an avatar
The card header margin was set up assuming that there would always be an avatar element, but that's not always the case. These changes add an extra check to avoid the extra margin. Fixes #19069.
1 parent 695dde6 commit 533e9a6

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

src/material/card/card.scss

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,17 @@ $mat-card-header-size: 40px !default;
103103
}
104104

105105
.mat-card-header-text {
106-
margin: 0 $mat-card-padding;
106+
&:not(:first-child) {
107+
margin-left: $mat-card-padding;
108+
}
109+
110+
[dir='rtl'] & {
111+
margin-left: 0;
112+
113+
&:not(:first-child) {
114+
margin-right: $mat-card-padding;
115+
}
116+
}
107117
}
108118

109119
.mat-card-avatar {

0 commit comments

Comments
 (0)