From 4a9214d09d6a526bd029a1f92a01a5f451313c9a Mon Sep 17 00:00:00 2001 From: johannst Date: Wed, 9 Apr 2025 22:28:27 +0000 Subject: deploy: 773d9b46ee3b1b88a94e69f42ea42654c63c48ec --- css/general.css | 53 ++++++++++++++++++++++++++++++++++++++++++++--------- 1 file changed, 44 insertions(+), 9 deletions(-) (limited to 'css/general.css') 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 { -- cgit v1.2.3