Show active state

This commit is contained in:
ernstmul committed 2025-02-03 16:27:58 +01:00
1 parent 8eecd942ed
commit bdcbc4b3aa
1 file changed
+12
+12
View File
@@ -1,5 +1,6 @@
<script lang="ts">
import { fade } from 'svelte/transition';
import { page } from '$app/stores';
import {
Icon,
Sidebar,
@@ -62,6 +63,7 @@
}
$: state = $isTabletViewport ? 'closed' : getSidebarState();
$: pathname = $page.url.pathname;
$: updateSidebarState(state);
@@ -148,6 +150,7 @@
<a
href={`/console/project-${project.$id}/${projectOption.slug}`}
class="link"
class:active={pathname.includes(projectOption.slug)}
on:click={() => {
sideBarIsOpen = false;
}}
@@ -276,6 +279,15 @@
}
}
}
.active {
background: var(--color-bgcolor-neutral-secondary, #f4f4f7);
.link-text {
color: var(--color-fgcolor-neutral-primary);
}
.link-icon {
color: var(--color-fgcolor-neutral-primary);
}
}
.icons .link {
gap: 0;