Skip to content

Commit 42a4fd9

Browse files
crisbetoandrewseguin
authored andcommitted
fix(material-experimental/mdc-card): reset native header margin (#22550)
`mat-card` supports using native header elements for the title and subtitle, but doing so throws off the alignment, because we weren't clearing the user agent margin. (cherry picked from commit f88023c)
1 parent 5ecefa7 commit 42a4fd9

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/material-experimental/mdc-card/card.scss

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,10 @@ $mat-card-default-padding: 16px !default;
2222
// Apply default padding for a text content region. Omit any bottom padding because we assume
2323
// this region will be followed by another region that includes top padding.
2424
padding: $mat-card-default-padding $mat-card-default-padding 0;
25+
26+
// Titles and subtitles can be set on native header elements which come with
27+
// their own margin. Clear it since the spacing is done using `padding`.
28+
margin: 0;
2529
}
2630

2731
// Header section at the top of a card. MDC does not have a pre-made header section for cards.

0 commit comments

Comments
 (0)