#How can I change style of Anchor component so it changes color when visited?

2 messages · Page 1 of 1 (latest)

agile charm
#

The vanilla html a tag changes color when link is visited.
I tried to do something like below, so when pseudoclass visited applies, it changes color, but it still does not work. Any advice on this?

<Anchor
  href={file.fileUrl}
  target="_blank"
  rel="noreferrer"
  lineClamp={1}
  
  style={(theme) => ({

    "&:visited": {
      color: theme.colors.grape[5],
    },
  })}
  
  underline="always"
>
  {file.fileName}
</Anchor>