feat: add heading anchor links

This commit is contained in:
robin committed 2026-08-05 12:52:20 +02:00
1 parent e403677a71
commit bf8e78d0ba
4 files changed
+87

No files matched your search

+26
View File
@@ -129,4 +129,30 @@ figure[data-rehype-pretty-code-figure] pre {
overflow-x: auto;
font-size: 0.875rem;
line-height: 1.7;
}
h1, h2, h3, h4, h5, h6 {
scroll-margin-top: 5rem; /* <-- Höhe deines Headers + etwas Abstand */
}
html {
scroll-behavior: smooth;
}
/* Anchor-Link Styling */
.heading-anchor {
opacity: 0;
margin-right: 1em; /* Abstand zum nachfolgenden Text */
color: #3b82f6; /* Tailwind blue-500 */
text-decoration: none;
font-weight: 800;
transition: opacity 0.15s ease-in-out;
}
h1:hover .heading-anchor,
h2:hover .heading-anchor,
h3:hover .heading-anchor,
h4:hover .heading-anchor,
.heading-anchor:focus {
opacity: 1;
}