Automattic / Automattic/jetpack

Related posts block thumbnails appears slightly distorted in some viewport widths

Open
#31,269 4 comments 0 reactions 0 assignees View on GitHub
[Block] Related Posts [Feature] Related Posts [Focus] FSE [Plugin] Jetpack [Pri] Low [Status] Stale Bug Customer Report [LEGACY] Triaged
Dominant language
PHP
Stars
1.8k
Forks
898
Avg merge
1d 18h
Merged PRs (30d)
774

Description

### Quick summary

The featured image block crops the images automatically to be 350px wide by 200px tall (1.75:1 ratio).

However, in some specific viewport widths the images appear slightly distorted:

https://github.com/Automattic/wp-calypso/assets/4965723/b0618fc5-5840-4027-9e88-9cce82374379

### Steps to reproduce

1. Activate Payton.
2. Add a Related Posts block to the Single template.
3. Visit a post.
4. Use the browser developer tools to see the mobile view. Set it to responsive.
5. Adjust the viewport width until you see a distortion in the thumbnails.

### What you expected to happen

The image should not be distorted regarding of the screen size.

### What actually happened

Thumbnails are slightly distorted in some viewport widhts.

### Impact

One

### Available workarounds?

Yes, easy to implement

### Platform (Simple and/or Atomic)

_No response_

### Logs or notes

Context: 6363582-zd-woothemes

Workaround (tested in Payton):

/* Set height for featured images in Related Posts block */

.jp-related-posts-i2__post-img-link img {
height:100%;
}

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the Related Posts block in the Single template with Payton at responsive viewport widths, then inspect the featured-image markup and styles, including the .jp-related-posts-i2__post-img-link img selector. Done means thumbnails keep their intended proportions without distortion across the affected widths.

Written by the indexing model from the issue text.

Assessment

Tech stack
css, wordpress
Domain
design, frontend
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.