Skip to content

Commit 86961b7

Browse files
committed
For avatars in the highlights container, use a 1:1 aspect ratio instead of forcing the height and width in the parent container. This prevents the image becoming distorted as avatars as actually a 6:5 ratio.
1 parent bfd11de commit 86961b7

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

dotcom-rendering/src/components/Avatar.tsx

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,13 @@ const decideImageWidths = (
8888
];
8989
/* Avatars on cards in the highlights container are fixed to 98px on all breakpoints */
9090
case 'highlights-card':
91-
return [{ breakpoint: breakpoints.mobile, width: 98 }];
91+
return [
92+
{
93+
breakpoint: breakpoints.mobile,
94+
width: 98,
95+
aspectRatio: '1:1',
96+
},
97+
];
9298
}
9399
};
94100

dotcom-rendering/src/components/Masthead/HighlightsCardImage.tsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,7 @@ const imageStyles = css`
1010
position: relative;
1111
align-self: flex-end;
1212
flex-shrink: 0;
13-
height: 98px;
1413
width: 98px;
15-
1614
${until.tablet} {
1715
margin-top: ${space[2]}px;
1816
}

0 commit comments

Comments
 (0)