diff options
author | johannst <johannst@users.noreply.github.com> | 2025-04-09 22:28:27 +0000 |
---|---|---|
committer | johannst <johannst@users.noreply.github.com> | 2025-04-09 22:28:27 +0000 |
commit | 4a9214d09d6a526bd029a1f92a01a5f451313c9a (patch) | |
tree | 2a4134ffb9b7f1d4cf6eee7e9305125cc878ce1c /css/general.css | |
parent | 2cad8341019659a65fc6e94992165b3d7b7a37db (diff) | |
download | notes-4a9214d09d6a526bd029a1f92a01a5f451313c9a.tar.gz notes-4a9214d09d6a526bd029a1f92a01a5f451313c9a.zip |
deploy: 773d9b46ee3b1b88a94e69f42ea42654c63c48ec
Diffstat (limited to 'css/general.css')
-rw-r--r-- | css/general.css | 53 |
1 files changed, 44 insertions, 9 deletions
diff --git a/css/general.css b/css/general.css index 49e7267..9946cfc 100644 --- a/css/general.css +++ b/css/general.css @@ -200,18 +200,53 @@ sup { line-height: 0; } -:not(.footnote-definition) + .footnote-definition { - margin-block-start: 2em; -} -.footnote-definition:not(:has(+ .footnote-definition)) { - margin-block-end: 2em; -} .footnote-definition { font-size: 0.9em; - margin: 0.5em 0; } -.footnote-definition p { - display: inline; +/* The default spacing for a list is a little too large. */ +.footnote-definition ul, +.footnote-definition ol { + padding-left: 20px; +} +.footnote-definition > li { + /* Required to position the ::before target */ + position: relative; +} +.footnote-definition > li:target { + scroll-margin-top: 50vh; +} +.footnote-reference:target { + scroll-margin-top: 50vh; +} +/* Draws a border around the footnote (including the marker) when it is selected. + TODO: If there are multiple linkbacks, highlight which one you just came + from so you know which one to click. +*/ +.footnote-definition > li:target::before { + border: 2px solid var(--footnote-highlight); + border-radius: 6px; + position: absolute; + top: -8px; + right: -8px; + bottom: -8px; + left: -32px; + pointer-events: none; + content: ""; +} +/* Pulses the footnote reference so you can quickly see where you left off reading. + This could use some improvement. +*/ +@media not (prefers-reduced-motion) { + .footnote-reference:target { + animation: fn-highlight 0.8s; + border-radius: 2px; + } + + @keyframes fn-highlight { + from { + background-color: var(--footnote-highlight); + } + } } .tooltiptext { |