Skip to content

Commit bfcb29e

Browse files
fix: use display:contents on picture elements for correct card sizing
Picture element defaults to display:inline which breaks the card aspect ratio. Using display:contents makes the img a direct layout child of the Card, matching the original CardMedia behavior. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 0bce46a commit bfcb29e

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

app/src/components/ImageCard.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ export const ImageCard = memo(function ImageCard({
147147
},
148148
}}
149149
>
150-
<Box component="picture">
150+
<Box component="picture" sx={{ display: 'contents' }}>
151151
<source
152152
type="image/webp"
153153
srcSet={buildSrcSet(image.url, 'webp')}

app/src/components/SpecOverview.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ function ImplementationCard({
143143
}}
144144
>
145145
{impl.preview_url ? (
146-
<Box component="picture">
146+
<Box component="picture" sx={{ display: 'contents' }}>
147147
<source
148148
type="image/webp"
149149
srcSet={buildSrcSet(impl.preview_url, 'webp')}

0 commit comments

Comments
 (0)