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 object-fit to image in order to prevent stretching #318

Closed
wants to merge 1 commit into from

Conversation

silvester-pari
Copy link

This PR adds object-fit: cover to images displayed in list view, in order to cover the available space and not stretch them. I considered using contain instead of cover, but it would mess up the intended layout. A user could still modify this via custom css, but I think cover is a good default setting.

Before:
image

After:
image

@m-mohr
Copy link
Collaborator

m-mohr commented May 9, 2023

Thanks. I think this should be contain as it's also the default if no width/height is provided. Why would contain mess up with the layout?

m-mohr added a commit that referenced this pull request May 10, 2023
@m-mohr
Copy link
Collaborator

m-mohr commented May 10, 2023

Thanks for the PR. I went for object-fit: contain; object-position: right; as this is in-line with what is done by default without image dimensions set. As you said, implementations can override it easily.

@m-mohr m-mohr closed this May 10, 2023
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.

2 participants