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

Images not showing on fresh install #8

Open
vinayraghu opened this issue Mar 14, 2021 · 1 comment
Open

Images not showing on fresh install #8

vinayraghu opened this issue Mar 14, 2021 · 1 comment

Comments

@vinayraghu
Copy link

vinayraghu commented Mar 14, 2021

First of all, thank you for building such a great starter. It has been an amazing journey.

I am having trouble with gatsby-inline-image not respecting the parent containers width or height.

Steps

  • Clone repo
  • Point gatsby-source-wordpress at my local Wordpress instance (local by flywheel)
  • Unrelated? Added process.env.NODE_TLS_REJECT_UNAUTHORIZED=0 in gatsby-node.js)
  • Add tailwind as per docs and some custom CSS
  • Run gatsby-develop

Expected (on mobile)

Screen Shot 2021-03-14 at 12 33 05 AM

Actual (on Mobile)

Image too wide, going beyond 100% viewport and causing a horizontal scroll bar.

Screen Shot 2021-03-14 at 12 44 47 AM

Notes

  • Updated all plugins to latest version
  • Wordpress side is perfectly fine so it has to be something on the gatsby image transformation
@vinayraghu
Copy link
Author

vinayraghu commented Mar 14, 2021

I figured out the issue but I am not sure if it's my problem or its common enough to be addressed. I needed to wrap all my images on my wordpress templates in a div and used the following CSS to solve.

Gatsby inline image wrapper was setting width: 1024px even on mobile but the max-width: 100% was not being applied.

I'll let you decide if you want to close this issue. Thanks again for the great starter!

.my-image-container .inline-gatsby-image-wrapper {
  width: 100% !important;
}

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

1 participant