Skip to content

Typings on PsuedoProps #2161

Answered by ozimos
ozimos asked this question in Q&A
Discussion options

You must be logged in to vote

The correct way to write css styles is by using the sx prop

export default function NavItem({ children, href, ...rest }: LinkProps) {
  return (
    <Link
      href={href}
      sx={{
        "&:hover>p::after": {
          width: "100%",
        },
      }}
      {...rest}
    >
      <Text
        fontSize="md"
        textTransform="uppercase"
        mx={["10px", "20px"]}
        pos="relative"
        _after={{
          content: '""',
          h: "2px",
          w: 0,
          pos: "absolute",
          bottom: 0,
          left: 0,
          bg: "linear-gradient(to right, #6372ff 0%, #5ca9fb 100%)",
          transition: "width 0.2s",
        }}
      >
        {children}
      </

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by ozimos
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant