Skip to content

Commit 0384cf7

Browse files
committed
fix: doc navigation bar
1 parent 0e2ff61 commit 0384cf7

File tree

2 files changed

+3
-11
lines changed

2 files changed

+3
-11
lines changed

Diff for: src/lib/docs/NavBarItem.svelte

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
<script>
22
import CrossfadeProvider from '$lib/components/generic/crossfade/CrossfadeProvider.svelte';
33
import { createEventDispatcher, getContext } from 'svelte';
4+
import { base } from '$app/paths';
45
56
const page = getContext('navbar');
67
const dispatch = createEventDispatcher();
78
89
export let href;
9-
export let isActive = (path) => path === href;
10+
export let isActive = (path) => `${base}${path}` === href;
1011
1112
const click = (evt) => dispatch('click', evt);
1213

Diff for: src/routes/__layout.svelte

+1-10
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
{ href: `${base}/docs/examples`, text: 'Examples' },
1717
{
1818
href: `${base}/docs/theme-editor/light`,
19-
isActive: (p) => p.startsWith(`${base}/docs/theme-editor`),
19+
isActive: (p) => p.startsWith(`/docs/theme-editor`),
2020
text: 'Theme Editor'
2121
}
2222
];
@@ -57,15 +57,6 @@
5757
</NavBar>
5858
<div class="route-wrapper">
5959
<slot />
60-
<!-- Can consider re-adding this but would want to avoid transition between theme pages -->
61-
<!-- <Swappable
62-
magnitude={0.06}
63-
vertical={true}
64-
value={$page.path}
65-
getId={(path) => links.findIndex(({ href }) => path === href)}
66-
>
67-
<slot />
68-
</Swappable> -->
6960
</div>
7061
</div>
7162
</div>

0 commit comments

Comments
 (0)