diff options
Diffstat (limited to 'css')
-rw-r--r-- | css/general.css | 53 | ||||
-rw-r--r-- | css/variables.css | 10 |
2 files changed, 54 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 { diff --git a/css/variables.css b/css/variables.css index 5797715..6a692ae 100644 --- a/css/variables.css +++ b/css/variables.css @@ -61,6 +61,8 @@ --copy-button-filter: invert(45%) sepia(6%) saturate(621%) hue-rotate(198deg) brightness(99%) contrast(85%); /* Same as `--sidebar-active` */ --copy-button-filter-hover: invert(68%) sepia(55%) saturate(531%) hue-rotate(341deg) brightness(104%) contrast(101%); + + --footnote-highlight: #2668a6; } .coal { @@ -110,6 +112,8 @@ --copy-button-filter: invert(26%) sepia(8%) saturate(575%) hue-rotate(169deg) brightness(87%) contrast(82%); /* Same as `--sidebar-active` */ --copy-button-filter-hover: invert(36%) sepia(70%) saturate(503%) hue-rotate(167deg) brightness(98%) contrast(89%); + + --footnote-highlight: #4079ae; } .light, html:not(.js) { @@ -159,6 +163,8 @@ --copy-button-filter: invert(45.49%); /* Same as `--sidebar-active` */ --copy-button-filter-hover: invert(14%) sepia(93%) saturate(4250%) hue-rotate(243deg) brightness(99%) contrast(130%); + + --footnote-highlight: #7e7eff; } .navy { @@ -208,6 +214,8 @@ --copy-button-filter: invert(51%) sepia(10%) saturate(393%) hue-rotate(198deg) brightness(86%) contrast(87%); /* Same as `--sidebar-active` */ --copy-button-filter-hover: invert(46%) sepia(20%) saturate(1537%) hue-rotate(156deg) brightness(85%) contrast(90%); + + --footnote-highlight: #4079ae; } .rust { @@ -255,6 +263,8 @@ --copy-button-filter: invert(51%) sepia(10%) saturate(393%) hue-rotate(198deg) brightness(86%) contrast(87%); /* Same as `--sidebar-active` */ --copy-button-filter-hover: invert(77%) sepia(16%) saturate(1798%) hue-rotate(328deg) brightness(98%) contrast(83%); + + --footnote-highlight: #d3a17a; } @media (prefers-color-scheme: dark) { |