code: function scrollToElementId(id) {
    const el = document.querySelector(id)
    if (el) {
      return window.scrollTo(0, el.offsetTop - 20)
    } else {
      return false
    }
  }
docs: Adapted from https://github.com/gatsbyjs/gatsby/issues/8413