Update heading component
All checks were successful
Build And Publish / BuildAndPublish (push) Successful in 3m15s

This commit is contained in:
Ryan Freeman 2025-03-27 14:42:41 +00:00
parent a1943ebbf3
commit 55d34565f2

View File

@ -11,10 +11,9 @@ export function Heading({as: Component = 'h1', children = null}: HeadingProps) {
let headingText = children ? children.toString() : ''
return (
<Component id={createSlug(headingText)} className="group">
<Component id={createSlug(headingText)} className="flex group">
{children}
<Link className="ml-1.5 group-hover:visible invisible"
href={`#${createSlug(headingText)}`}>#</Link>
<Link className="sr-only group-hover:not-sr-only !ml-1.5" href={`#${createSlug(headingText)}`}>#</Link>
</Component>
)
}