Replies: 1 comment
-
Currently, there's a nice example in the https://stackblitz.com/edit/sveltejs-kit-template-default-rrj5ms?file=src/routes/Header.svelte <ul>
<li aria-current={$page.url.pathname === '/' ? 'page' : undefined}>
<a href="/">Home</a>
</li>
</ul>
<style>
li[aria-current='page'] {
/* your style here */
}
</style> |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I've been using Sveltekit (and Sapper) for a really long time, but I've been tripped up trying to figure out how to highlight based on the current pathname. The documentation seems to be missing this info, but this is common enough of a use case I think it should be covered in the documentation (e.g. page.url.pathname)
Beta Was this translation helpful? Give feedback.
All reactions