Adds Chakra theme tokens, hero background, and animated nav underline
Defines bg/fg semantic tokens and heading/body font tokens (Marcellus + Jost), sets the hero image as the page background, and gives NavigationBar's links a hover/active underline that mirrors the design's left-to-right wipe animation.
This commit is contained in:
@@ -0,0 +1,43 @@
|
||||
import { chakra } from '@chakra-ui/react';
|
||||
import { Link } from '@tanstack/react-router';
|
||||
|
||||
const ChakraLink = chakra(Link);
|
||||
|
||||
type NavLinkProps = React.ComponentProps<typeof ChakraLink>;
|
||||
|
||||
export default function NavLink({ children, ...props }: NavLinkProps) {
|
||||
return (
|
||||
<ChakraLink
|
||||
textTransform="uppercase"
|
||||
fontWeight="300"
|
||||
fontSize="0.72rem"
|
||||
letterSpacing="0.22em"
|
||||
position="relative"
|
||||
display="inline-block"
|
||||
py="2"
|
||||
mx="4"
|
||||
css={{
|
||||
'&::after': {
|
||||
content: '""',
|
||||
position: 'absolute',
|
||||
left: 0,
|
||||
bottom: 0,
|
||||
width: '100%',
|
||||
height: '1px',
|
||||
bg: 'currentColor',
|
||||
transform: 'scaleX(0)',
|
||||
transformOrigin: 'right',
|
||||
transition: 'transform 0.45s cubic-bezier(.22,.61,.36,1)',
|
||||
},
|
||||
'&:hover::after, &:focus-visible::after, &[aria-current="page"]::after':
|
||||
{
|
||||
transform: 'scaleX(1)',
|
||||
transformOrigin: 'left',
|
||||
},
|
||||
}}
|
||||
{...props}
|
||||
>
|
||||
{children}
|
||||
</ChakraLink>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user