Skip to content

Commit

Permalink
Use w-auto instead of object-contain (#3230)
Browse files Browse the repository at this point in the history
## Description

There was a bug in #3228 that caused the placeholder to be larger than
the image. For some reason, the dev preview does not show the blurred
placeholder.

left is dev, right is after static site generation (SSG). 

<img width="2672" alt="image"
src="https://github.com/user-attachments/assets/d16f48b8-a6e7-4b45-9a1c-667c0f01240f">

This PR fixes this by adding `w-auto`. This will automatically resize
the width to maintain aspect ratio with the height. Because of this, we
can remove object-contain. object-contain was used to prevent image
stretching.

Before/after:
<img width="2531" alt="image"
src="https://github.com/user-attachments/assets/c50defd3-09d1-4763-a63e-9e77658afc7d">

## Checklist
- [x] I have read and understood the [WATcloud
Guidelines](https://cloud.watonomous.ca/docs/community-docs/watcloud/guidelines)
- [x] I have performed a self-review of my code
  • Loading branch information
ben-z authored Sep 23, 2024
1 parent dabcc46 commit cddfd22
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion components/blog-post.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ export function BlogPostHeader() {
<Picture
image={titleImage}
alt={titleImageAttribution}
imgClassName='max-h-96 object-contain'
imgClassName='max-h-96 w-auto'
/>
</PopoverTrigger>
<PopoverContent side='bottom' className="w-96 max-w-full">
Expand Down

0 comments on commit cddfd22

Please sign in to comment.