title: Sapper: CSS smooth scrolling for anchor links has unwanted impact on route links
body: <p>In a Sapper application, I'm using CSS smooth scrolling for a better effect when navigating with anchor links within a given page (route):</p>
  <pre class="lang-css prettyprint-override"><code>html {
    scroll-behavior: smooth
  }
  </code></pre>
  <p>However, this causes navigation to other routes to behave in an unwanted manner: instead of being reset to the top of the page, the scroll position remains unchanged from the previous route (in Firefox). (In Chrome, same thing, but the page then smoothly scrolls back to top.)</p>
  <p>I understand that this is because of how Sapper works, but is there a known solution allowing to use CSS smooth scroll (for anchor links) while having route navigation work &quot;as expected&quot; and go directly to the top of the page on load?</p>
  <p>Live example here: <a href="https://www.cinematheque.fr/henri/" rel="nofollow noreferrer">https://www.cinematheque.fr/henri/</a>. <code>html { scroll-behavior: smooth; }</code> is commented out, you can activate it in the devtools. The block under the title is a bunch of anchor links.</p>