mirror of
https://github.com/hanzo-docs/docs.git
synced 2026-10-25 04:20:02 +00:00
Improve heading href
This commit is contained in:
@@ -13,14 +13,15 @@ export function Heading<T extends Types = 'h1'>({
|
||||
const As = as ?? 'h1'
|
||||
|
||||
return (
|
||||
<As {...props} className={clsx('nd-group nd-scroll-m-20', props.className)}>
|
||||
{props.children}
|
||||
<a
|
||||
href={`#${props.id}`}
|
||||
aria-label="Link to section"
|
||||
className="nd-not-prose nd-opacity-0 nd-font-normal nd-ml-2 nd-transition-opacity nd-text-muted-foreground group-hover:nd-opacity-100"
|
||||
>
|
||||
#
|
||||
<As {...props} className={clsx('nd-scroll-m-20', props.className)}>
|
||||
<a href={`#${props.id}`} className="nd-group nd-not-prose">
|
||||
{props.children}
|
||||
<span
|
||||
aria-label="Link to section"
|
||||
className="nd-ml-2 nd-font-medium nd-select-none nd-text-muted-foreground nd-opacity-0 nd-transition-opacity group-hover:nd-opacity-100"
|
||||
>
|
||||
#
|
||||
</span>
|
||||
</a>
|
||||
</As>
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user