Skip to content

Commit 6f4f251

Browse files
committed
fix: extra spacing on navbar links
1 parent 6a078ba commit 6f4f251

File tree

3 files changed

+10
-4
lines changed

3 files changed

+10
-4
lines changed

src/components/layout/NavBar.astro

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ import LogoMarkerLight from "@/assets/brand/logo-marker-light.svg";
2121
</a>
2222
<div
2323
id="nav-menu"
24-
class="bg-background-light-10 dark:bg-background-dark-90 absolute top-full right-0 left-0 flex w-full flex-col gap-4 p-4 shadow-xl max-md:hidden! md:relative md:block md:w-auto md:bg-transparent md:p-0 md:shadow-none"
24+
class="bg-background-light-10 dark:bg-background-dark-90 absolute top-full right-0 left-0 flex w-full flex-col gap-4 p-4 shadow-xl max-md:hidden! md:relative md:flex md:w-auto md:flex-row md:items-center md:gap-0 md:bg-transparent md:p-0 md:shadow-none"
2525
>
2626
<NavDropDown label="Software">
2727
<NavDropDownLink href="/software/paper">Paper</NavDropDownLink>

src/components/layout/NavDropDown.astro

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,9 @@ const { label, className } = Astro.props;
1212

1313
<div
1414
class={clsx(
15-
"color-gray-200 hover:text-blue-600 dark:hover:text-blue-400 text-sm transition-colors px-2.5 relative inline-block",
15+
"color-gray-200 hover:text-blue-600 dark:hover:text-blue-400 text-sm transition-colors px-2.5 relative h-full",
16+
"md:flex md:items-center",
17+
"md:after:content-[''] md:after:absolute md:after:left-0 md:after:top-full md:after:h-2 md:after:w-full",
1618
className
1719
)}
1820
data-nav-dropdown
@@ -29,8 +31,8 @@ const { label, className } = Astro.props;
2931
</span>
3032

3133
<ul
32-
class="bg-background-light-10 dark:bg-background-dark-90 z-[100] hidden md:absolute md:mt-0 md:min-w-40 md:rounded-lg md:border md:border-gray-200 md:py-1 md:shadow-md md:dark:border-gray-800"
3334
role="menu"
35+
class="bg-background-light-10 dark:bg-background-dark-90 z-[100] hidden md:absolute md:top-full md:left-0 md:min-w-40 md:translate-y-1 md:rounded-lg md:border md:border-gray-200 md:py-1 md:shadow-md md:dark:border-gray-800"
3436
>
3537
<slot />
3638
</ul>

src/components/layout/NavLink.astro

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,11 @@ const { href, target, className } = Astro.props;
1414
href={href}
1515
rel="noreferrer"
1616
target={target}
17-
class={clsx("color-gray-200 hover:text-blue-600 dark:hover:text-blue-400 text-sm transition-colors px-2.5", className)}
17+
class={clsx(
18+
"color-gray-200 hover:text-blue-600 dark:hover:text-blue-400 text-sm transition-colors px-2.5",
19+
"md:inline-flex md:items-center",
20+
className
21+
)}
1822
>
1923
<slot />
2024
</a>

0 commit comments

Comments
 (0)