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

feat(gatsby-plugin-image): Add extra props to GatsbyImage #28520

Merged
merged 1 commit into from
Dec 10, 2020

Conversation

ascorbic
Copy link
Contributor

@ascorbic ascorbic commented Dec 7, 2020

This PR adds several props that were previously included in gatsby-image. I'm not 100% sure whether we should include all of them, particularly the ones that can be set using CSS. The additions are:

  • imgStyle: passed to the <img> tag
  • imgClassName: passed to the <img> tag
  • objectFit: Added to imgStyle
  • objectPosition: Added to imgStyle
  • backgroundColor: added to style, which is passed to the wrapper. This is not the same as the backgroundColor that comes from the resolver, which is applied to the placeholder, so disappears when the main image has loaded. This one is applied to the wrapper, so will remain after loading and can be used for transparent images for example.

@gatsbot gatsbot bot added the status: triage needed Issue or pull request that need to be triaged and assigned to a reviewer label Dec 7, 2020
@laurieontech laurieontech added topic: media Related to gatsby-plugin-image, or general image/media processing topics and removed status: triage needed Issue or pull request that need to be triaged and assigned to a reviewer labels Dec 7, 2020
@sidharthachatterjee sidharthachatterjee dismissed axe312ger’s stale review December 10, 2020 13:22

Seems like no change is necessary!

Copy link
Contributor

@sidharthachatterjee sidharthachatterjee left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work! Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic: media Related to gatsby-plugin-image, or general image/media processing topics
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants