Skip to content

Commit 19ce1a1

Browse files
crisbetommalerba
authored andcommitted
fix(card): better scaling for avatar image (#13032)
Avoids the image getting squashed or losing its ratio, if it's dimensions are different from the card avatar.
1 parent 959c827 commit 19ce1a1

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/lib/card/card.scss

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,10 @@ $mat-card-header-size: 40px !default;
9999
width: $mat-card-header-size;
100100
border-radius: 50%;
101101
flex-shrink: 0;
102+
103+
// Makes `<img>` tags behave like `background-size: cover`. Not supported
104+
// in IE, but we're using it as a progressive enhancement.
105+
object-fit: cover;
102106
}
103107

104108
// TITLE-GROUP STYLES

0 commit comments

Comments
 (0)