Skip to content

Commit

Permalink
fix(material/card): handle picture element as mat-card-image
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.
  • Loading branch information
crisbeto committed Oct 2, 2021
1 parent 7c16258 commit e9ca125
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 classes 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 e9ca125

Please sign in to comment.