Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add next/image props for object-fit and object-position #18794

Closed
styfle opened this issue Nov 4, 2020 · 1 comment · Fixed by #18849
Closed

Add next/image props for object-fit and object-position #18794

styfle opened this issue Nov 4, 2020 · 1 comment · Fixed by #18849
Assignees
Milestone

Comments

@styfle
Copy link
Member

styfle commented Nov 4, 2020

Feature request

Problem

When using layout=fill, you usually want to avoid stretching the image.

So its common to use object-fit and object-position CSS.

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.

Related

@balazsorban44
Copy link
Member

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 vercel locked as resolved and limited conversation to collaborators Jan 29, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants