Skip to content

Commit

Permalink
Merge pull request #9 from taxepfa/dev
Browse files Browse the repository at this point in the history
Improve nav link colors
  • Loading branch information
icflorescu authored Sep 30, 2023
2 parents 17c327b + 534386e commit dc6c77a
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 32 deletions.
3 changes: 2 additions & 1 deletion components/Header.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,8 @@

@media (pointer: fine) {
&:hover {
color: var(--mantine-color-blue-light-color);
color: light-dark(var(--mantine-color-black), var(--mantine-color-white));
text-decoration: underline;
}
}
}
Expand Down
29 changes: 5 additions & 24 deletions components/NavLink.module.css
Original file line number Diff line number Diff line change
@@ -1,26 +1,7 @@
.root {
position: relative;

&::after {
content: '';
position: absolute;
height: rem(4px);
left: rem(2px);
width: calc(100% - rem(2px));
background: light-dark(var(--mantine-color-gray-3), var(--mantine-color-dark-4));
top: rem(-8px);
transform: scaleY(0);
transform-origin: top;
transition: all 0.2s ease;

@media (min-width: $mantine-breakpoint-xs) {
transform-origin: bottom;
top: auto;
bottom: rem(-8px);
}
.current {
&,
&:focus,
&:not(:hover) {
color: light-dark(var(--mantine-color-blue-8), var(--mantine-color-blue-4));
}
}

.current::after {
transform: scaleY(1);
}
10 changes: 3 additions & 7 deletions components/NavLink.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,9 @@ export function NavLink({ className, textClassName, href, icon, text }: NavLinkP
<Link href={href} passHref legacyBehavior>
<Box
component="a"
className={clsx(
classes.root,
{
[classes.current]: href === usePathname(),
},
className
)}
className={clsx(className, {
[classes.current]: href === usePathname(),
})}
>
{icon}
<div className={textClassName}>{text}</div>
Expand Down

0 comments on commit dc6c77a

Please sign in to comment.