Skip to content

Commit

Permalink
fix(material/card): handle picture element as mat-card-image (#23678)
Browse files Browse the repository at this point in the history
Fixes that setting `mat-card-image` on a `picture` element doesn't work correctly.

Fixes #23649.

(cherry picked from commit 267b03a)
  • Loading branch information
crisbeto authored and andrewseguin committed Jan 18, 2022
1 parent 805eee8 commit 761f9f2
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/material/card/card.scss
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,14 @@ $header-size: 40px !default;
.mat-card-image {
width: calc(100% + #{$padding * 2});
margin: 0 (-$padding) 16px (-$padding);

// The following properties are to handle `mat-card-image` on a `picture` element.
display: block;
overflow: hidden;

img {
width: 100%;
}
}

.mat-card-footer {
Expand Down

0 comments on commit 761f9f2

Please sign in to comment.