theme: Hide anchor until mouse-over

Fixes #2982
This commit is contained in:
Bjørn Erik Pedersen
2025-03-09 16:33:34 +01:00
parent c933ea237e
commit 8988704383
2 changed files with 2 additions and 1 deletions
+1
View File
@@ -11,6 +11,7 @@ export const navbar = (Alpine) => ({
let els = contentEl.querySelectorAll('h2[id], h3[id], h4[id], h5[id], h6[id], dt[id]');
for (let i = 0; i < els.length; i++) {
let el = els[i];
el.classList.add('group');
let a = anchorTemplate.content.cloneNode(true).firstElementChild;
a.href = '#' + el.id;
el.appendChild(a);
+1 -1
View File
@@ -1,5 +1,5 @@
<template id="anchor-heading">
<a class="inline-flex items-center" aria-label="Anchor">
<a class="hidden group-hover:inline-flex items-center" aria-label="Anchor">
<svg class="ml-2 fill-primary hover:fill-primary/70 w-4 h-4">
<use href="#icon--anchor"></use>
</svg>