You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
However, since the style prop is omitted from the underlying <img>, you currently must use CSS modules via the className prop.
Solution
This is a proposal to add separate props to the Image component for objectFit and objectPosition as a way to inline these common styles without using the style prop.
This issue has been automatically locked due to no recent activity. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you.
vercel
locked as resolved and limited conversation to collaborators
Jan 29, 2022
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Feature request
Problem
When using
layout=fill
, you usually want to avoid stretching the image.So its common to use
object-fit
andobject-position
CSS.However, since the
style
prop is omitted from the underlying<img>
, you currently must use CSS modules via theclassName
prop.Solution
This is a proposal to add separate props to the Image component for
objectFit
andobjectPosition
as a way to inline these common styles without using thestyle
prop.Related
next/image
layout modes #18637The text was updated successfully, but these errors were encountered: