From d92317f6b358795804ae8542c56d9133098b2da4 Mon Sep 17 00:00:00 2001 From: mrkvon Date: Fri, 20 Feb 2026 00:51:37 +0100 Subject: [PATCH] feat: add fragment links to term definitions This should make them easier to reference. --- glossary-utils.js | 2 +- glossary.css | 23 +++++++++++++++++++++++ 2 files changed, 24 insertions(+), 1 deletion(-) diff --git a/glossary-utils.js b/glossary-utils.js index c4a63bb..d281ff4 100644 --- a/glossary-utils.js +++ b/glossary-utils.js @@ -87,7 +87,7 @@ function md2rdfa(markdownString,conceptScheme,cssPath){ typeof="skos:Concept" rel="skos:broader" resource="#${headerUrl}" property="skos:prefLabel" - >${head} + >${head}
${body}
diff --git a/glossary.css b/glossary.css index 997d9f7..7cf1ea5 100644 --- a/glossary.css +++ b/glossary.css @@ -86,3 +86,26 @@ dd { --section-term-size: 120%; } } + +/* definition fragment links */ + +dfn { + position: relative; +} + +dfn a { + color: inherit; +} + +dfn a::before { + content: '#'; + position: absolute; + right: 100%; + opacity: 0; + padding-right: 0.25rem; + color: var(--link-color); +} + +dfn a:hover::before { + opacity: 1; +}