Skip to content

Commit

Permalink
💄 use absolute position to make margin for navbar dropdown
Browse files Browse the repository at this point in the history
  • Loading branch information
StarHeartHunt committed Sep 22, 2024
1 parent 4a11f9a commit 5248dbb
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@

/* navbar item */
&-item {
@apply flex items-center text-base-content font-medium opacity-75 !bg-transparent;
@apply flex items-center text-base-content font-medium opacity-75;

&:hover {
@apply opacity-100;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,11 @@ function DocsMenuDropdownNavbarItemDesktop({
aria-haspopup="true"
role="button"
to={link}
className={clsx("menu-link", isActive && "menu-link-active", className)}
className={clsx(
"menu-link menu-item",
isActive && "menu-link-active",
className,
)}
activeClassName={clsx("menu-link-active", activeClassName)}
{...props}
>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ function DropdownNavbarItemDesktop({
role="button"
isNavLink
href={props.to ? undefined : "#"}
className={clsx("menu-link", className)}
className={clsx("menu-link menu-item", className)}
activeClassName={clsx("menu-link-active", activeClassName)}
{...props}
onClick={props.to ? undefined : (e) => e.preventDefault()}
Expand Down
5 changes: 1 addition & 4 deletions packages/theme-nonepress/src/theme/NavbarItem/styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,14 @@
&-content {
@apply rounded-md bg-base-100 shadow-lg border border-base-200;
@apply w-max z-10 m-0 left-1/2 -translate-x-1/2;
@apply absolute !top-[calc(100%+0.25rem)];
}
}

/* docs menu */
&-docs-menu {
&-content {
@apply block w-[28rem] xl:w-[36rem] 2xl:w-[48rem] pl-0 overflow-hidden whitespace-normal;

&::before {
@apply content-none;
}
}

&-docs {
Expand Down

0 comments on commit 5248dbb

Please # to comment.