Home page image aspect ratio#51
Merged
Merged
Conversation
Co-authored-by: me <me@kentcdodds.com>
|
Cursor Agent can help with this pull request. Just |
Co-authored-by: me <me@kentcdodds.com>
| src="/images/smiling-phone-flowers.jpg" | ||
| alt="Smiling person holding flowers and a phone" | ||
| width={2560} | ||
| height={1707} |
There was a problem hiding this comment.
Image aspect ratio attributes conflict with CSS class
Medium Severity
The added width={2560} and height={1707} attributes represent a 3:2 aspect ratio, but the CSS class includes aspect-square which enforces a 1:1 ratio. The CSS aspect-ratio property takes precedence over intrinsic dimensions, so these attributes won't achieve the stated goal of reserving 3:2 space during page load. The width/height values need to match the actual displayed ratio (1:1) for the layout shift prevention to work correctly.
|
Bugbot Autofix resolved the bug found in the latest run.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


Adds an explicit aspect ratio to the home page hero image to prevent layout shift during initial page load.
Test Plan
Manually reload the home page (
http://localhost:3000) and observe that the hero image reserves the correct space immediately, without layout shifts.Checklist
Screenshots
Hero image reserves 3:2 space on load.

Hero section with updated image ratio.Note
Low Risk
Small, presentation-only change to a single static image; minimal risk beyond potential unintended visual sizing differences.
Overview
Adds explicit
widthandheightattributes to the marketing home page hero<img>(app/routes/_app+/_marketing+/index.tsx) so the browser can reserve space up front and avoid layout shift during initial render.Written by Cursor Bugbot for commit 3dab2e2. This will update automatically on new commits. Configure here.