Skip to content

Commit

Permalink
Fix styling of visited outgoing links
Browse files Browse the repository at this point in the history
Change color of icon inside link depending on state of the link.
  • Loading branch information
mpanne committed Mar 3, 2025
1 parent 25259a7 commit dc77197
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions packages/shared/components/RichText.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,11 @@ const RichText = ({
const newLinkHtml = linkHtml
.replace(
/^<a /,
`<a target="_blank" aria-describedby=${A11Y_MESSAGE_NEW_WINDOW} rel="noopener noreferrer" `,
`<a target="_blank" aria-describedby=${A11Y_MESSAGE_NEW_WINDOW} rel="noopener noreferrer" class="group"`,
)
.replace(
`>${token.text}<`,
`>${token.text} ${openInNewIconString}<`,
`>${token.text}${openInNewIconString}<`,
);

return newLinkHtml;
Expand Down
2 changes: 1 addition & 1 deletion packages/shared/components/openInNewWindow.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@ export const openInNewIconString = ReactDOMServer.renderToString(
<OpenInNewIcon
height="1.2em"
width="1.2em"
className="mb-1 ml-[0.2rem] !inline fill-blue-800"
className="mb-1 ml-[0.2rem] !inline fill-blue-800 group-visited:fill-[#4c2c92]"
/>,
);

0 comments on commit dc77197

Please sign in to comment.