Skip to content

Commit 70ea26e

Browse files
authored
feat: Make MD headers clickable (#6529)
* feat: Make MD headers clickable * Reformat code in the mdx config * Reformat styles
1 parent 682912d commit 70ea26e

2 files changed

Lines changed: 13 additions & 4 deletions

File tree

next.mdx.mjs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,7 @@ export const NEXT_REHYPE_PLUGINS = [
1717
// Generates `id` attributes for headings (H1, ...)
1818
rehypeSlug,
1919
// Automatically add anchor links to headings (H1, ...)
20-
[
21-
rehypeAutolinkHeadings,
22-
{ properties: { ariaHidden: true, tabIndex: -1, class: 'anchor' } },
23-
],
20+
[rehypeAutolinkHeadings, { behavior: 'wrap' }],
2421
// Transforms sequential code elements into code tabs and
2522
// adds our syntax highlighter (Shikiji) to Codeboxes
2623
rehypeShikiji,

styles/markdown.css

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,18 @@ main {
3434
@apply text-base;
3535
}
3636

37+
h1,
38+
h2,
39+
h3,
40+
h4,
41+
h5,
42+
h6 {
43+
&[id] a {
44+
@apply text-neutral-900
45+
dark:text-white;
46+
}
47+
}
48+
3749
h1,
3850
h2,
3951
h3,

0 commit comments

Comments
 (0)