update for toc anchor links

This commit is contained in:
Daniel Fichtinger 2025-07-11 14:47:53 -04:00
parent edeb2fb9ac
commit e04a587e8f
3 changed files with 44 additions and 4 deletions

View file

@ -17,6 +17,46 @@ body {
padding-left: calc(100vw - 100%);
}
.toclink {
position: relative;
text-decoration: none;
color: inherit;
}
.toclink::before {
content: "#";
position: absolute;
right: 100%;
margin-right: 0.25em;
top: 50%;
transform: translateY(-50%);
opacity: 0;
transition: opacity 0.2s ease;
}
h1 .toclink::before {
content: "#";
}
h2 .toclink::before {
content: "#";
}
h3 .toclink::before {
content: "##";
}
h4 .toclink::before {
content: "###";
}
.toclink:hover::before {
opacity: 1;
}
.toclink:hover {
background-color: transparent;
}
/* h1, */
h2,
h3,
@ -130,7 +170,7 @@ pre {
white-space: pre;
word-wrap: break-word;
overflow-wrap: break-word;
font-family: 'Fira Code', 'Consolas', 'Courier New', monospace;
font-family: monospace;
font-size: 0.95em;
}
@ -283,7 +323,7 @@ tbody tr:hover {
}
table code {
font-family: 'Fira Code', 'Consolas', monospace;
font-family: monospace;
font-size: 0.85em;
background: #1d1d1d;
padding: 0.1em 0.25em;