feat: add heading anchor links
This commit is contained in:
1 parent
e403677a71
commit
bf8e78d0ba
4 files changed
+87
No files matched your search
@@ -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;
|
||||
}
|
||||
Reference in new issue
Block a user