Skip to content

Commit

Permalink
fix(material-experimental/mdc-card): reset native header margin (#22550)
Browse files Browse the repository at this point in the history
`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)
  • Loading branch information
crisbeto authored and andrewseguin committed Apr 27, 2021
1 parent 7f556b5 commit 9087770
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/material-experimental/mdc-card/card.scss
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@ $mat-card-default-padding: 16px !default;
// Apply default padding for a text content region. Omit any bottom padding because we assume
// this region will be followed by another region that includes top padding.
padding: $mat-card-default-padding $mat-card-default-padding 0;

// Titles and subtitles can be set on native header elements which come with
// their own margin. Clear it since the spacing is done using `padding`.
margin: 0;
}

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

0 comments on commit 9087770

Please sign in to comment.