joshua.seigler.net/site/_includes/css/site.css
2025-07-11 00:51:25 -04:00

933 lines
18 KiB
CSS

:root {
font-size: 16px;
font-size: clamp(16px, 10px + 0.75vw, 30px);
box-sizing: border-box;
display: flex;
flex-direction: column;
min-height: 100vh;
flex-grow: 1;
padding: 0;
line-height: 1.5;
font-display: swap;
}
body {
--hue-main: 280;
--c-highlight: oklch(45% 0.135 var(--hue-main) / 0.7);
--c-accent: oklch(45% 0.135 var(--hue-main) / 0.8);
--c-body-background: oklch(15% 0.05 var(--hue-main));
--c-bg1: oklch(15% 0.05 calc(var(--hue-main) + 30));
--c-bg2: oklch(15% 0.05 calc(var(--hue-main) - 30));
--c-dark: oklch(19.1% 0.005 var(--hue-main));
--c-text-background: oklch(45% 0.135 var(--hue-main) / 0.3);
--c-text: oklch(94% 0.045 calc(var(--hue-main) + 180));
--c-text-dim: oklch(94% 0.045 calc(var(--hue-main) + 180) / 0.67);
--tag-luminance: 0.85;
--ratio: 1.333;
--s-5: calc(var(--s-4) / var(--ratio));
--s-4: calc(var(--s-3) / var(--ratio));
--s-3: calc(var(--s-2) / var(--ratio));
--s-2: calc(var(--s-1) / var(--ratio));
--s-1: calc(var(--s0) / var(--ratio));
--s0: 1rem;
--s1: calc(var(--s0) * var(--ratio));
--s2: calc(var(--s1) * var(--ratio));
--s3: calc(var(--s2) * var(--ratio));
--s4: calc(var(--s3) * var(--ratio));
--s5: calc(var(--s4) * var(--ratio));
--content-width: clamp(75vw, 40rem, 100vw - 1rem);
--sidebar-width: clamp(
10rem,
calc(0.2 * var(--content-width)),
calc(var(--content-width) * 0.5)
);
--inset: calc(50vw - var(--content-width) / 2);
position: relative;
display: flex;
flex-direction: column;
z-index: 1;
flex-grow: 1;
padding: 0;
margin: 0;
font-family:
"Inter", "Inter Variable", Ubuntu, "Noto Sans", "Fira Sans", Roboto,
"Helvetica Neue", "Arial Nova", "Nimbus Sans", Arial, sans-serif;
background-color: var(--c-body-background);
color: var(--c-text);
background-image:
image-set(
url("noise.avif") type("image/avif"),
url("noise.png") type("image/png")
),
radial-gradient(ellipse at -20% 20vmin, var(--c-bg1), transparent 90%),
radial-gradient(
ellipse at 120% calc(100% - 20vmin),
var(--c-bg2),
transparent 90%
);
}
::selection {
background: var(--c-highlight);
color: var(--c-text);
}
*,
:after,
:before {
box-sizing: inherit;
font-family: inherit;
text-decoration-color: color-mix(in srgb, currentColor 50%, transparent);
text-decoration-thickness: 0.1rem;
}
a, label {
color: inherit;
--glowColor: var(--c-accent);
--c-accent: oklch(45% 0.135 var(--hue-main) / 0.8);
}
a[href] {
appearance: none;
text-decoration-line: underline;
box-decoration-break: clone;
padding: 0.1em;
margin: -0.1em;
position: relative;
}
@media screen {
a[target=_blank]::after {
display: inline-block;
content: "";
height: 1em;
width: 1em;
vertical-align: middle;
background-color: currentColor;
mask-image: var(--icon-copy);
opacity: 0.5;
}
}
a:hover,
a:focus-visible {
outline: none;
color: var(--c-text);
background-color: var(--glowColor);
box-shadow:
0 0 0.5rem var(--glowColor),
0 0 1rem var(--glowColor);
text-decoration: none;
border-radius: 0.5rem;
& img {
box-shadow:
0 0 0.5rem var(--glowColor),
0 0 1rem var(--glowColor);
}
}
:is(a[href], button):focus-visible {
z-index: 1;
outline: 2px solid var(--c-text);
}
:root {
--icon-copy: url("data:image/svg+xml,%3C%3Fxml version='1.0' encoding='utf-8'%3F%3E%3Csvg viewBox='-2 0 19 19' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M14.267 3.793v7.996a.477.477 0 0 1-.475.475h-2.356v2.472a.476.476 0 0 1-.475.475H1.208a.476.476 0 0 1-.475-.475V6.74a.476.476 0 0 1 .475-.475h2.356V3.793a.476.476 0 0 1 .475-.475h9.753a.476.476 0 0 1 .475.475zm-3.94 8.471H4.04a.477.477 0 0 1-.475-.475V8.626H1.84v5.476h8.487zm2.832-6.585H4.672v5.476h8.487z'/%3E%3C/svg%3E");
--icon-rss: url("/icons/rss.svg");
}
main p img {
max-width: 100%;
}
:where(img[width]) {
width: auto;
}
:where(img[width][height]) {
height: auto;
}
section:nth-child(n + 2) {
margin-top: 1rem;
}
header.toc {
display: block;
margin: 0;
font-size: var(--s-1);
ol {
display: inline;
margin: 0;
padding: 0;
}
li {
display: inline;
list-style: none;
&:nth-child(n + 2)::before {
content: " · ";
}
}
}
.toc > ol::before {
content: "Contents: ";
}
.toc ol ol {
&::before {
content: "(";
}
&::after {
content: ")";
}
}
:target {
animation: ping 1s ease-out;
&,
a {
text-decoration-color: var(--c-accent);
}
}
.footnotes-sep {
position: relative;
z-index: -1;
margin: 4rem -1rem -4rem;
height: 4.1rem;
border: none;
background-image: radial-gradient(
ellipse farthest-side at 50% 0%,
var(--c-highlight),
transparent
);
opacity: 0.5;
}
@keyframes ping {
0% {
border-radius: 50%;
background-color: var(--c-accent);
box-shadow: var(--c-accent) 0 0 1rem 4rem;
}
100% {
border-radius: 50%;
background-color: transparent;
box-shadow: transparent 0 0 0rem 0rem;
}
100% {
border-radius: initial;
}
}
li::marker {
color: color-mix(in srgb, currentcolor 50%, transparent);
}
aside {
display: inline-block;
margin-left: 1ch;
}
span.aside {
float: right;
clear: right;
position: relative;
width: var(--sidebar-width);
padding: 0.5rem 0 0.5rem 1rem;
font-size: var(--s-1);
}
@media (min-width: 40rem) {
main:has(span.aside) {
padding-right: calc(var(--inset) + var(--sidebar-width));
}
span.aside {
padding: 0 0 0 1rem;
margin-right: calc(-1 * var(--sidebar-width));
&::after {
content: "";
pointer-events: none;
position: absolute;
top: -0.5rem;
left: 0.5rem;
right: 0;
bottom: -0.5rem;
z-index: -1;
opacity: 0.4;
background: radial-gradient(
ellipse farthest-side at 50% 0%,
var(--c-highlight),
transparent
);
}
}
}
ul,
ol {
padding-left: 1.5rem;
}
ul.collection {
padding-left: 0;
> li {
list-style-type: none;
position: relative;
&:has(.collection-cover) {
padding-bottom: 2lh;
@media (min-width: 60rem) {
padding-bottom: 0.5rem;
padding-right: 50%;
.collection-cover {
left: 50%;
width: 50%;
mask-image: linear-gradient(to right, transparent, white 20%);
}
}
}
.collection-cover {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
object-fit: cover;
object-position: 50% 30%;
border-radius: 0.25rem;
z-index: -1;
@media print {
opacity: 0.2;
}
}
@media screen {
background-color: oklch(from var(--c-accent) calc(l * 0.4) calc(c * 0.33) h / 0.67);
box-shadow: inset 0 0 2rem -1rem var(--c-accent);
padding: 0.5rem;
border-radius: 0.25rem;
a.collection-itemTitle {
position: static;
&::before {
content: "";
position: absolute;
inset: 0;
}
}
}
> p {
&::before {
content: none;
}
@media screen {
color: var(--c-text-dim);
}
width: 100%;
}
+ li {
margin-top: 1rem;
}
}
}
p {
margin: 0;
}
p + p,
pre + p {
margin-top: 1lh;
}
blockquote {
position: relative;
margin: 1lh 0;
padding: 0 1em;
&::after {
content: "";
pointer-events: none;
position: absolute;
z-index: -1;
top: -1lh;
bottom: -1lh;
left: -0.1em;
width: 15rem;
max-width: 100%;
background: radial-gradient(
ellipse farthest-side at 0% 50%,
var(--c-highlight),
transparent
);
opacity: 0.5;
}
}
sup {
font-size: var(--s-1);
margin-top: -0.2em;
}
body > header {
color: var(--c-text);
padding: 0 var(--inset) 0;
border-radius: 0.5rem 0.5rem 0 0;
padding-top: env(safe-area-inset-top, 0);
}
body > header > nav {
margin: 0.5rem 0 3rem;
}
.nav-categories {
display: flex;
flex-direction: row;
flex-wrap: wrap;
gap: 0.5em;
margin-right: auto;
& > a {
white-space: nowrap;
display: inline-block;
}
}
.nav-row {
width: 100%;
display: flex;
flex-direction: row-reverse;
flex-wrap: wrap;
gap: 0.5rem;
margin-bottom: 0.25rem;
}
.nav-home {
flex-grow: 1;
order: 2;
}
.nav-home,
nav [aria-current] {
font-weight: bold;
}
.nav-settings {
display: flex;
gap: 0.5em;
flex-direction: row;
justify-content: end;
flex-wrap: wrap;
}
.nav-toggles {
display: flex;
flex-direction: row;
font-size: var(--s-1);
}
.cover {
display: flex;
position: relative;
flex-direction: column;
justify-content: end;
min-height: 20rem;
img {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
object-fit: cover;
object-position: 50% 40%;
z-index: -1;
mask-image: linear-gradient(to bottom, white 8rem, transparent);
border-top-left-radius: 1rem;
border-top-right-radius: 1rem;
}
> h1 {
padding: 0 0.5rem;
margin-top: 10rem;
}
}
body > footer {
position: relative;
text-align: right;
font-size: var(--s-1);
margin: auto var(--inset) 0;
padding-top: 4rem;
padding-bottom: max(env(safe-area-inset-bottom, 0), 0.5rem);
& a {
white-space: nowrap;
}
ul {
padding: 0;
display: inline;
> li {
display: inline;
+ li::before {
content: " · ";
padding-inline: 0.5ch;
}
}
}
}
.nav-toggle-button {
position: relative;
cursor: pointer;
text-decoration-line: underline;
display: inline-flex;
align-items: center;
border-radius: 0;
padding: 0.1rem 0.25rem;
margin: 0;
border-radius: 0 !important;
background-color: var(--c-text-background);
> input[type="radio"] {
z-index: -2;
position: absolute;
inset: 0;
opacity: 0;
}
&:first-of-type {
border-top-left-radius: 0.5rem !important;
border-bottom-left-radius: 0.5rem !important;
}
&:last-of-type {
border-top-right-radius: 0.5rem !important;
border-bottom-right-radius: 0.5rem !important;
}
}
h1,
h2,
h3,
h4 {
color: color-mix(in lch, currentColor 90%, transparent);
position: relative;
font-weight: 700;
text-shadow: 0 0 0.5em var(--c-highlight);
margin-top: 3rem;
line-height: 1.1;
+ h1, + h2, + h3, + h4 {
margin-top: 0;
}
margin-bottom: 0.5rem;
&:hover .header-anchor {
opacity: 1;
}
}
@media screen {
:is(h1, h2)::after {
pointer-events: none;
opacity: 0.5;
content: "";
position: absolute;
z-index: -1;
bottom: 0;
left: -4rem;
height: 4em;
width: 30rem;
max-width: 100%;
background: radial-gradient(
ellipse farthest-side at 50% 100%,
var(--c-highlight),
transparent
);
}
}
h1 {
margin-bottom: 0;
}
a.rss {
float: right;
height: 1lh;
width: 1lh;
margin: 0 0 0 0.5rem;
--glowColor: #F80A;
background-image: var(--icon-rss);
border-radius: 0.25em;
opacity: 0.25;
transition: 5s opacity;
&:hover {
opacity: 1;
transition: none;
}
}
.header-meta {
font-size: var(--s-1);
> * + *:not(:empty)::before {
content: "-";
padding: 0 0.5ch;
}
}
.cover-info {
color: var(--c-text-dim);
}
:where(ol li) {
list-style-type: decimal;
& :where(ol li) {
list-style-type: lower-alpha;
& :where(ol li) {
list-style-type: upper-alpha;
}
}
}
pre[class*="language-"] button {
display: none;
}
@media screen {
p:has(+ pre[class*="language-"]) > code:first-child:last-child {
position: relative;
font-size: 0.8em;
}
p:has(+ pre[class*="language-"]) > code::after {
content: "";
pointer-events: none;
opacity: 0.5;
position: absolute;
z-index: -1;
bottom: 0;
left: -2rem;
height: 4rem;
width: 20rem;
max-width: 100%;
background: radial-gradient(
ellipse farthest-side at 50% 100%,
var(--c-highlight),
transparent
);
}
pre[class*="language-"] button {
display: block;
position: absolute;
top: 0;
right: 0;
border-radius: 0.5rem;
font-size: var(--s-1);
padding: 0.25em;
&::before {
content: "";
display: flex;
justify-content: center;
align-items: center;
width: 1lh;
height: 1lh;
background-color: currentColor;
mask-image: var(--icon-copy);
}
}
}
main {
margin-top: calc(0.75 * var(--s3));
h1,
h2,
h3,
h4 {
clear: both;
margin-bottom: 0.25lh;
}
padding: 0 var(--inset);
}
h1 {
font-size: var(--s4);
}
h2 {
font-size: var(--s3);
}
h3 {
font-size: var(--s2);
}
h4 {
font-size: var(--s1);
}
a.header-anchor {
position: absolute;
transform: translateX(-100%);
left: -0.2ch;
opacity: 0;
transition: opacity ease-in 0.1s;
&::before {
content: "#";
}
&:focus-visible {
opacity: 1;
}
}
.item-summary {
margin-bottom: 1rem;
}
:not(pre) > code,
pre {
font-family: "Commit Mono", monospace;
background-color: var(--c-text-background);
padding: 0.1em;
border-radius: 0.5em;
}
p > code {
margin: -0.1em 0;
display: inline-block;
}
body #isso-thread {
margin: 4rem var(--inset) 0;
}
body .isso-postbox {
max-width: none;
}
body .isso-textarea {
margin: 0;
line-height: 1.4rem;
}
body h4.isso-thread-heading {
color: inherit;
}
body .isso-auth-section {
display: flex;
align-items: end;
justify-content: end;
gap: 5px;
margin-top: 0.5rem;
}
body .isso-input-wrapper {
display: flex;
flex-direction: column;
font-size: var(--s-1);
margin: 0;
width: 100%;
max-width: none;
flex-shrink: 1;
}
body .isso-input-wrapper label {
height: auto;
}
body .isso-input-wrapper input,
input[type="text"],
body .isso-textarea,
body .isso-preview {
color: inherit;
font-size: 1rem;
background-color: transparent;
padding: 0.5rem;
width: 100%;
border-radius: 0.2rem;
line-height: 1.4rem;
border: none;
border-bottom: 2px solid var(--c-accent);
box-shadow: inset 0 0 2rem -1rem var(--c-accent);
outline: none;
&:focus {
box-shadow:
inset 0 0 2rem -1rem var(--c-accent),
inset 0 -1.5rem 2.5rem -1.5rem var(--c-accent);
border-color: var(--c-accent);
}
}
body .isso-textarea {
line-height: 1.2;
}
body .isso-preview {
background: repeating-linear-gradient(
-45deg,
transparent,
transparent 10px,
var(--c-text-background) 10px,
var(--c-text-background) 20px
);
}
body .isso-post-action > input, button {
color: inherit;
}
body .isso-post-action > input,
button, a.button {
display: inline-block;
text-decoration: none;
background-color: var(--c-text-background);
font-size: 1rem;
padding: 0.5rem;
border-radius: 0.2rem;
border: none;
cursor: pointer;
outline: 0;
line-height: 1.4rem;
&:hover,
&:focus-visible {
background-color: var(--c-accent);
box-shadow:
0 0 0.5rem var(--c-accent),
0 0 1rem var(--c-accent);
}
}
.button.tag {
margin: 0 0.2em 0.2em 0;
}
.tag {
display: inline-block;
position: relative;
&::before {
content: "#";
}
--tagLCH: var(--tag-luminance) 0.25 calc(300 + 137.508 * var(--tagIndex, 0));
--glowColor: oklch(var(--tagLCH) / 0.3);
--c-text-background: color-mix(in oklch, oklch(var(--tagLCH) / 0.4), #000A 50%);
--c-accent: color-mix(in oklch, oklch(var(--tagLCH) / 0.8), #000A 50%);
color: oklch(var(--tagLCH) / 0.8);
&:hover {
color: var(--c-text);
}
&.button:has(.tagCount) {
padding-right: 2em;
}
.tagCount {
display: flex;
align-items: center;
position: absolute;
overflow: hidden;
top: 0;
right: 0;
bottom: 0;
line-height: 0;
font-size: calc(3.3em);
font-weight: bold;
padding-right: 0.1em;
opacity: 0.175;
}
}
body .isso-post-action {
margin: 0;
}
.isso-postbox:not(.isso-preview-mode)
.isso-post-action:has(input[name="edit"]) {
display: none;
}
@media (max-width: 60rem) {
body .isso-auth-section {
flex-wrap: wrap;
}
body .isso-input-wrapper {
width: 100%;
}
}
#effects {
mask-image: url("/code-traces.svg");
pointer-events: none;
position: absolute;
z-index: -1;
inset: 0;
overflow: hidden;
}
@keyframes ripple {
0% {
opacity: 0;
transform: scale(0.2);
}
10% {
opacity: 0.75;
}
100% {
opacity: 1;
transform: scale(1.5);
}
}
.effect-instance {
position: absolute;
border-radius: 0.5rem;
background: radial-gradient(
ellipse farthest-side at 50% 50%,
var(--glowColor) 10%,
color-mix(in lch, var(--glowColor), transparent) 25%,
color-mix(in lch, var(--glowColor), transparent 80%) 35%,
transparent
);
animation: 1s ease normal forwards ripple;
}
.pagefind-ui__form {
display: grid;
gap: 0.5rem;
grid-template-columns: 1fr min-content;
}
.pagefind-ui__search-input {
margin-right: 0.5rem;
grid-column-start: 0;
grid-column-end: span 1;
}
.pagefind-ui__drawer {
grid-column-start: 0;
grid-column-end: span 2;
width: 100%;
}
.pagefind-ui__result-excerpt {
margin: 0.5rem 0;
}
.feature {
> p:first-child::first-line {
font-size: var(--s2);
font-weight: 200;
}
}
mark {
background: var(--c-highlight);
color: inherit;
border-radius: 0.4rem;
box-shadow: 0 0 0.75em 0.25em var(--c-highlight);
}
@media print {
:root {
font-size: 10pt;
}
* {
text-shadow: none !important;
}
body {
--c-highlight: white;
--c-dark: white;
--c-accent: black;
--c-body-background: white;
--c-text: black;
--content-width: 100vw;
--ratio: 1.2;
background: none;
}
h1,
h2,
h3,
h4 {
opacity: 0.8;
margin-top: 1rem;
}
main {
margin-top: 0;
}
:is(h1, h2, h3, h4, blockquote, .aside)::after {
content: none !important;
}
body > header > nav {
display: none;
}
body > footer {
display: none;
}
a[href^="http"]::after {
content: " (" attr(href) ")";
font-size: 0.75em;
word-break: break-all;
font-family: "Commit Mono", monospace;
.footnotes & {
display: block;
}
}
.isso-postbox {
display: none;
}
.tag {
background: none !important;
color: inherit !important;
.tagCount {
color: inherit;
opacity: 0.25;
}
}
.button {
border: 1px solid #aaa !important;
}
}