diff --git a/frontend/src/routes/+layout.svelte b/frontend/src/routes/+layout.svelte index 332a239..cb06b68 100644 --- a/frontend/src/routes/+layout.svelte +++ b/frontend/src/routes/+layout.svelte @@ -18,6 +18,14 @@ const ticker = 'CONSUME · SPEND · ACCUMULATE · YOU DESERVE IT · TREAT YOURSELF · ONE MORE WON’T HURT · DEBT IS A LIFESTYLE · '; + + // Mark a tab active when the current path matches (or sits under) its href. + const path = $derived(page.url.pathname); + function active(href: string): boolean { + return href === '/lists' + ? path === '/lists' || path.startsWith('/lists/') + : path === href || path.startsWith(href + '/'); + }