Files
jcoffey-dev 034b59dac0
ci / editor-ui (pull_request) Successful in 23s
ci / go (pull_request) Successful in 2m10s
Color code blocks when the site is built
A fenced block that names its language is colored at build time with
chroma, so pages need no script. The markup matches pymdownx.highlight
(div.highlight, Pygments class names), so MkDocs stylesheets work too, and
hl_lines="2 4-5" marks lines. Blocks with no language, text, or a language
chroma doesn't know come out exactly as before.

The starter and the docs pack (1.5.0) carry the colors: hues mixed into the
code's own text color, so they read on light and dark code blocks. Turn it
off with markdown.highlight: false.
2026-10-14 20:24:07 -07:00

181 lines
15 KiB
CSS

/* The docs pack: a sidebar of every part, the page beside it. Colors come
from the theme's variables. */
.vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.wrap.docs { width: min(1260px, 100% - 32px); display: grid; grid-template-columns: 270px minmax(0, 1fr); gap: 56px; padding: 32px 0 64px; align-items: start; }
.side { position: sticky; top: 84px; max-height: calc(100vh - 100px); overflow: auto; padding-right: 6px; font-size: .95rem; }
.toc > summary { display: none; }
.parts, .parts ul { list-style: none; margin: 0; padding: 0; }
.parts > li { margin: 2px 0; }
.parts a { display: block; padding: 6px 10px; border-radius: 8px; color: var(--muted); text-decoration: none; }
.parts a:hover { color: var(--text); background: var(--accent-soft); }
.parts a.part { font-weight: 650; color: var(--text); }
.parts ul { margin: 2px 0 10px 10px; border-left: 2px solid var(--line); padding-left: 6px; }
.parts a[aria-current="page"] { color: var(--text); background: var(--accent-soft); font-weight: 600; }
/* A heading over more pages folds away; its arrow opens it, its name goes
to its page if it has one. */
.parts details > summary { display: flex; align-items: center; list-style: none; cursor: pointer; }
.parts details > summary::-webkit-details-marker { display: none; }
.parts details > summary > .part { flex: 1; }
.parts details > summary::after { content: ""; flex: none; width: .4em; height: .4em; margin: 0 12px 0 8px; border: solid var(--muted); border-width: 0 2px 2px 0; transform: rotate(-45deg); transition: transform .15s; }
.parts details[open] > summary::after { transform: rotate(45deg); }
.parts span.part { display: block; padding: 6px 10px; font-weight: 650; color: var(--text); }
.parts li.here > details > summary > .part { color: var(--accent); }
.parts a.out::after { content: " ↗"; }
.doc { min-width: 0; max-width: 780px; }
.doc h1 { margin: 6px 0 10px; font-size: clamp(2rem, 4vw, 2.6rem); line-height: 1.15; }
.doc .crumb { margin: 0; font-size: .9rem; } .doc .crumb a { color: var(--muted); text-decoration: none; }
.doc .lead { font-size: 1.15rem; color: var(--muted); margin: 0 0 28px; }
.doc .prose h2 { margin-top: 2.2em; padding-top: .4em; border-top: 1px solid var(--line); }
.doc .prose h3 { margin-top: 1.8em; }
.doc .prose blockquote { margin: 1.4em 0; padding: 14px 18px; border-radius: 12px; background: var(--accent-soft); border: 0; color: var(--text); }
.doc .prose blockquote p { margin: .3em 0; }
.doc .prose ol > li, .doc .prose ul > li { margin: .45em 0; }
.doc .prose table { display: block; overflow-x: auto; border-collapse: collapse; width: max-content; max-width: 100%; font-size: .95rem; }
.doc .prose th, .doc .prose td { border: 1px solid var(--line); padding: 8px 12px; text-align: left; vertical-align: top; }
.doc .prose th { background: var(--accent-soft); }
.doc .prose kbd { font-family: var(--font-mono); font-size: .85em; border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 6px; padding: .05em .4em; background: var(--surface); }
.doc .prose pre { overflow-x: auto; }
.prevnext { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 48px; padding-top: 24px; border-top: 1px solid var(--line); }
.prevnext a { display: block; padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px; text-decoration: none; color: var(--text); font-weight: 600; }
.prevnext a:hover { border-color: var(--accent); }
.prevnext a span { display: block; font-size: .85rem; font-weight: 400; color: var(--muted); }
.prevnext .next { text-align: right; grid-column: 2; }
.pagelist { padding: 0; list-style: none; counter-reset: p; }
.pagelist li { counter-increment: p; padding: 14px 0 14px 46px; border-top: 1px solid var(--line); position: relative; }
.pagelist li::before { content: counter(p); position: absolute; left: 0; top: 14px; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--accent-soft); font-weight: 700; font-size: .9rem; }
.pagelist a { font-weight: 650; font-size: 1.1rem; }
.pagelist p { margin: 4px 0 0; color: var(--muted); }
.docs-hero { background: var(--hero, var(--accent-soft)); color: var(--hero-text, var(--text)); padding: 56px 0 48px; }
.docs-hero h1 { margin: 0 0 8px; font-size: clamp(2.2rem, 5vw, 3.2rem); }
.docs-hero .lead { font-size: 1.2rem; max-width: 40em; margin: 0 0 24px; }
.home-intro { margin-top: 32px; max-width: 760px; }
.partgrid { list-style: none; padding: 0; margin: 32px 0 64px; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.partgrid a { display: block; height: 100%; padding: 18px 20px; border: 1px solid var(--line); border-radius: var(--radius, 14px); background: var(--surface); text-decoration: none; color: var(--text); }
.partgrid a:hover { border-color: var(--accent); }
.partgrid strong { display: block; font-size: 1.15rem; margin-bottom: 4px; }
.partgrid span { color: var(--muted); font-size: .95rem; }
/* On this page: a third column on wide screens, left out on narrower ones,
where the page's own headings are close enough. */
.onpage { display: none; }
.doc .prose :is(h2, h3)[id] { scroll-margin-top: 84px; }
@media (min-width: 1201px) {
.wrap.docs.has-onpage { width: min(1380px, 100% - 32px); grid-template-columns: 250px minmax(0, 1fr) 210px; gap: 44px; }
.onpage { display: block; position: sticky; top: 84px; max-height: calc(100vh - 100px); overflow: auto; font-size: .88rem; }
.onpage p { margin: 6px 0 8px; font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.onpage ul { list-style: none; margin: 0; padding: 0; border-left: 2px solid var(--line); }
.onpage a { display: block; padding: 4px 0 4px 12px; line-height: 1.35; color: var(--muted); text-decoration: none; }
.onpage li.h3 a { padding-left: 24px; font-size: .95em; }
.onpage a:hover { color: var(--text); }
}
@media (max-width: 900px) {
.wrap.docs { grid-template-columns: minmax(0, 1fr); gap: 20px; padding-top: 16px; }
.side { position: static; max-height: none; overflow: visible; }
.toc > summary { display: block; cursor: pointer; font-weight: 650; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; }
.toc[open] > summary { margin-bottom: 8px; }
.prevnext { grid-template-columns: minmax(0, 1fr); } .prevnext .next { grid-column: auto; }
}
/* ---- Documentation syntax (admonitions, collapsible blocks, content tabs,
keys, definition lists): the markup MkDocs writes, so a site moved from it
keeps its pages as they are. Colors come from the theme's variables; each
kind of admonition has its own, as in MkDocs Material. Only blocks in a
page's text: a <details> in the page around it (a contents box, a menu)
keeps its own look. ---- */
.admonition, :is(.prose details:not(.toc-box), details:is(.note, .abstract, .info, .tip, .success, .question, .warning, .failure, .danger, .bug, .example, .quote)) {
margin: 1.4em 0; padding: 0 16px; border: 1px solid var(--line);
border-left: 4px solid var(--adm); border-radius: 10px;
background: color-mix(in srgb, var(--adm) 7%, var(--surface));
}
.admonition > :last-child, :is(.prose details:not(.toc-box), details:is(.note, .abstract, .info, .tip, .success, .question, .warning, .failure, .danger, .bug, .example, .quote)) > :last-child { margin-bottom: 14px; }
.admonition-title, :is(.prose details:not(.toc-box), details:is(.note, .abstract, .info, .tip, .success, .question, .warning, .failure, .danger, .bug, .example, .quote)) > summary {
margin: 0 -16px; padding: 10px 16px; font-weight: 650; color: var(--text);
background: color-mix(in srgb, var(--adm) 13%, var(--surface));
}
.admonition-title { margin-bottom: 10px; border-radius: 0 9px 0 0; }
.admonition > .admonition-title:first-child + * { margin-top: 0; }
:is(.prose details:not(.toc-box), details:is(.note, .abstract, .info, .tip, .success, .question, .warning, .failure, .danger, .bug, .example, .quote)) > summary { cursor: pointer; list-style-position: inside; border-radius: 0 9px 9px 0; }
:is(.prose details:not(.toc-box), details:is(.note, .abstract, .info, .tip, .success, .question, .warning, .failure, .danger, .bug, .example, .quote))[open] > summary { margin-bottom: 10px; border-radius: 0 9px 0 0; }
/* The accent unless the kind has a color of its own; :where() keeps this
from outranking the kinds below. */
:where(.admonition, details) { --adm: var(--accent); }
:is(.admonition, details):is(.note, .abstract, .summary, .tldr, .info, .todo) { --adm: #2f7fd1; }
:is(.admonition, details):is(.tip, .hint, .important) { --adm: #0f9d8a; }
:is(.admonition, details):is(.success, .check, .done) { --adm: #2e9e48; }
:is(.admonition, details):is(.question, .help, .faq) { --adm: #7a9a12; }
:is(.admonition, details):is(.warning, .caution, .attention) { --adm: #e08a00; }
:is(.admonition, details):is(.failure, .fail, .missing, .danger, .error) { --adm: #d3324b; }
:is(.admonition, details):is(.bug) { --adm: #cf2f6f; }
:is(.admonition, details):is(.example) { --adm: #7a52d6; }
:is(.admonition, details):is(.quote, .cite) { --adm: #8a8f98; }
.tabbed-set { position: relative; display: flex; flex-direction: column; margin: 1.4em 0; border: 1px solid var(--line); border-radius: 10px; }
.tabbed-set > input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.tabbed-labels { display: flex; flex-wrap: wrap; gap: 2px; padding: 0 8px; border-bottom: 1px solid var(--line); }
.tabbed-labels > label { padding: 10px 12px 8px; cursor: pointer; color: var(--muted); font-weight: 600; font-size: .95em; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabbed-labels > label:hover { color: var(--text); }
.tabbed-content { padding: 0 16px; }
.tabbed-block { display: none; }
.tabbed-set > input:nth-child(1):checked ~ .tabbed-content > .tabbed-block:nth-child(1),
.tabbed-set > input:nth-child(2):checked ~ .tabbed-content > .tabbed-block:nth-child(2),
.tabbed-set > input:nth-child(3):checked ~ .tabbed-content > .tabbed-block:nth-child(3),
.tabbed-set > input:nth-child(4):checked ~ .tabbed-content > .tabbed-block:nth-child(4),
.tabbed-set > input:nth-child(5):checked ~ .tabbed-content > .tabbed-block:nth-child(5),
.tabbed-set > input:nth-child(6):checked ~ .tabbed-content > .tabbed-block:nth-child(6),
.tabbed-set > input:nth-child(7):checked ~ .tabbed-content > .tabbed-block:nth-child(7),
.tabbed-set > input:nth-child(8):checked ~ .tabbed-content > .tabbed-block:nth-child(8),
.tabbed-set > input:nth-child(9):checked ~ .tabbed-content > .tabbed-block:nth-child(9),
.tabbed-set > input:nth-child(10):checked ~ .tabbed-content > .tabbed-block:nth-child(10) { display: block; }
.tabbed-set > input:nth-child(1):checked ~ .tabbed-labels > label:nth-child(1),
.tabbed-set > input:nth-child(2):checked ~ .tabbed-labels > label:nth-child(2),
.tabbed-set > input:nth-child(3):checked ~ .tabbed-labels > label:nth-child(3),
.tabbed-set > input:nth-child(4):checked ~ .tabbed-labels > label:nth-child(4),
.tabbed-set > input:nth-child(5):checked ~ .tabbed-labels > label:nth-child(5),
.tabbed-set > input:nth-child(6):checked ~ .tabbed-labels > label:nth-child(6),
.tabbed-set > input:nth-child(7):checked ~ .tabbed-labels > label:nth-child(7),
.tabbed-set > input:nth-child(8):checked ~ .tabbed-labels > label:nth-child(8),
.tabbed-set > input:nth-child(9):checked ~ .tabbed-labels > label:nth-child(9),
.tabbed-set > input:nth-child(10):checked ~ .tabbed-labels > label:nth-child(10) { color: var(--accent); border-bottom-color: var(--accent); }
.tabbed-set > input:nth-child(1):focus-visible ~ .tabbed-labels > label:nth-child(1),
.tabbed-set > input:nth-child(2):focus-visible ~ .tabbed-labels > label:nth-child(2),
.tabbed-set > input:nth-child(3):focus-visible ~ .tabbed-labels > label:nth-child(3),
.tabbed-set > input:nth-child(4):focus-visible ~ .tabbed-labels > label:nth-child(4),
.tabbed-set > input:nth-child(5):focus-visible ~ .tabbed-labels > label:nth-child(5),
.tabbed-set > input:nth-child(6):focus-visible ~ .tabbed-labels > label:nth-child(6),
.tabbed-set > input:nth-child(7):focus-visible ~ .tabbed-labels > label:nth-child(7),
.tabbed-set > input:nth-child(8):focus-visible ~ .tabbed-labels > label:nth-child(8),
.tabbed-set > input:nth-child(9):focus-visible ~ .tabbed-labels > label:nth-child(9),
.tabbed-set > input:nth-child(10):focus-visible ~ .tabbed-labels > label:nth-child(10) { outline: 2px solid var(--accent); outline-offset: -2px; border-radius: 6px 6px 0 0; }
.keys { white-space: nowrap; }
.keys > span { margin: 0 .15em; color: var(--muted); }
.keys kbd { font-family: var(--font-mono, monospace); font-size: .85em; border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 6px; padding: .05em .4em; background: var(--surface); color: var(--text); }
dl { margin: 1.2em 0; }
dt { font-weight: 650; margin-top: .8em; }
dd { margin: .2em 0 0 1.4em; color: var(--text); }
/* A code block's file name (```json title="servers.json"). */
.highlight > .filename { display: block; margin-top: 1.2em; padding: 6px 14px; font: 600 .85em var(--font-mono, monospace); color: var(--muted); background: var(--surface); border: 1px solid var(--line); border-bottom: 0; border-radius: 10px 10px 0 0; }
.highlight > .filename + pre { margin-top: 0; border-top-left-radius: 0; border-top-right-radius: 0; }
/* Code colors. Blocks that name their language (```go) are colored when the
site is built, with Pygments' class names. Each color is a hue mixed into
the code's own text color, so it reads on a light block and a dark one,
on any theme. A theme can set the hues (--code-keyword and the rest). */
.highlight :is(.k, .kd, .kn, .kp, .kr, .ow, .cp, .cpf, .nd) { color: color-mix(in srgb, var(--code-keyword, #a855f7) 60%, currentColor); }
.highlight :is(.s, .sa, .sb, .sc, .dl, .sd, .s1, .s2, .sh, .sx, .sr, .ss, .l, .ld, .gi) { color: color-mix(in srgb, var(--code-string, #16a34a) 60%, currentColor); }
.highlight :is(.m, .mb, .mf, .mh, .mi, .il, .mo, .se, .si, .no, .kc, .na) { color: color-mix(in srgb, var(--code-number, #ea7a12) 60%, currentColor); }
.highlight :is(.nf, .fm, .nc, .nn, .ne, .gh, .gu) { color: color-mix(in srgb, var(--code-function, #2f7ff0) 60%, currentColor); }
.highlight :is(.kt, .nb, .bp) { color: color-mix(in srgb, var(--code-type, #0d9488) 60%, currentColor); }
.highlight :is(.nt, .nv, .vc, .vg, .vi, .vm, .gd, .gr, .gt) { color: color-mix(in srgb, var(--code-tag, #e0457b) 60%, currentColor); }
.highlight :is(.c, .ch, .cm, .c1, .cs, .gp, .go) { color: color-mix(in srgb, currentColor 68%, transparent); }
.highlight :is(.c, .ch, .cm, .c1, .cs, .ge) { font-style: italic; }
.highlight :is(.gh, .gu, .gs) { font-weight: 700; }
.highlight .hll { display: block; background: color-mix(in srgb, var(--code-mark, #f5c542) 22%, transparent); }