/* ============================================================================ Prose — how a rendered cheatsheet reads. The body is paper. The code is not: every block is a dark plate, in both modes, exactly as the main site sets them. That is the page's core rhythm — terminal output pasted into a printed document — and it is why the blocks do not follow the theme. A code block that turns cream in light mode stops being a terminal and becomes a quotation. ========================================================================== */ .prose { color: var(--fg); font-size: 17.5px; line-height: 1.68; letter-spacing: -0.003em; overflow-wrap: anywhere; } .prose > * + * { margin-top: 1.15rem; } /* The article column is as wide as the layout gives it, so that tables and listings can use it. Running text is the exception: a paragraph set at 120 characters is a wall, so prose blocks keep a reading measure. */ .prose > :where(p, ul, ol, dl, blockquote) { max-width: 82ch; } .prose h2, .prose h3, .prose h4 { font-family: var(--font-display); scroll-margin-top: 92px; overflow-wrap: anywhere; } /* Empty MkDocs-anchor aliases inside mirrored headings (see astro.config.mjs). They are the scroll target for canonical upstream deep links, so they need the same offset or the heading lands behind the sticky header. */ .prose .anchor-alias { scroll-margin-top: 92px; } .prose h2 { font-size: clamp(1.35rem, 2.2vw, 1.75rem); font-weight: 700; font-stretch: 84%; letter-spacing: -0.03em; line-height: 1.05; text-transform: uppercase; margin-top: 3.4rem; padding-bottom: 0.6rem; border-bottom: 1px solid var(--fg); } .prose > h2:first-child, .prose > h1:first-child + h2 { margin-top: 0.4rem; } /* The sheets close most sections with a `---`. Directly above a heading that draws its own rule it is a second line saying the same thing. */ .prose hr:has(+ h2) { display: none; } .prose h3 { font-size: 1.18rem; font-weight: 700; letter-spacing: -0.02em; line-height: 1.25; margin-top: 2.3rem; color: var(--fg); } /* ---- Heading marks (src/lib/rehype-heading-marks.mjs) -------------------- */ /* The section number a sheet's `h2` carries in place of the emoji it was written with: the same `01` the contents rail shows, in the 10px mono the site numbers everything in, raised to sit on the cap line. An inline pseudo rather than a flex row, so a heading that wraps still wraps as text and the mirror headings' empty anchor spans cost no gap. */ .prose h2[data-n]::before { content: attr(data-n); display: inline-block; margin-right: 0.85rem; font-family: var(--font-mono); font-size: 11px; font-weight: 400; font-stretch: 100%; letter-spacing: 0.14em; vertical-align: 0.55em; color: var(--accent); } /* A heading that opened with a coloured dot keeps the colour as a square: foam for enumerate, love for exploit, and so on down the palette. */ .prose :is(h2, h3, h4)[data-mark]:not([data-n])::before { content: ''; display: inline-block; width: 0.52em; height: 0.52em; margin-right: 0.6em; background: var(--mark); vertical-align: 0.1em; } .prose [data-mark='love'] { --mark: var(--love); } .prose [data-mark='foam'] { --mark: var(--foam); } .prose [data-mark='pine'] { --mark: var(--pine); } .prose [data-mark='gold'] { --mark: var(--gold); } .prose [data-mark='rose'] { --mark: var(--rose); } .prose [data-mark='iris'] { --mark: var(--iris); } .prose h4 { font-family: var(--font-mono); font-size: 11px; letter-spacing: var(--track-micro); text-transform: uppercase; margin-top: 1.6rem; color: var(--fg-faint); } .prose p { color: var(--fg); text-wrap: pretty; } .prose strong { color: var(--fg); font-weight: 600; } .prose em { color: var(--fg-dim); } /* ---- Drop cap ------------------------------------------------------------ */ /* The opening letter of a sheet, floated three lines deep in EB Garamond. Set on a span rather than with `::first-letter` for two reasons: the pseudo-element cannot be given a different family and weight reliably across engines at this size, and — the real one — the letter stays real selectable, searchable text this way, read as part of the word it opens rather than as decoration sitting beside it. The rehype pass that splits it out (see `rehypeDropCap` in astro.config.mjs) skips short openers, so an image caption or a one-line note is left alone. */ .prose .cap { float: left; font-family: var(--font-lockup); font-size: 72px; font-weight: 600; line-height: 0.74; color: var(--love); margin: 5px 0.85rem 0 0; } .prose a { color: var(--accent); overflow-wrap: anywhere; text-decoration: underline; text-decoration-color: color-mix(in oklab, var(--accent) 40%, transparent); text-underline-offset: 3px; transition: text-decoration-color 200ms ease; } .prose a:hover { text-decoration-color: var(--accent); } .prose ul, .prose ol { padding-left: 1.4rem; } .prose li { margin-top: 0.35rem; } .prose ul li::marker { color: var(--accent); } .prose ol li::marker { color: var(--fg-faint); font-family: var(--font-mono); } .prose hr { border: 0; border-top: 1px solid var(--rule); margin: 2.4rem 0; } /* Inline code — a tinted slug on the page, square, hairline-bordered. This is the one place the paper carries code, and it stays paper-coloured; the dark treatment is reserved for blocks. */ .prose :not(pre) > code { font-family: var(--font-mono); font-size: 0.86em; padding: 0.14em 0.4em; background: var(--code-bg); border: 1px solid var(--rule); color: var(--rose); word-break: break-word; } /* ---- Callouts (blockquotes) --------------------------------------------- */ /* Every blockquote is a callout: a square panel in the page's own palette, tinted with its accent, framed by corner brackets (`.corners`, added in app.ts) with a left accent bar and, when the source used a GitHub/Obsidian `> [!type]` marker or opened with a ⚠️ / 💡 / ✅, a mono type label (`enhanceCallouts` in app.ts strips the marker and inserts `.callout__label`). The accent is the only thing that changes between kinds, so a warning and a tip differ at a glance and neither shouts. It used to be a cross-theme plate — night on cream, cream on night. On a long sheet with a dozen callouts that put a dozen full-contrast blocks on the page, all the same weight, and the reading thread was lost between them. Plain blockquotes with no marker get the same panel, just no label. */ .prose blockquote { --callout-accent: var(--foam); --bracket: var(--callout-accent); position: relative; background: color-mix(in oklab, var(--callout-accent) 7%, var(--surface)); color: var(--fg); border: 1px solid color-mix(in oklab, var(--callout-accent) 30%, var(--rule)); border-left: 3px solid var(--callout-accent); padding: 0.95rem 1.15rem; margin-block: 1.5rem; } .prose blockquote > :first-child { margin-top: 0; } .prose blockquote > :last-child { margin-bottom: 0; } .prose blockquote p { margin-top: 0.55rem; color: var(--fg); } .prose blockquote strong { color: var(--fg); } .prose blockquote em { color: var(--fg-dim); } .prose blockquote a { color: var(--accent); text-decoration-color: color-mix(in oklab, var(--accent) 45%, transparent); } .prose blockquote ul li::marker { color: var(--callout-accent); } /* Inline code in a callout rides the overlay, a step off the tinted panel. */ .prose blockquote :not(pre) > code { background: var(--overlay); border-color: var(--rule); color: var(--rose); } /* The typed label — the mono micro-header a `[!type]` marker becomes. */ .callout__label { display: inline-flex; align-items: center; gap: 0.5rem; font-family: var(--font-mono); font-size: 10px; letter-spacing: var(--track-micro); text-transform: uppercase; line-height: 1; color: var(--callout-accent); margin-bottom: 0.7rem; } .callout__label::before { content: '//'; opacity: 0.6; } /* Re-key the accent bar + label per kind. Qualified with `.prose blockquote` so these out-rank the base blockquote's own `--callout-accent`. */ .prose blockquote[data-callout] { border-left-color: var(--callout-accent); } .prose blockquote[data-callout='warning'] { --callout-accent: var(--gold); } .prose blockquote[data-callout='danger'] { --callout-accent: var(--love); } .prose blockquote[data-callout='tip'], .prose blockquote[data-callout='success'] { --callout-accent: var(--foam); } .prose blockquote[data-callout='note'], .prose blockquote[data-callout='info'] { --callout-accent: var(--pine); } .prose blockquote[data-callout='question'], .prose blockquote[data-callout='example'], .prose blockquote[data-callout='quote'] { --callout-accent: var(--iris); } /* Tables — a ruled table, not a card with a table in it: an ink rule above, a hairline between rows, nothing down the sides. The first column is the row's label (the tool, the flag, the requirement) and is set a weight up so the eye can run down it; everything after it is the value. */ .prose .table-scroll { overflow-x: auto; } .prose table { width: 100%; border-collapse: collapse; font-size: 0.87rem; line-height: 1.5; border-top: 1px solid var(--fg); border-bottom: 1px solid var(--rule-hi); } .prose thead th { background: var(--wash); font-family: var(--font-mono); font-size: var(--step-micro); font-weight: 500; letter-spacing: var(--track-micro); text-transform: uppercase; color: var(--accent); text-align: left; padding: 0.7rem 0.9rem; white-space: nowrap; border-bottom: 1px solid var(--rule-hi); } .prose tbody td { padding: 0.66rem 0.9rem; border-top: 1px solid var(--rule); vertical-align: top; } .prose tbody tr:first-child td { border-top: 0; } .prose tbody td:first-child { font-weight: 500; min-width: 9ch; } .prose tbody tr:hover { background: var(--wash); } .prose img { border: 1px solid var(--rule); margin-inline: auto; } /* Rendered workflow diagrams are supplied alongside editable Mermaid source. The caption behaves like a terminal status bar while the Dawn artwork stays on its intended light plate in either site theme. */ .prose .diagram-plate { position: relative; max-width: min(100%, 96ch); border: 1px solid var(--rule); background: var(--color-dawn-base); overflow: hidden; } .prose .diagram-plate__image { display: block; padding: clamp(0.65rem, 2vw, 1.25rem); background: var(--color-dawn-base); text-decoration: none; } .prose .diagram-plate img { width: auto; max-height: min(76vh, 1050px); border: 0; object-fit: contain; } .prose .diagram-plate figcaption { display: flex; align-items: center; justify-content: space-between; gap: 0.65rem 1.2rem; padding: 0.65rem 0.8rem; border-top: 1px solid var(--rule); background: var(--surface); color: var(--fg-dim); font-family: var(--font-mono); font-size: var(--step-micro); letter-spacing: var(--track-micro); text-transform: uppercase; } .prose .diagram-plate__downloads { display: flex; flex-wrap: wrap; gap: 0.85rem; } .prose .diagram-plate__downloads a { color: var(--accent); text-decoration: none; } .prose .diagram-plate__downloads a:hover { text-decoration: underline; } @media (max-width: 560px) { .prose .diagram-plate figcaption { align-items: flex-start; flex-direction: column; } } /* ---- Code blocks --------------------------------------------------------- */ /* A figure on the plate, with its caption above the code: the language at the left, the copy control at the right, both in the 9.5px mono the rest of the site labels things in. No window chrome, no traffic-light dots — this is a printed listing of terminal output, not a simulated window. */ .code-pane { position: relative; background: var(--plate); padding: 1rem 1.4rem 1.4rem; /* The full article column, past the prose measure: a fixed-width terminal listing is the one thing on the page that genuinely needs more than 80ch and wraps badly under it. */ max-width: 100%; } /* app.ts tags the pane `.plate`, so `--iris`/`--foam`/`--love` resolve to their night values in this subtree in both modes — the caption colours and the corner brackets stay terminal-toned on the cream page without hardcoded hex. The titlebar closes with a hairline rule, tmux-style. */ .code-pane__bar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 0.9rem; padding-bottom: 0.7rem; border-bottom: 1px solid var(--rule); } .code-pane__lang { font-family: var(--font-mono); font-size: 9.5px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--iris); } .code-copy { display: inline-flex; align-items: center; gap: 0.45rem; font-family: var(--font-mono); font-size: 9.5px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--foam); transition: color 200ms ease; } .code-copy:hover { color: var(--text); } .code-copy:active { transform: translateY(1px); } .code-copy.copied { color: var(--gold); } .code-copy svg { width: 11px; height: 11px; } .code-copy__icon { display: inline-flex; } /* ---- Copy feedback ------------------------------------------------------- */ /* What pressing Copy does to the block (app.ts adds `.is-copied` to the pane and `.copied` to the control, and removes both after 1700ms): 0ms the corner brackets pinch in toward the listing and spring back, now gold — the block has been grabbed 0ms a scan line runs down the listing, top to bottom 0ms COPY settles into COPIED through the scramble pool (script) 140ms the tick draws itself 0ms a gold rule snaps across under the caption, then drains away over the rest of the 1700ms — the confirmation's own countdown Everything is transform, opacity or a stroke offset, so nothing here lays the page out again. Under reduced motion none of it runs: the word, the tick and the gold arrive at once and leave at once. */ .code-pane { --copied-ms: 1700ms; } .code-pane.is-copied { --bracket: var(--gold); } .code-pane__bar::after { content: ''; position: absolute; inset-inline: 0; bottom: -1px; height: 1px; background: var(--gold); transform: scaleX(0); transform-origin: left; pointer-events: none; } .code-pane__sweep { position: absolute; inset: 0; z-index: 3; overflow: hidden; pointer-events: none; visibility: hidden; } /* A 1px gold line with a short wash trailing above it, parked just above the pane. `--sweep` is the pane's height, set by the script at press. */ .code-pane__sweep::before { content: ''; position: absolute; inset-inline: 0; top: -140px; height: 140px; background: linear-gradient(180deg, transparent, color-mix(in srgb, var(--gold) 13%, transparent)); border-bottom: 1px solid var(--gold); } @media (prefers-reduced-motion: no-preference) { .code-pane.is-copied::before { --pinch: 1; animation: copy-pinch 460ms var(--ease) both; } .code-pane.is-copied::after { --pinch: -1; animation: copy-pinch 460ms var(--ease) both; } .code-pane.is-copied .code-pane__sweep { visibility: visible; } .code-pane.is-copied .code-pane__sweep::before { animation: copy-sweep 620ms cubic-bezier(0.45, 0.05, 0.2, 1) both; } .code-pane.is-copied .code-pane__bar::after { animation: copy-drain var(--copied-ms) linear both; } .code-copy.copied svg path { stroke-dasharray: 26; stroke-dashoffset: 26; animation: copy-tick 300ms var(--ease) 140ms forwards; } } /* `--pinch` is +1 on the left pair and -1 on the right, so one set of keyframes moves both inward, past rest on the way back out, and home. */ @keyframes copy-pinch { 0% { transform: translateX(0); } 26% { transform: translateX(calc(var(--pinch) * 7px)); } 62% { transform: translateX(calc(var(--pinch) * -2px)); } 100% { transform: translateX(0); } } @keyframes copy-sweep { from { transform: translateY(0); } to { transform: translateY(calc(var(--sweep, 400px) + 140px)); } } @keyframes copy-drain { 0% { transform: scaleX(0); transform-origin: left; } 12% { transform: scaleX(1); transform-origin: left; } 12.01% { transform: scaleX(1); transform-origin: right; } 100% { transform: scaleX(0); transform-origin: right; } } @keyframes copy-tick { to { stroke-dashoffset: 0; } } /* The scanline film sits at z-index 1 over the plate; the titlebar and the listing ride above it so the CRT texture shows through the transparent code background between glyphs without ever washing over the text. Softened for code because legibility outranks the effect here. */ .code-pane > .code-pane__bar, .code-pane > pre { position: relative; z-index: 2; } .code-pane > .scanlines { opacity: 0.5; } .prose pre.astro-code { margin: 0; padding: 0; overflow-x: auto; font-size: 13px; line-height: 1.7; background: transparent !important; color: var(--color-night-text); } /* Gruvbox's syntax colours (astro.config.mjs inlines them as variables). */ :root[data-palette='gruvbox'] .astro-code, :root[data-palette='gruvbox'] .astro-code span { color: var(--shiki-gruvbox) !important; } .prose pre.astro-code code { font-family: var(--font-mono); display: block; /* Wrapped rather than scrolled: a cheatsheet's value is the whole command being visible and copyable at a glance, and a long `--script-args` tail hidden behind a horizontal scrollbar is the one thing most likely to be pasted wrong. */ white-space: break-spaces; word-break: break-word; } /* First heading of the doc is the page title (rendered separately) */ .prose > h1:first-child { display: none; } /* ---- Credited screenshot (`
`) ---------------------- A screenshot that belongs to someone else. The frame is the diagram plate's (square, ruled, mono caption) but the caption carries a second line: who the image belongs to. That credit is per-image rather than one blanket line per page because an unlicensed upstream is exactly the case where "which of these pictures is yours?" must have an answer on the image itself. The `` is remote by design — pinned to an upstream commit, never copied into this repo — so the box has to survive the hotlink failing: a min-height and the alt text keep the caption meaningful on a broken image instead of collapsing the figure to a caption floating in space. */ .prose figure.shot { margin: 1.6rem 0; border: 1px solid var(--rule); background: var(--surface); } .prose figure.shot img { display: block; width: 100%; height: auto; min-height: 2.5rem; margin: 0; border: 0; border-bottom: 1px solid var(--rule); /* Screenshots are mostly debugger and console captures on a light chrome; letterbox rather than crop so register values stay readable. */ object-fit: contain; background: var(--color-dawn-base); } .prose figure.shot figcaption { padding: 0.6rem 0.8rem; color: var(--fg-dim); font-size: var(--step--1, 0.9em); line-height: 1.5; } .prose figure.shot figcaption code { font-size: 0.95em; } .prose figure.shot .shot-credit { display: block; margin-top: 0.3rem; color: var(--fg-faint); font-family: var(--font-term); font-size: var(--step-micro); letter-spacing: var(--track-micro); text-transform: uppercase; }