Skip to content

fix(image): stop forcing object-fit on fill images - #3237

Open
JamesbbBriz wants to merge 1 commit into
cloudflare:mainfrom
JamesbbBriz:fix/image-fill-object-fit-parity
Open

fix(image): stop forcing object-fit on fill images#3237
JamesbbBriz wants to merge 1 commit into
cloudflare:mainfrom
JamesbbBriz:fix/image-fill-object-fit-parity

Conversation

@JamesbbBriz

@JamesbbBriz JamesbbBriz commented Sep 11, 2026

Copy link
Copy Markdown
Contributor

Next.js builds its fill imgStyle from the legacy objectFit prop (usually undefined) and never sets an inline object-fit, leaving the value to the caller's style or stylesheet (get-img-props.js assigns style last). vinext hardcoded objectFit: "cover", so fill images that need contain (logos, diagrams) rendered cropped even though passing objectFit through style is the documented pattern.

Drops the hardcoded value so fill parity holds: the legacy objectFit prop still flows through style, explicit styles still win, and blur placeholder backgrounds keep their own cover sizing independent of this path.

Fixes #3238

Next.js builds its fill imgStyle from the legacy objectFit prop (usually
undefined) and never sets an inline object-fit, leaving the value to the
caller's style or stylesheet. vinext hardcoded objectFit: "cover", so
fill images that need contain (logos, diagrams) rendered cropped from
both top and bottom even though the docs pattern of passing objectFit
through style is the supported escape hatch.

Drop the hardcoded value so fill parity holds: the legacy objectFit prop
still flows through style, explicit styles still win, and blur
placeholder backgrounds keep their own cover sizing independent of this
path.
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, add credits to your account and enable them for code reviews in your settings.

@pkg-pr-new

pkg-pr-new Bot commented Sep 11, 2026

Copy link
Copy Markdown

Open in StackBlitz

npm i https://pkg.pr.new/@vinext/cloudflare@3237
npm i https://pkg.pr.new/create-vinext-app@3237
npm i https://pkg.pr.new/@vinext/types@3237
npm i https://pkg.pr.new/vinext@3237

commit: 07747c5

@github-actions

Copy link
Copy Markdown
Contributor

Performance benchmarks

Compared 07747c5 against base 13e7d9c using alternating same-runner rounds. Next.js was unchanged and skipped.

0 improved · 0 regressed · 6 within ±1.5%

Scenario Framework Baseline Current Change
Client bundle size (gzip) vinext 142.4 KB 142.4 KB ⚫ -0.0%
Client entry size (gzip) vinext 129.7 KB 129.7 KB ⚫ -0.0%
Dev server cold start vinext 3.37 s 3.34 s ⚫ -0.9%
Production build time vinext 3.73 s 3.73 s ⚫ +0.1%
RSC entry closure size (gzip) vinext 125.4 KB 125.4 KB ⚫ +0.0%
Server bundle size (gzip) vinext 216.1 KB 216.1 KB ⚫ +0.0%

View detailed results and traces

🟢 improvement · 🔴 regression · ⚫ change below 1.5% · paired base/head

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

next/image with fill crops images that should use object-fit: contain — inline cover overrides caller intent

1 participant