Style footnotes

This commit is contained in:
Nathan Upchurch 2024-09-20 23:57:00 -05:00
parent 6dc2db4c52
commit 21b66dd28f

View File

@ -9,7 +9,6 @@
} }
} }
/* Defaults */ /* Defaults */
:root { :root {
--font-family: "Fraunces", serif; --font-family: "Fraunces", serif;
@ -17,7 +16,10 @@
--font-family-ui: "Manrope", sans-serif; --font-family-ui: "Manrope", sans-serif;
--font-variation-default: "opsz" 18, "wght" 310, "SOFT" 40, "WONK" 0; --font-variation-default: "opsz" 18, "wght" 310, "SOFT" 40, "WONK" 0;
--font-variation-ui: "wght" 500; --font-variation-ui: "wght" 500;
--font-family-monospace: Consolas, Menlo, Monaco, Andale Mono WT, Andale Mono, Lucida Console, Lucida Sans Typewriter, DejaVu Sans Mono, Bitstream Vera Sans Mono, Liberation Mono, Nimbus Mono L, Courier New, Courier, monospace; --font-family-monospace: Consolas, Menlo, Monaco, Andale Mono WT, Andale Mono,
Lucida Console, Lucida Sans Typewriter, DejaVu Sans Mono,
Bitstream Vera Sans Mono, Liberation Mono, Nimbus Mono L, Courier New,
Courier, monospace;
--meta-font-family: "Fraunces", serif; --meta-font-family: "Fraunces", serif;
--meta-font-size: var(--step--1); --meta-font-size: var(--step--1);
--meta-font-style: normal; --meta-font-style: normal;
@ -42,7 +44,8 @@
/* Design Tokens */ /* Design Tokens */
:root { :root {
/* Animations */ /* Animations */
--slide-in-blurred-bottom: slide-in-blurred-bottom 0.75s cubic-bezier(0.230, 1.000, 0.320, 1.000) both; --slide-in-blurred-bottom: slide-in-blurred-bottom 0.75s
cubic-bezier(0.23, 1, 0.32, 1) both;
/* Colors */ /* Colors */
--color-gray-20: #e0e0e0; --color-gray-20: #e0e0e0;
@ -50,7 +53,7 @@
--card-color: white; --card-color: white;
--contrast-color: #027860; --contrast-color: #027860;
--background-color: #FAF5F5; --background-color: #faf5f5;
--rss-orange: rgb(255, 152, 0); --rss-orange: rgb(255, 152, 0);
--text-color: var(--color-gray-90); --text-color: var(--color-gray-90);
--text-color-link: var(--text-color); --text-color-link: var(--text-color);
@ -91,33 +94,35 @@
--space-2xl-3xl: clamp(5rem, 2.7465rem + 11.2676vw, 9rem); --space-2xl-3xl: clamp(5rem, 2.7465rem + 11.2676vw, 9rem);
/* Custom pairs - https://utopia.fyi/ */ /* Custom pairs - https://utopia.fyi/ */
--space-s-l: clamp(1.25rem, 0.2641rem + 4.9296vw, 3rem); --space-s-l: clamp(1.25rem, 0.2641rem + 4.9296vw, 3rem);
/* Fluid Grid Tokens - https://utopia.fyi/ */ /* Fluid Grid Tokens - https://utopia.fyi/ */
--grid-max-width: 55.50rem; --grid-max-width: 55.5rem;
--grid-gutter: var(--space-s-s, clamp(1.25rem, 1.1092rem + 0.7042vw, 1.5rem)); --grid-gutter: var(--space-s-s, clamp(1.25rem, 1.1092rem + 0.7042vw, 1.5rem));
--grid-columns: 12; --grid-columns: 12;
/* Change <img> SVG color with filter */ /* Change <img> SVG color with filter */
--logo-filter: brightness(0) saturate(100%) invert(16%) sepia(0%) saturate(1024%) hue-rotate(177deg) brightness(99%) contrast(88%); --logo-filter: brightness(0) saturate(100%) invert(16%) sepia(0%)
saturate(1024%) hue-rotate(177deg) brightness(99%) contrast(88%);
--icon-filter: none; --icon-filter: none;
/* Corners */ /* Corners */
--border-radius: .3rem; --border-radius: 0.3rem;
/* Transitions */ /* Transitions */
--transition-normal: all .3s; --transition-normal: all 0.3s;
/* Links */ /* Links */
--link-decoration-thickness: .1rem; --link-decoration-thickness: 0.1rem;
/* Borders */ /* Borders */
--border-hr: 0.5px solid var(--color-gray-20);
--border-nav: 1px solid var(--text-color); --border-nav: 1px solid var(--text-color);
--border-nav-currentpage: var(--space-xs-s) solid var(--contrast-color); --border-nav-currentpage: var(--space-xs-s) solid var(--contrast-color);
--border-nav-hover: var(--space-xs-s) solid var(--text-color); --border-nav-hover: var(--space-xs-s) solid var(--text-color);
/* Shadow */ /* Shadow */
--box-shadow: 0 4px 8px 0 rgba(0,0,0,0.2); --box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2);
/* Web Component Tokens */ /* Web Component Tokens */
--wc-card-background-color: var(--card-color); --wc-card-background-color: var(--card-color);
@ -144,7 +149,8 @@
--background-color: #15202b; --background-color: #15202b;
--logo-filter: none; --logo-filter: none;
--icon-filter: brightness(0) saturate(100%) invert(9%) sepia(76%) saturate(340%) hue-rotate(168deg) brightness(95%) contrast(94%); --icon-filter: brightness(0) saturate(100%) invert(9%) sepia(76%)
saturate(340%) hue-rotate(168deg) brightness(95%) contrast(94%);
} }
.socialLinks a li img { .socialLinks a li img {
filter: auto; filter: auto;
@ -162,7 +168,7 @@ body {
color: var(--text-color); color: var(--text-color);
font-family: var(--font-family); font-family: var(--font-family);
font-variation-settings: var(--font-variation-default); font-variation-settings: var(--font-variation-default);
font-variant-Ligatures: normal; font-variant-ligatures: normal;
margin: 0 auto; margin: 0 auto;
padding: 0; padding: 0;
} }
@ -179,7 +185,7 @@ blockquote:before {
margin-left: -4rem; margin-left: -4rem;
margin-top: -2rem; margin-top: -2rem;
position: fixed; position: fixed;
filter: opacity(.15); filter: opacity(0.15);
} }
body { body {
animation: var(--slide-in-blurred-bottom); animation: var(--slide-in-blurred-bottom);
@ -190,7 +196,8 @@ body {
padding-top: var(--space-m); padding-top: var(--space-m);
padding-bottom: var(--space-m); padding-bottom: var(--space-m);
} }
button, .nav-item { button,
.nav-item {
font-family: var(--font-family-ui); font-family: var(--font-family-ui);
} }
code { code {
@ -204,7 +211,9 @@ code {
background-color: var(--card-color); background-color: var(--card-color);
} }
} }
header, footer, main { header,
footer,
main {
display: grid; display: grid;
gap: var(--grid-gutter); gap: var(--grid-gutter);
grid-template-columns: repeat(var(--grid-columns), 1fr); grid-template-columns: repeat(var(--grid-columns), 1fr);
@ -229,7 +238,7 @@ section {
grid-column: 1 / span 12; grid-column: 1 / span 12;
font-size: var(--step-1); font-size: var(--step-1);
margin: 0; margin: 0;
padding-bottom: var(--space-xl); padding-bottom: var(--space-xl);
padding-top: var(--space-l); padding-top: var(--space-l);
line-height: calc(var(--step-1) * 0.5 + var(--step-1)); line-height: calc(var(--step-1) * 0.5 + var(--step-1));
} }
@ -260,7 +269,9 @@ footer p {
font-size: var(--step-0); font-size: var(--step-0);
grid-column: 1 / span 12; grid-column: 1 / span 12;
} }
h1, h2, h3 { h1,
h2,
h3 {
color: var(--text-color); color: var(--text-color);
grid-column: 1 / span 12; grid-column: 1 / span 12;
margin: 0; margin: 0;
@ -268,14 +279,22 @@ h1, h2, h3 {
} }
h1 { h1 {
font-family: var(--font-family-headline); font-family: var(--font-family-headline);
font-variation-settings: "opsz" 100, "wght" 500, "SOFT" 10, "WONK" 1; font-variation-settings:
"opsz" 100,
"wght" 500,
"SOFT" 10,
"WONK" 1;
font-size: var(--step-5); font-size: var(--step-5);
font-style: normal; font-style: normal;
line-height: calc(var(--step-5) * 0.25 + var(--step-5)); line-height: calc(var(--step-5) * 0.25 + var(--step-5));
} }
h2 { h2 {
font-size: var(--step-2); font-size: var(--step-2);
font-variation-settings: "opsz" 50, "wght" 350, "SOFT" 20, "WONK" 1; font-variation-settings:
"opsz" 50,
"wght" 350,
"SOFT" 20,
"WONK" 1;
padding-bottom: var(--space-l); padding-bottom: var(--space-l);
padding-top: var(--space-xl); padding-top: var(--space-xl);
} }
@ -292,7 +311,8 @@ main {
grid-column: 1 / 12; grid-column: 1 / 12;
padding-top: var(--space-3xl); padding-top: var(--space-3xl);
} }
main > p > img, main > p > a > img { main > p > img,
main > p > a > img {
width: 100%; width: 100%;
padding-top: var(--space-l); padding-top: var(--space-l);
} }
@ -306,12 +326,17 @@ pre {
p:last-child { p:last-child {
margin-bottom: 0; margin-bottom: 0;
} }
p, li { p,
li {
font-size: var(--step-0); font-size: var(--step-0);
line-height: calc(var(--step-0) * 0.5 + var(--step-0)); line-height: calc(var(--step-0) * 0.5 + var(--step-0));
} }
th { th {
font-variation-settings: "opsz" 25, "wght" 500, "SOFT" 40, "WONK" 0; font-variation-settings:
"opsz" 25,
"wght" 500,
"SOFT" 40,
"WONK" 0;
padding-bottom: var(--space-2xs); padding-bottom: var(--space-2xs);
text-align: left; text-align: left;
} }
@ -328,7 +353,8 @@ figure > a > img {
box-shadow: var(--space-2xs) var(--space-2xs) 0 0 var(--contrast-color); box-shadow: var(--space-2xs) var(--space-2xs) 0 0 var(--contrast-color);
} }
html.barebones, body.barebones { html.barebones,
body.barebones {
background-color: var(--background-color); background-color: var(--background-color);
text-align: center; text-align: center;
} }
@ -354,7 +380,7 @@ button {
} }
button > img { button > img {
max-width: 1em; max-width: 1em;
margin-right: .5em; margin-right: 0.5em;
filter: var(--icon-filter); filter: var(--icon-filter);
} }
a.link-button { a.link-button {
@ -401,14 +427,16 @@ table th {
.continue-discussion button { .continue-discussion button {
margin-top: var(--space-xs); margin-top: var(--space-xs);
} }
wc-comment::part(author-link), wc-toot::part(author-link) { wc-comment::part(author-link),
wc-toot::part(author-link) {
font-size: var(--step-0); font-size: var(--step-0);
text-decoration: none; text-decoration: none;
} }
wc-comment::part(main) { wc-comment::part(main) {
padding: var(--space-m); padding: var(--space-m);
} }
wc-comment::part(publish-date), wc-toot::part(publish-date) { wc-comment::part(publish-date),
wc-toot::part(publish-date) {
font-family: var(--meta-font-family); font-family: var(--meta-font-family);
font-size: var(--meta-font-size); font-size: var(--meta-font-size);
font-style: var(--meta-font-style); font-style: var(--meta-font-style);
@ -419,7 +447,8 @@ wc-toot::part(main) {
font-family: var(--meta-font-family); font-family: var(--meta-font-family);
font-size: var(--step--1); font-size: var(--step--1);
} }
wc-toot::part(author), wc-toot::part(author-link){ wc-toot::part(author),
wc-toot::part(author-link) {
color: white; color: white;
font-style: var(--meta-font-style); font-style: var(--meta-font-style);
font-variation-settings: "wght" 600; font-variation-settings: "wght" 600;
@ -430,7 +459,7 @@ code {
font-family: var(--font-family-monospace); font-family: var(--font-family-monospace);
} }
pre:not([class*="language-"]) { pre:not([class*="language-"]) {
margin: .5em 0; margin: 0.5em 0;
-moz-tab-size: var(--syntax-tab-size); -moz-tab-size: var(--syntax-tab-size);
-o-tab-size: var(--syntax-tab-size); -o-tab-size: var(--syntax-tab-size);
tab-size: var(--syntax-tab-size); tab-size: var(--syntax-tab-size);
@ -447,18 +476,47 @@ code {
word-break: break-all; word-break: break-all;
} }
/* Dropcap */ /* Footnotes */
.footnotes-list {
font-style: italic;
margin-top: 0;
margin-bottom: 0;
> li,
> li > p {
font-size: var(--step--1);
}
}
.footnote-item::marker {
font-style: normal;
}
.footnote-ref {
> a {
font-size: var(--step--2);
text-decoration: none;
}
:before {
content: " ";
}
}
.footnote-ref hr.footnotes-sep {
border: var(--border-hr);
}
/* Dropcap */
main > section > article > p:not(.nodropcap):first-of-type:first-letter { main > section > article > p:not(.nodropcap):first-of-type:first-letter {
float: left; float: left;
font-size: var(--step-6); font-size: var(--step-6);
padding: .5rem .5rem .5rem .5rem; padding: 0.5rem 0.5rem 0.5rem 0.5rem;
color: var(--contrast-color); color: var(--contrast-color);
border: solid 2px var(--contrast-color); border: solid 2px var(--contrast-color);
font-family: var(--font-family-headline); font-family: var(--font-family-headline);
font-variation-settings: "opsz" 144, "wght" 500, "SOFT" 10, "WONK" 0; font-variation-settings:
margin: .5rem .7rem 0 0; "opsz" 144,
border-radius: .2em; "wght" 500,
"SOFT" 10,
"WONK" 0;
margin: 0.5rem 0.7rem 0 0;
border-radius: 0.2em;
border-top-left-radius: 0; border-top-left-radius: 0;
} }
@ -487,7 +545,7 @@ nav ul {
.nav-icon { .nav-icon {
fill: var(--color-gray-90); fill: var(--color-gray-90);
height: var(--space-2xs); height: var(--space-2xs);
margin-right: .25rem; margin-right: 0.25rem;
transition: var(--transition-normal); transition: var(--transition-normal);
width: var(--space-2xs); width: var(--space-2xs);
} }
@ -513,7 +571,9 @@ nav ul {
border-top: var(--border-nav-hover); /* Increase border thickness */ border-top: var(--border-nav-hover); /* Increase border thickness */
} }
.nav-item:hover a { .nav-item:hover a {
margin-top: calc(var(--space-xs-s) * -2); /* Compensate for border thickness */ margin-top: calc(
var(--space-xs-s) * -2
); /* Compensate for border thickness */
} }
.nav-item a[href]:visited { .nav-item a[href]:visited {
color: var(--text-color); color: var(--text-color);
@ -528,9 +588,13 @@ nav ul {
.nav-item[data-currentpage="true"] { .nav-item[data-currentpage="true"] {
border-top: var(--border-nav-currentpage); border-top: var(--border-nav-currentpage);
} }
.nav-item[data-currentpage="true"] a, .nav-item[data-currentpage="true"] a[href]:visited, .nav-item[data-currentpage="true"]:hover a { .nav-item[data-currentpage="true"] a,
.nav-item[data-currentpage="true"] a[href]:visited,
.nav-item[data-currentpage="true"]:hover a {
color: var(--contrast-color); color: var(--contrast-color);
margin-top: calc(var(--space-xs-s) * -2); /* Compensate for border thickness */ margin-top: calc(
var(--space-xs-s) * -2
); /* Compensate for border thickness */
} }
/* Posts list */ /* Posts list */
@ -543,7 +607,7 @@ nav ul {
align-items: flex-start; align-items: flex-start;
background-color: var(--card-color); background-color: var(--card-color);
border-radius: var(--border-radius); border-radius: var(--border-radius);
box-shadow: 0 4px 8px 0 rgba(0,0,0,0.2); box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2);
display: flex; display: flex;
flex-flow: row nowrap; flex-flow: row nowrap;
justify-content: flex-start; justify-content: flex-start;
@ -551,10 +615,10 @@ nav ul {
width: 100%; width: 100%;
} }
.postlist,
.postlist, .links-nextprev { .links-nextprev {
container: postlist / inline-size; container: postlist / inline-size;
} }
.post-image-container { .post-image-container {
border-radius: var(--border-radius); border-radius: var(--border-radius);
@ -576,8 +640,8 @@ nav ul {
} }
.postlist-link { .postlist-link {
font-size: var(--step-5); /* 19px /16 */ font-size: var(--step-5); /* 19px /16 */
padding-right: .5em; padding-right: 0.5em;
text-decoration: none; text-decoration: none;
} }
.postlist-link p { .postlist-link p {
@ -657,7 +721,7 @@ a.post-tag:hover {
padding-left: 0; padding-left: 0;
} }
.taglist li { .taglist li {
margin: 0em .5em 1.25em 0em; margin: 0em 0.5em 1.25em 0em;
} }
.taglist li a { .taglist li a {
font-size: var(--step-2); font-size: var(--step-2);
@ -681,7 +745,11 @@ a.post-tag:hover {
padding-left: var(--space-s); padding-left: var(--space-s);
} }
.post-metadata p, .post-metadata ul, .post-metadata ul li, time, .metadata { .post-metadata p,
.post-metadata ul,
.post-metadata ul li,
time,
.metadata {
display: flex; display: flex;
flex-flow: row wrap; flex-flow: row wrap;
font-size: var(--meta-font-size); font-size: var(--meta-font-size);
@ -694,7 +762,7 @@ a.post-tag:hover {
} }
.post-metadata time { .post-metadata time {
padding-left: .15rem; padding-left: 0.15rem;
} }
.profilePic:not(.links-container > img.profilePic) { .profilePic:not(.links-container > img.profilePic) {
@ -705,7 +773,7 @@ a.post-tag:hover {
/* Direct Links / Markdown Headers */ /* Direct Links / Markdown Headers */
a.header-anchor { a.header-anchor {
font-style: normal; font-style: normal;
margin-left: .1em; margin-left: 0.1em;
text-decoration: none; text-decoration: none;
} }
a[href].header-anchor, a[href].header-anchor,
@ -736,6 +804,14 @@ article.post > p:not(blockquote > p):last-child:after {
display: inline; display: inline;
font-size: var(--step-1); font-size: var(--step-1);
} }
/* Adds fleuron to article end when footnotes are present */
p:has(+ hr.footnotes-sep):after {
content: "\2766";
display: inline;
font-size: var(--step-1);
}
/* Utilities */ /* Utilities */
.grid-container { .grid-container {
max-width: var(--grid-max-width); max-width: var(--grid-max-width);