feat: add active state underline to nav
Some checks failed
Deploy to SFTP Server / build (push) Has been cancelled

This commit is contained in:
max_richter 2024-04-06 16:28:10 +02:00
parent 7b7e02ad28
commit d1c4d505fe

View File

@ -4,7 +4,7 @@ import Logo from "./Logo.astro";
import ToggleTheme from "@components/ThemeToggle.svelte"; import ToggleTheme from "@components/ThemeToggle.svelte";
function isActive(path: string) { function isActive(path: string) {
return Astro.url.pathname === path ? "active" : ""; return Astro.url.pathname === path;
} }
const t = useTranslations(Astro.url); const t = useTranslations(Astro.url);
@ -47,7 +47,7 @@ const paths = [
<li <li
class={` class={`
flex items-center flex-1 border-t-1 border-b-1 border-neutral flex items-center flex-1 border-t-1 border-b-1 border-neutral
${isActive(link) ? "bg-light" : "bg"} ${isActive(link) ? "bg-light underline" : "bg"}
${i === 0 ? "rounded-bl-md border-l-1" : "border-l-1"} ${i === 0 ? "rounded-bl-md border-l-1" : "border-l-1"}
${i === paths.length - 1 ? "rounded-tr-md !border-r-1" : ""} ${i === paths.length - 1 ? "rounded-tr-md !border-r-1" : ""}
`} `}