Custom sizes attribute with gatsby-image (by a Gatsby newbie)

  • Image optimization
  • Lazy loading
  • Base64 encoded placeholders
<Img fluid={post.featured_media.localFile.childImageSharp.fluid} />

How to change the sizes attribute?

--

--

--

Web developer who makes fast WordPress sites with clean code and awesome backends. Also, JavaScript is nice!

Love podcasts or audiobooks? Learn on the go with our new app.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Stefan Ledin

Stefan Ledin

Web developer who makes fast WordPress sites with clean code and awesome backends. Also, JavaScript is nice!

More from Medium

Let’s build a fresh project

Optimize your bundle size by eliminating dead code / tree-shaking in Webpack

React vs Anguar.js: What’s the Future JavaScript framework for app development.

How to set a global timeout for @testing-library async methods