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

Image in card #21

Open
jimmieego opened this issue May 25, 2020 · 2 comments
Open

Image in card #21

jimmieego opened this issue May 25, 2020 · 2 comments

Comments

@jimmieego
Copy link

It would be great to change the image in the card from object-fit: cover to object-fit: contain.

@nehalist
Copy link
Owner

nehalist commented Jul 4, 2020

The feature image doesn't even use object-fit: cover

export const FeaturedImage = styled(Img)<Pick<CardProps, 'halfImage'>>`
background-position: center;
background-size: cover;
max-width: 100%;
border-top-left-radius: 3px;
${props => props.halfImage ? `
width: 50%;
float: left;
margin-right: 30px;
height: 320px;
border-bottom-left-radius: 3px;
@media (max-width: ${Theme.breakpoints.sm}) {
width: 100%;
float: none;
height: 190px;
}
` : `
height: 190px;
max-height: 190px;
width: 100%;
border-top-right-radius: 3px;
`};
`;

Or am I missing something here?

@jimmieego
Copy link
Author

Sorry. To clarify, if you inspect the image in the card in devtools, you will see something like this:

<img src="data:image..." 
  alt="" 
  style="position: absolute; top: 0px; left: 0px; width: 100%; height: 100%; 
object-fit: cover; object-position: center center; opacity: 0; transition-delay: 500ms;">

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

No branches or pull requests

2 participants