TylerBarnes / gatsby-wordpress-inline-images

Fluid images for gatsby-source-wordpress inline images in post_content
57 stars 25 forks source link

Adding wrapper styles #12

Open robinmetral opened 5 years ago

robinmetral commented 5 years ago

Hi Tyler,

I've realized that the wrapperStyle string I'm passing as an option doesn't seem to be applied.

{
  resolve: `gatsby-wordpress-inline-images`,
  options: {
    baseUrl: `mysite.com`,
    protocol: `https`,
    // sharp options
    maxWidth: 1280,
    wrapperStyle: `margin-top: 5rem;`, // <= this one
  },
},

wrapperStyle is passed to gatsby-plugin-sharp's fluid() (it's in options):

https://github.com/TylerBarnes/gatsby-wordpress-inline-images/blob/c09c4b6180652e9dd819b42851a7e4a6a7fbabfe/src/gatsby-node.js#L165-L173

However, sharp doesn't seem to take any wrapperStyle prop. I think that option is only in gatsby-remark-images. But I might be wrong!

Would it need to be implemented? Or id there something I'm doing wrong?