Skip to content

Commit

Permalink
preload data on hover by default (#97)
Browse files Browse the repository at this point in the history
  • Loading branch information
Rich-Harris authored Sep 25, 2024
1 parent a725bc1 commit 86a4348
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 8 deletions.
2 changes: 1 addition & 1 deletion apps/svelte.dev/src/app.html
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@

%sveltekit.head%
</head>
<body data-sveltekit-preload-code="hover">
<body data-sveltekit-preload-data="hover">
<script>
const themeValue = JSON.parse(localStorage.getItem('svelte:theme'))?.current;
const systemPreferredTheme = window.matchMedia('(prefers-color-scheme: dark)').matches
Expand Down
7 changes: 1 addition & 6 deletions packages/site-kit/src/lib/docs/DocsContents.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,7 @@
<ul>
{#each section.children as { metadata, slug }}
<li>
<a
data-sveltekit-preload-data
class="page"
class:active={`/${slug}` === $page.url.pathname}
href="/{slug}"
>
<a class="page" class:active={`/${slug}` === $page.url.pathname} href="/{slug}">
{metadata.title}
</a>
</li>
Expand Down
1 change: 0 additions & 1 deletion packages/site-kit/src/lib/search/SearchResultList.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@
{#each results as result (result.href)}
<li>
<a
data-sveltekit-preload-data
href={result.href}
onclick={() => onselect?.(result.href)}
data-has-node={result.node ? true : undefined}
Expand Down

0 comments on commit 86a4348

Please sign in to comment.