1
mirror of https://github.com/jakejarvis/jarv.is.git synced 2026-06-30 22:25:58 -04:00

do sub-heading anchor links manually instead of via rehype plugin

This commit is contained in:
2022-01-22 17:21:29 -05:00
parent 7b01f01c9d
commit f62c057f5d
5 changed files with 132 additions and 303 deletions
+6 -6
View File
@@ -19,23 +19,23 @@
}
/* sub-heading anchor styles */
.heading :global(.h-anchor) {
.anchor {
margin: 0 0.25em;
padding: 0 0.25em;
color: var(--medium-light);
background: none;
font-weight: 300;
background: none;
transition: none;
opacity: 0; /* overridden on hover */
user-select: none;
}
.heading :global(.h-anchor::before) {
.anchor::before {
content: "\0023"; /* pound sign `#`, done here to keep content DOM cleaner */
}
.heading :global(.h-anchor:hover) {
.anchor:hover {
color: var(--link);
}
/* make anchor `#` link show up on hover over the corresponding heading */
.heading:hover :global(.h-anchor) {
.heading:hover .anchor {
opacity: 1;
}