Skip to content

Commit 6bac8fe

Browse files
Kyle McLarenclaude
andcommitted
Match MethodHeader anchor structure to Starlight's format
Align with Starlight's exact anchor HTML structure so the custom anchor script in Head.astro can enhance all anchors uniformly with link-icon-wrapper and check-icon-wrapper. Co-Authored-By: Claude Opus 4.5 <[email protected]>
1 parent 9185198 commit 6bac8fe

File tree

1 file changed

+8
-17
lines changed

1 file changed

+8
-17
lines changed

src/components/react/api/MethodHeader.tsx

Lines changed: 8 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -109,24 +109,15 @@ export function MethodHeader({
109109
href={`#${id}`}
110110
aria-label={`Link to ${title}`}
111111
>
112-
<span className="sl-anchor-icon">
113-
<span className="link-icon-wrapper">
114-
<svg
115-
xmlns="http://www.w3.org/2000/svg"
116-
width="16"
117-
height="16"
118-
viewBox="0 0 24 24"
119-
fill="none"
120-
stroke="currentColor"
121-
strokeWidth="2"
122-
strokeLinecap="round"
123-
strokeLinejoin="round"
124-
>
125-
<path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71" />
126-
<path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71" />
127-
</svg>
128-
</span>
112+
<span aria-hidden="true" className="sl-anchor-icon">
113+
<svg width="16" height="16" viewBox="0 0 24 24">
114+
<path
115+
fill="currentcolor"
116+
d="m12.11 15.39-3.88 3.88a2.52 2.52 0 0 1-3.5 0 2.47 2.47 0 0 1 0-3.5l3.88-3.88a1 1 0 0 0-1.42-1.42l-3.88 3.89a4.48 4.48 0 0 0 6.33 6.33l3.89-3.88a1 1 0 1 0-1.42-1.42Zm8.58-12.08a4.49 4.49 0 0 0-6.33 0l-3.89 3.88a1 1 0 0 0 1.42 1.42l3.88-3.88a2.52 2.52 0 0 1 3.5 0 2.47 2.47 0 0 1 0 3.5l-3.88 3.88a1 1 0 1 0 1.42 1.42l3.88-3.89a4.49 4.49 0 0 0 0-6.33ZM8.83 15.17a1 1 0 0 0 1.1.22 1 1 0 0 0 .32-.22l4.92-4.92a1 1 0 0 0-1.42-1.42l-4.92 4.92a1 1 0 0 0 0 1.42Z"
117+
/>
118+
</svg>
129119
</span>
120+
<span className="sr-only">Section titled "{title}"</span>
130121
</a>
131122
</div>
132123
<div className="method-header-badges">

0 commit comments

Comments
 (0)