main
ply4 git calls323 ms49 KiB2 cachedprotocol v2
485 lines34 KiBRaw
1// /view.css = Kumo's theme, base and the Kumo utilities this viewer uses + a dark-mode bridge + the viewer layer.
2//
3// Kumo ships tokens as light-dark() inside @layer theme, then an unlayered :root rule pins the light values. Dark values
4// live on [data-mode=dark], which needs a script. We copy those custom properties into @media (prefers-color-scheme:
5// dark) so the same tokens follow the OS with no client JS and no inline style attributes.
6//
7// The standalone sheet is 142 KB, 113 KB of it utilities for every Kumo component. The viewer server-renders Kumo's
8// component class strings from kumo-classes.ts, so only those utilities are kept (kumoSubset). The theme, base and
9// keyframe layers are kept whole; the selection is per utility class, so nothing a used class needs is lost.
10import { captureGroup } from '../absent.ts'
11import { unwrapOr } from '../option.ts'
12import * as KUMO from './kumo-classes.ts'
13import { KUMO_STANDALONE_CSS } from './kumo-standalone.ts'
14import { LAYOUT, RADIUS, SPACE } from './layout.ts'
15import { Sha1, toHex } from 'ply'
17const DARK_MARKER = ':root[data-mode=dark]'
18const MIN_DARK_TOKENS = 10
20export function colorSchemeBridge(standalone: string): string {
21 const markerAt = standalone.indexOf(DARK_MARKER)
22 if (markerAt < 0) throw new Error('Kumo stylesheet has no [data-mode=dark] token block')
23 const open = standalone.indexOf('{', markerAt)
24 const close = standalone.indexOf('}', open)
25 if (open < 0 || close < 0) throw new Error('Kumo dark token block is not closed')
26 const decls = standalone.slice(open + 1, close).split(';').map(part => part.trim()).filter(part => part.startsWith('--'))
27 if (decls.length < MIN_DARK_TOKENS) throw new Error('Kumo dark token block was not recognised')
28 return `@media (prefers-color-scheme: dark){:root{${decls.join(';')};}}`
31type CssNode = { prelude: string; body: string | null }
33/** Split a stylesheet (or a block body) into top-level statements and rules. Strings and comments are skipped. */
34export function cssNodes(css: string): CssNode[] {
35 const out: CssNode[] = []
36 let i = 0
37 let start = 0
38 while (i < css.length) {
39 const ch = css[i]
40 if (ch === '\\') { i += 2; continue }
41 if (ch === '/' && css[i + 1] === '*') { const end = css.indexOf('*/', i + 2); i = end === -1 ? css.length : end + 2; continue }
42 if (ch === '"' || ch === "'") { i++; while (i < css.length && css[i] !== ch) i += css[i] === '\\' ? 2 : 1; i++; continue }
43 if (ch === ';') { const prelude = css.slice(start, i).trim(); if (prelude) out.push({ prelude, body: null }); start = ++i; continue }
44 if (ch === '{') {
45 let depth = 1
46 let j = i + 1
47 while (j < css.length && depth > 0) {
48 const c = css[j]
49 if (c === '\\') { j += 2; continue }
50 if (c === '/' && css[j + 1] === '*') { const end = css.indexOf('*/', j + 2); j = end === -1 ? css.length : end + 2; continue }
51 if (c === '"' || c === "'") { j++; while (j < css.length && css[j] !== c) j += css[j] === '\\' ? 2 : 1; j++; continue }
52 if (c === '{') depth++
53 else if (c === '}') depth--
54 j++
55 }
56 out.push({ prelude: css.slice(start, i).trim(), body: css.slice(i + 1, j - 1) })
57 start = i = j
58 continue
59 }
60 i++
61 }
62 return out
65/** Class names a selector mentions, unescaped (`.h-6\.5` → `h-6.5`). */
66export function selectorClasses(selector: string): string[] {
67 return [...selector.matchAll(/\.((\\.|[\w-])+)/g)].map(m => unwrapOr(captureGroup(m, 1), '').replace(/\\(.)/g, '$1'))
70function serialise(nodes: readonly CssNode[]): string {
71 return nodes.map(node => node.body === null ? `${node.prelude};` : `${node.prelude}{${node.body}}`).join('')
74function keepUtilities(body: string, used: ReadonlySet<string>): string {
75 const kept: CssNode[] = []
76 for (const node of cssNodes(body)) {
77 if (node.body === null) { kept.push(node); continue }
78 if (node.prelude.startsWith('@')) {
79 const inner = keepUtilities(node.body, used)
80 if (inner) kept.push({ prelude: node.prelude, body: inner })
81 continue
82 }
83 if (selectorClasses(node.prelude).some(name => used.has(name))) kept.push(node)
84 }
85 return serialise(kept)
88/** The standalone sheet with only the utility rules whose class is in `used`. */
89export function kumoSubset(standalone: string, used: ReadonlySet<string>): string {
90 return serialise(cssNodes(standalone).map(node => (
91 node.body !== null && node.prelude === '@layer utilities' ? { prelude: node.prelude, body: keepUtilities(node.body, used) } : node
92 )))
95/** Every class token in kumo-classes.ts: the Kumo utilities the pages can emit. */
96export const KUMO_USED: ReadonlySet<string> = new Set(
97 (Object.values(KUMO) as unknown[]).filter((value): value is string => typeof value === "string").flatMap(value => value.split(/\s+/)).filter(Boolean),
100function percentRules(): string {
101 let css = ''
102 for (let step = 0; step <= LAYOUT.percentSteps; step++) css += `.o${step}{left:${step}%}.w${step}{width:${step}%}`
103 return css
106function layoutCss(): string {
107 const L = LAYOUT
108 const S = SPACE
109 const R = RADIUS
110 const phone = `@media (max-width: ${L.stackMinPx - 1}px)`
111 const wide = `@media (min-width: ${L.stackMinPx}px)`
112 return `
113:root { color-scheme: light dark; --viewer-page-max: ${L.pageMaxRem}rem; --viewer-pad: ${L.phonePadPx}px; --viewer-header: ${L.headerPx}px; --row: 44px; }
114@media (min-width: ${L.desktopMinPx}px) { :root { --viewer-pad: ${L.desktopPadPx}px; --row: 38px; } }
115*, *::before, *::after { box-sizing: border-box; }
116html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--viewer-header) + ${S.lg}); }
117body {
118 margin: 0; min-height: 100vh; font-family: var(--font-sans); font-size: var(--text-base); line-height: 1.5;
119 background: var(--color-kumo-canvas); color: var(--text-color-kumo-default);
120 text-rendering: optimizeLegibility; -webkit-font-smoothing: antialiased; overflow-wrap: break-word;
122:focus-visible { outline: 2px solid var(--color-kumo-focus); outline-offset: 2px; }
123a { color: var(--text-color-kumo-link); text-decoration: none; }
124a:hover { text-decoration: underline; text-underline-offset: 0.15em; }
125summary { list-style: none; cursor: pointer; }
126summary::-webkit-details-marker { display: none; }
127.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
128.i { width: 16px; height: 16px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; color: var(--text-color-kumo-subtle); }
129.i-sm { width: 12px; height: 12px; }
130.i-dir { fill: currentColor; stroke: none; color: var(--text-color-kumo-info); opacity: 0.85; }
131.mono, .sha, .oid { font-family: var(--font-mono); font-size: ${L.monoFontPx}px; font-variant-numeric: tabular-nums; }
133/* frame */
134.site-header {
135 position: sticky; top: 0; z-index: 20; height: var(--viewer-header);
136 background: color-mix(in oklch, var(--color-kumo-canvas) 85%, transparent);
137 border-bottom: 1px solid var(--color-kumo-hairline);
138 -webkit-backdrop-filter: saturate(1.4) blur(12px); backdrop-filter: saturate(1.4) blur(12px);
140.site-header-inner, .page { width: min(100%, var(--viewer-page-max)); margin-inline: auto; padding-inline: max(var(--viewer-pad), env(safe-area-inset-left)); }
141.site-header-inner { height: 100%; display: flex; align-items: center; justify-content: space-between; gap: ${S.md}; min-width: 0; }
142.brand { display: inline-flex; align-items: center; gap: ${S.sm}; color: var(--text-color-kumo-strong); font-weight: 600; letter-spacing: -0.02em; font-size: var(--text-lg); }
143.brand:hover { text-decoration: none; }
144.mark { width: 10px; height: 10px; border-radius: 3px; background: var(--text-color-kumo-brand); flex: none; }
145.brand-sub { color: var(--text-color-kumo-subtle); font-size: var(--text-xs); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
146.page { padding-top: ${S.xl}; padding-bottom: ${S.xxl}; display: flex; flex-direction: column; gap: ${S.lg}; min-width: 0; }
147.page > * { min-width: 0; }
149/* repository header */
150.repo-head { display: flex; align-items: flex-end; justify-content: space-between; gap: ${S.md}; min-width: 0; }
151${phone} { .repo-head { flex-wrap: wrap; align-items: flex-start; } .repo-tools { flex: 1 1 auto; min-width: 0; } }
152.repo-id { min-width: 0; flex: 1 1 auto; }
153.repo-scope { margin: 0 0 2px; font-size: var(--text-sm); color: var(--text-color-kumo-subtle); display: flex; flex-wrap: wrap; gap: ${S.xs}; }
154.repo-host { color: var(--text-color-kumo-subtle); }
155.repo-host::after { content: "·"; margin-left: ${S.xs}; color: var(--text-color-kumo-inactive); }
156.repo-scope a { color: inherit; }
157.repo-slash { color: var(--text-color-kumo-inactive); }
158.repo-name { margin: 0; font-size: var(--text-2xl); line-height: 1.15; font-weight: 600; letter-spacing: -0.025em; overflow-wrap: anywhere; }
159.repo-name a { color: var(--text-color-kumo-strong); }
160.repo-tools { display: flex; align-items: center; gap: ${S.sm}; flex: none; }
161.refbox { position: relative; }
162.ref-summary { height: 32px; padding-inline: 10px; gap: 6px; font-size: var(--text-sm); }
163.ref-summary .i { color: var(--text-color-kumo-subtle); }
164.ref-v { max-width: 12rem; overflow: hidden; text-overflow: ellipsis; font-family: var(--font-mono); font-size: var(--text-xs); font-weight: 600; }
165.ref-pop {
166 position: absolute; z-index: 30; top: calc(100% + 6px); right: 0; width: min(18rem, calc(100vw - 2 * var(--viewer-pad)));
167 display: grid; gap: 6px; padding: ${S.md}; border-radius: ${R.lg};
168 background: var(--color-kumo-base); box-shadow: 0 0 0 1px var(--color-kumo-line), 0 12px 32px var(--color-kumo-shadow-drop);
170.ref-label { font-size: var(--text-xs); font-weight: 500; color: var(--text-color-kumo-subtle); }
171.ref-field { width: 100%; height: 34px; font-size: var(--text-base); }
172.ref-go { margin-top: ${S.xs}; height: 34px; width: 100%; }
173${phone} { .repo-head { position: relative; } .refbox { position: static; } .ref-pop { left: 0; right: 0; width: auto; } }
174.crumbs { margin-top: -${S.xs}; height: auto; min-height: 28px; flex-wrap: wrap; white-space: normal; row-gap: 2px; font-size: var(--text-sm); }
175.crumbs .crumb { color: var(--text-color-kumo-link); }
176.crumbs .sep { padding-inline: 4px; }
177.crumbs .here { overflow-wrap: anywhere; }
179/* cards (Kumo LayerCard) */
180.card { padding: 0 2px 2px; }
181.card-head { min-height: 44px; padding: 10px ${S.md}; flex-wrap: wrap; font-size: var(--text-sm); }
182.card-head:has(.lc) { display: flex; flex-direction: column; align-items: stretch; width: 100%; }
183.card-head .i { color: var(--text-color-kumo-subtle); }
184.card-title { color: var(--text-color-kumo-strong); font-weight: 600; }
185a.card-title:hover { color: var(--text-color-kumo-link); }
186.card-count { margin-left: auto; font-size: var(--text-xs); color: var(--text-color-kumo-subtle); font-variant-numeric: tabular-nums; }
187.card-body { min-width: 0; }
188.pad { padding: ${S.md}; }
189.empty { margin: 0; padding: ${S.md} ${S.lg}; color: var(--text-color-kumo-subtle); font-size: var(--text-sm); border-top: 1px solid var(--color-kumo-hairline); }
190.card-body > .empty:first-child { border-top: 0; }
192/* latest commit (the file card's header) */
193.lc { width: 100%; min-width: 0; display: grid; gap: 6px; }
194.lc-by { display: flex; align-items: center; gap: ${S.sm}; min-width: 0; font-size: var(--text-sm); }
195.avatar {
196 width: 22px; height: 22px; flex: none; border-radius: 999px; display: inline-grid; place-items: center;
197 background: var(--color-kumo-fill); color: var(--text-color-kumo-strong); font-size: 10px; font-weight: 600; letter-spacing: 0.02em;
199.lc-author { color: var(--text-color-kumo-strong); font-weight: 600; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
200.lc-by .when { color: var(--text-color-kumo-subtle); font-weight: 400; white-space: nowrap; }
201.lc-right { margin-left: auto; display: inline-flex; align-items: center; gap: ${S.sm}; flex: none; }
202.lc-right .sha { color: var(--text-color-kumo-subtle); }
203.lc-right .sha:hover { color: var(--text-color-kumo-link); }
204.lc-subject { color: var(--text-color-kumo-default); font-weight: 500; font-size: var(--text-base); line-height: 1.4; overflow-wrap: anywhere; }
205.lc-only { margin: 0; }
206.lc-msg > summary { display: flex; align-items: flex-start; gap: ${S.sm}; }
207.lc-msg > summary .lc-subject { flex: 1; min-width: 0; }
208.more {
209 flex: none; margin-top: 1px; height: 20px; padding: 0 7px; border-radius: 6px; display: inline-flex; align-items: center;
210 background: var(--color-kumo-fill); color: var(--text-color-kumo-strong); font-weight: 700; font-size: 12px; letter-spacing: 0.08em;
212.lc-msg > summary:hover .more { background: var(--color-kumo-fill-hover); }
213.lc-msg[open] .more { box-shadow: inset 0 0 0 1px var(--color-kumo-line); }
214.msg-body { margin-top: ${S.sm}; padding-top: ${S.sm}; border-top: 1px dashed var(--color-kumo-line); }
215.msg-body, .lc-msg { width: 100%; min-width: 0; }
216.msg-p { margin: 0 0 ${S.sm}; white-space: pre-wrap; overflow-wrap: anywhere; color: var(--text-color-kumo-default); font-weight: 400; font-size: var(--text-sm); line-height: 1.55; max-width: none; }
217.trailers { margin: ${S.sm} 0 0; display: grid; gap: 2px; font-size: var(--text-xs); color: var(--text-color-kumo-subtle); font-weight: 400; }
218.trailers div { display: flex; gap: ${S.sm}; min-width: 0; }
219.trailers dt { flex: none; }
220.trailers dt::after { content: ":"; }
221.trailers dd { margin: 0; min-width: 0; overflow-wrap: anywhere; color: var(--text-color-kumo-strong); }
222.trailers a { color: inherit; text-decoration: underline; text-decoration-color: var(--color-kumo-line); }
223.when { cursor: help; }
225/* file list */
226.files { list-style: none; margin: 0; padding: 0; }
227.files li + li { border-top: 1px solid var(--color-kumo-hairline); }
228.files .row { display: flex; align-items: center; gap: 10px; min-height: var(--row); padding: 0 ${S.md}; color: var(--text-color-kumo-default); }
229.files .row:hover { background: var(--color-kumo-tint); text-decoration: none; }
230.files .row:hover .name { color: var(--text-color-kumo-link); text-decoration: underline; text-underline-offset: 0.15em; }
231.files .name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
232.files .oid { color: var(--text-color-kumo-default); font-size: ${L.monoFontPx}px; }
233${phone} { .files .oid { display: none; } }
235/* recent commits */
236.log { list-style: none; margin: 0; padding: 0; }
237.log li + li { border-top: 1px solid var(--color-kumo-hairline); }
238.log-row { display: grid; gap: 3px; padding: 10px ${S.md}; color: var(--text-color-kumo-default); min-width: 0; }
239.log-row:hover { background: var(--color-kumo-tint); text-decoration: none; }
240.log-row:hover .log-subject { color: var(--text-color-kumo-link); }
241.log-subject { font-weight: 500; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
242.log-meta { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 6px; font-size: var(--text-xs); color: var(--text-color-kumo-subtle); }
243.log-meta .sha { color: var(--text-color-kumo-link); }
244.dot-sep { color: var(--text-color-kumo-inactive); }
245${wide} {
246 .log-row { grid-template-columns: minmax(0, 1fr) auto; align-items: baseline; column-gap: ${S.lg}; }
247 .log-subject { -webkit-line-clamp: 1; }
250/* markdown */
251.md { padding: ${S.lg} ${S.lg} ${S.xl}; font-size: 15px; line-height: 1.65; color: var(--text-color-kumo-default); min-width: 0; }
252${wide} { .md { padding: ${S.xl} 2rem 2rem; } }
253.md > :first-child { margin-top: 0; }
254.md > :last-child { margin-bottom: 0; }
255.md p, .md ul, .md ol, .md blockquote, .md .md-code, .md .md-table { margin: 0 0 ${S.lg}; }
256.md h2, .md h3, .md h4, .md h5, .md h6 { color: var(--text-color-kumo-strong); line-height: 1.25; letter-spacing: -0.015em; margin: 1.75em 0 0.6em; font-weight: 600; scroll-margin-top: calc(var(--viewer-header) + ${S.lg}); }
257.md h2 { font-size: 1.6em; letter-spacing: -0.025em; padding-bottom: 0.3em; border-bottom: 1px solid var(--color-kumo-hairline); }
258.md h3 { font-size: 1.3em; padding-bottom: 0.25em; border-bottom: 1px solid var(--color-kumo-hairline); }
259.md h4 { font-size: 1.1em; }
260.md h5 { font-size: 1em; }
261.md h6 { font-size: 0.9em; color: var(--text-color-kumo-subtle); }
262.md strong { font-weight: 600; color: var(--text-color-kumo-strong); }
263.md a { color: var(--text-color-kumo-link); text-decoration: underline; text-decoration-color: color-mix(in oklch, currentColor 35%, transparent); text-underline-offset: 0.18em; }
264.md a:hover { text-decoration-color: currentColor; }
265.md hr { border: 0; height: 1px; background: var(--color-kumo-line); margin: ${S.xl} 0; }
266.md ul, .md ol { padding-left: 1.5em; }
267.md li + li { margin-top: 0.3em; }
268.md li > ul, .md li > ol { margin: 0.3em 0 0; }
269.md li > p { margin: 0 0 0.5em; }
270.md li::marker { color: var(--text-color-kumo-subtle); }
271.md .task-item { list-style: none; margin-left: -1.5em; display: flex; gap: 0.55em; align-items: baseline; }
272.md .task-item > ul { flex-basis: 100%; }
273.md .task-item { flex-wrap: wrap; }
274.md .task { flex: none; width: 1em; height: 1em; transform: translateY(0.15em); border-radius: 4px; border: 1.5px solid var(--color-kumo-line); display: inline-grid; place-items: center; font-size: 0.7em; font-weight: 700; line-height: 1; }
275.md .task.done { background: var(--color-kumo-brand); border-color: var(--color-kumo-brand); color: #fff; }
276.md blockquote { padding: 0.1em 0 0.1em 1em; border-left: 3px solid var(--color-kumo-line); color: var(--text-color-kumo-subtle); }
277.md blockquote > :last-child { margin-bottom: 0; }
278.md code { font-family: var(--font-mono); font-size: 0.86em; }
279.md :not(pre) > code { background: var(--color-kumo-recessed); border: 1px solid var(--color-kumo-hairline); padding: 0.1em 0.35em; border-radius: 5px; overflow-wrap: anywhere; }
280.md .md-code { border: 1px solid var(--color-kumo-hairline); border-radius: ${R.md}; background: var(--color-kumo-recessed); overflow: hidden; }
281.md .md-code-lang { padding: 6px ${S.md}; font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.03em; color: var(--text-color-kumo-subtle); border-bottom: 1px solid var(--color-kumo-hairline); }
282.md pre { margin: 0; padding: ${S.md} ${S.lg}; overflow-x: auto; font-size: 13px; line-height: 1.55; tab-size: 2; }
283.md pre code { font-size: inherit; }
284.md .md-table { overflow-x: auto; border: 1px solid var(--color-kumo-hairline); border-radius: ${R.md}; }
285.md table { border-collapse: collapse; min-width: 100%; font-size: var(--text-sm); line-height: 1.45; }
286.md th, .md td { padding: 8px 12px; text-align: left; vertical-align: top; border-top: 1px solid var(--color-kumo-hairline); min-width: 4.5rem; }
287.md th + th, .md td + td { border-left: 1px solid var(--color-kumo-hairline); }
288.md thead th { border-top: 0; background: var(--color-kumo-elevated); font-weight: 600; color: var(--text-color-kumo-strong); white-space: nowrap; }
289.md tbody tr:nth-child(even) td { background: color-mix(in oklch, var(--color-kumo-elevated) 55%, transparent); }
290.md td code { overflow-wrap: normal; word-break: keep-all; }
291.md td:not(:first-child), .md th:not(:first-child) { min-width: 9rem; }
292.md .al-c { text-align: center; } .md .al-r { text-align: right; }
293.md .md-img { display: inline-flex; align-items: center; gap: 4px; padding: 1px 8px; border-radius: 999px; border: 1px dashed var(--color-kumo-line); font-size: var(--text-sm); }
294.md .md-img::before { content: "image"; font-size: 10px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-color-kumo-subtle); }
295${phone} {
296 .md { font-size: 15px; padding: ${S.lg} 14px ${S.xl}; }
297 .md pre { white-space: pre-wrap; overflow-wrap: anywhere; padding: ${S.md}; font-size: 12.5px; }
298 .md th, .md td { padding: 7px 10px; }
301/* file view */
302.file-meta { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; color: var(--text-color-kumo-subtle); font-weight: 400; font-variant-numeric: tabular-nums; }
303.raw-link { margin-left: auto; height: 28px; gap: 4px; color: var(--text-color-kumo-default); }
304.raw-link:hover { text-decoration: none; color: var(--text-color-kumo-default); }
305.raw-link .i { width: 14px; height: 14px; }
306.seg-tabs { display: inline-flex; padding: 2px; gap: 2px; border-radius: 8px; background: var(--color-kumo-recessed); margin-left: auto; }
307.seg-tabs + .raw-link { margin-left: 0; }
308.tab { padding: 3px 10px; border-radius: 6px; font-size: var(--text-xs); font-weight: 500; color: var(--text-color-kumo-subtle); }
309.tab:hover { text-decoration: none; color: var(--text-color-kumo-default); }
310.anchor { display: block; height: 0; scroll-margin-top: calc(var(--viewer-header) + 80px); }
311.has-md .code-wrap { display: none; }
312.has-md:has(#code:target, .line:target) .code-wrap { display: block; }
313.has-md:has(#code:target, .line:target) .md-view { display: none; }
314.has-md:not(:has(#code:target, .line:target)) .tab-preview,
315.has-md:has(#code:target, .line:target) .tab-code { background: var(--color-kumo-base); color: var(--text-color-kumo-strong); box-shadow: 0 0 0 1px var(--color-kumo-hairline); }
316.code-wrap { min-width: 0; max-width: 100%; }
317.code-bar { display: flex; justify-content: flex-end; padding: 6px ${S.md} 0; }
318.wrap-toggle { display: inline-flex; align-items: center; gap: 6px; font-size: var(--text-xs); color: var(--text-color-kumo-subtle); cursor: pointer; }
319.wrap-toggle input { margin: 0; }
320.code {
321 overflow-x: auto; max-width: 100%; font-family: var(--font-mono); font-size: ${L.codeFontPx}px; line-height: 1.6; padding: ${S.sm} 0; tab-size: 4;
322 scrollbar-width: thin; scrollbar-color: var(--color-kumo-line) transparent;
324.code::-webkit-scrollbar { height: ${L.codeScrollPx}px; }
325.code::-webkit-scrollbar-thumb { background: var(--color-kumo-line); border-radius: ${R.pill}; }
326.code-wrap:has(.wrap-toggle input:checked) .line { min-width: 0; }
327.code-wrap:has(.wrap-toggle input:checked) .src { white-space: pre-wrap; overflow-wrap: anywhere; min-width: 0; }
328.line { display: flex; min-width: max-content; }
329.line:target { background: var(--color-kumo-warning-tint); }
330.ln {
331 position: sticky; left: 0; width: ${L.lineGutterRem}rem; flex: none; padding: 0 ${S.md} 0 ${S.sm};
332 color: var(--text-color-kumo-inactive); text-align: right; user-select: none; -webkit-user-select: none;
333 font-variant-numeric: tabular-nums; background: var(--color-kumo-base);
335.ln:hover { color: var(--text-color-kumo-link); text-decoration: none; }
336.line:target .ln { background: var(--color-kumo-warning-tint); color: var(--text-color-kumo-strong); }
337.src { white-space: pre; padding-right: ${S.lg}; }
338${phone} {
339 .code { font-size: ${L.phoneCodeFontPx}px; }
340 .line { min-width: 0; }
341 .ln { position: static; width: 2.75rem; padding-right: 10px; }
342 .src { white-space: pre-wrap; overflow-wrap: anywhere; min-width: 0; flex: 1; padding-right: ${S.md}; }
345/* diagnostics + waterfall */
346.diag { margin-top: ${S.md}; }
347.diag-box { border-radius: ${R.lg}; background: var(--color-kumo-elevated); box-shadow: inset 0 0 0 1px var(--color-kumo-hairline); }
348.diag-sum { display: flex; align-items: center; gap: ${S.sm}; min-height: 44px; padding: 0 ${S.md}; font-size: var(--text-sm); }
349.diag-title { font-weight: 600; color: var(--text-color-kumo-strong); }
350.diag-pill { color: var(--text-color-kumo-subtle); font-variant-numeric: tabular-nums; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
351.diag-chev { margin-left: auto; transition: transform 0.15s; }
352.diag-box[open] .diag-chev { transform: rotate(180deg); }
353.diag-body { padding: 0 ${S.md} ${S.md}; display: grid; gap: ${S.md}; min-width: 0; }
354.diag-body .banner { margin: 0; }
355.banner a { color: inherit; text-decoration: underline; }
356.kv { margin: 0; display: grid; gap: 4px; font-size: var(--text-xs); min-width: 0; }
357.kv div { display: grid; grid-template-columns: 6.5rem minmax(0, 1fr); gap: ${S.sm}; align-items: baseline; }
358.kv dt { color: var(--text-color-kumo-subtle); }
359.kv dd { margin: 0; overflow-wrap: anywhere; min-width: 0; }
360.diag-links { margin: 0; font-size: var(--text-xs); color: var(--text-color-kumo-subtle); }
361.wf { border-radius: ${R.md}; background: var(--color-kumo-base); box-shadow: 0 0 0 1px var(--color-kumo-hairline); font-size: var(--text-xs); min-width: 0; overflow: hidden; }
362.wf-head, .wf-sum { display: grid; grid-template-columns: minmax(0, 1fr) 2.75rem 5.25rem 4rem; column-gap: ${S.sm}; align-items: center; padding: 0 ${S.md}; }
363.wf-head { min-height: 32px; color: var(--text-color-kumo-subtle); font-weight: 500; background: var(--color-kumo-elevated); border-bottom: 1px solid var(--color-kumo-hairline); }
364.wf-axis { display: none; justify-content: space-between; font-variant-numeric: tabular-nums; font-weight: 400; }
365.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
366.wf-row + .wf-row { border-top: 1px solid var(--color-kumo-hairline); }
367.wf-sum { row-gap: 6px; padding-top: 9px; padding-bottom: 10px; }
368.wf-sum:hover { background: var(--color-kumo-tint); }
369.wf-name { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 6px; min-width: 0; }
370.wf-call { font-family: var(--font-mono); font-weight: 600; color: var(--text-color-kumo-strong); }
371.wf-tag { color: var(--text-color-kumo-subtle); font-family: var(--font-mono); font-size: 11px; }
372.wf-ms { color: var(--text-color-kumo-strong); font-weight: 600; }
373.wf-hit { color: var(--text-color-kumo-success); }
374.err .wf-call, .err .wf-status { color: var(--text-color-kumo-danger); }
375.wf-track { grid-column: 1 / -1; position: relative; height: 6px; border-radius: 999px; background: var(--color-kumo-recessed); }
376.wf-bar { position: absolute; top: 0; bottom: 0; border-radius: inherit; min-width: 3px; }
377.c-err { background: var(--color-kumo-danger); }
378.c-hit { background: var(--color-kumo-success); }
379.c-discover { background: var(--color-kumo-info); }
380.c-fetch { background: var(--color-kumo-badge-purple); }
381.c-fallback { background: var(--color-kumo-warning); }
382.wf-detail { padding: 0 ${S.md} ${S.md}; }
383.detail { margin: 0; padding: ${S.sm} ${S.md}; border-radius: ${R.sm}; background: var(--color-kumo-recessed); white-space: pre-wrap; overflow-wrap: anywhere; color: var(--text-color-kumo-subtle); font-family: var(--font-mono); font-size: 11px; line-height: 1.5; }
384.wf-pack { display: inline-block; margin-top: ${S.sm}; font-weight: 500; }
385.wf-caption { margin: 0; padding: ${S.sm} ${S.md} 0; color: var(--text-color-kumo-subtle); line-height: 1.5; border-top: 1px solid var(--color-kumo-hairline); }
386.wf-caption + .wf-legend { border-top: 0; }
387.wf-legend { margin: 0; padding: ${S.sm} ${S.md}; display: flex; flex-wrap: wrap; gap: 4px 12px; color: var(--text-color-kumo-subtle); border-top: 1px solid var(--color-kumo-hairline); }
388.dot { display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 5px; vertical-align: 0; }
389${wide} {
390 .wf-head, .wf-sum { grid-template-columns: minmax(9rem, 13rem) 3rem 5.5rem 4rem minmax(0, 1fr); column-gap: ${S.md}; }
391 .wf-axis { display: flex; }
392 .wf-track { grid-column: auto; height: 8px; }
393 .wf-sum { padding-top: 8px; padding-bottom: 8px; }
395/* ply strip: the page's git work under the title, linking to the waterfall */
396.ply-strip { display: grid; gap: 6px; margin: 0 0 ${S.md}; padding: ${S.sm} ${S.md}; border-radius: ${R.md}; background: var(--color-kumo-elevated); box-shadow: inset 0 0 0 1px var(--color-kumo-hairline); color: var(--text-color-kumo-subtle); font-size: var(--text-xs); font-variant-numeric: tabular-nums; }
397.ply-strip:hover { text-decoration: none; background: var(--color-kumo-tint); }
398.ply-strip-text { display: flex; flex-wrap: wrap; gap: 2px 10px; align-items: baseline; min-width: 0; }
399.ply-strip-brand { font-family: var(--font-mono); font-weight: 600; color: var(--text-color-kumo-brand); }
400.ply-strip-track { position: relative; height: 6px; border-radius: 999px; background: var(--color-kumo-recessed); }
401.ply-strip-track .wf-bar { min-width: 2px; }
402.site-footer { display: flex; flex-wrap: wrap; justify-content: space-between; gap: ${S.sm}; padding: ${S.md} 2px 0; font-size: var(--text-xs); color: var(--text-color-kumo-subtle); }
403.site-footer a { color: inherit; font-weight: 500; }
404.site-footer .build > span { white-space: nowrap; }
406/* home */
407.hero { padding: ${S.lg} 0 0; }
408.kicker { margin: 0 0 ${S.sm}; font-size: var(--text-xs); font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-color-kumo-brand); }
409.display { margin: 0; color: var(--text-color-kumo-strong); font-size: 1.75rem; font-weight: 650; letter-spacing: -0.03em; line-height: 1.12; }
410.lede { margin: ${S.sm} 0 0; max-width: 40rem; color: var(--text-color-kumo-subtle); font-size: 15px; line-height: 1.55; }
411.stack-form { display: flex; flex-direction: column; gap: ${S.sm}; margin-top: ${S.lg}; }
412.stack-form .control { flex: none; height: 44px; padding: 0 14px; border-radius: 10px; line-height: normal; font-size: 16px; width: 100%; min-width: 0; -webkit-appearance: none; appearance: none; }
413.stack-form .btn { height: 44px; padding: 0 20px; border-radius: 10px; font-size: var(--text-base); }
414.is-primary:hover { opacity: ${L.primaryHoverOpacity}; }
415.banner { margin: 0; }
416.chips { display: flex; flex-wrap: wrap; gap: ${S.sm}; margin-top: ${S.md}; }
417.chip { display: inline-flex; align-items: center; height: 30px; padding: 0 12px; border-radius: 999px; background: var(--color-kumo-base); box-shadow: 0 0 0 1px var(--color-kumo-line); color: var(--text-color-kumo-default); font-size: var(--text-sm); font-weight: 500; }
418.chip:hover { background: var(--color-kumo-tint); text-decoration: none; }
419.repo-list { list-style: none; margin: 0; padding: 0; }
420.repo-list li + li { border-top: 1px solid var(--color-kumo-hairline); }
421.repo-list a { display: flex; align-items: center; gap: 10px; min-height: var(--row); padding: 0 ${S.md}; color: var(--text-color-kumo-default); font-weight: 500; }
422.repo-list a:hover { background: var(--color-kumo-tint); text-decoration: none; color: var(--text-color-kumo-link); }
423.repo-list .go { margin-left: auto; color: var(--text-color-kumo-inactive); font-size: var(--text-xs); font-weight: 400; }
424.card-grid { display: grid; gap: ${S.lg}; }
425.host-list { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; margin: 0; padding: 0; }
426.host-list li { font-family: var(--font-mono); font-size: var(--text-xs); background: var(--color-kumo-recessed); border-radius: 999px; padding: 2px 9px; }
427.note { color: var(--text-color-kumo-subtle); font-size: var(--text-sm); margin: ${S.sm} 0 0; }
428.limits { margin: 0; display: grid; gap: 6px; }
429.limits div { display: flex; justify-content: space-between; gap: ${S.md}; font-size: var(--text-sm); }
430.limits dt { color: var(--text-color-kumo-subtle); }
431.limits dd { margin: 0; font-variant-numeric: tabular-nums; text-align: right; }
432.steps { display: grid; gap: ${S.md}; }
433.step strong { display: block; font-size: var(--text-sm); font-weight: 600; color: var(--text-color-kumo-strong); margin-bottom: 2px; }
434.step span { color: var(--text-color-kumo-subtle); font-size: var(--text-sm); }
435.error-card { padding: ${S.xl}; display: grid; gap: ${S.md}; }
436.error-kicker { margin: 0; font-family: var(--font-mono); font-size: var(--text-xs); color: var(--text-color-kumo-subtle); letter-spacing: 0.04em; }
437.reason > summary { color: var(--text-color-kumo-subtle); font-size: var(--text-xs); font-weight: 600; }
438.reason p { margin: ${S.sm} 0 0; color: var(--text-color-kumo-subtle); font-size: var(--text-xs); overflow-wrap: anywhere; }
439${wide} {
440 .stack-form { flex-direction: row; align-items: center; }
441 .stack-form .control { flex: 1 1 auto; }
442 .card-grid { grid-template-columns: 1.1fr 0.9fr; }
443 .steps { grid-template-columns: 1fr 1fr 1fr; }
444 .display { font-size: 2.25rem; }
445 .repo-name { font-size: 1.75rem; }
448/* pack map */
449.section-title { margin: 0; font-size: var(--text-lg); font-weight: 600; color: var(--text-color-kumo-strong); }
450.pack-list { display: flex; flex-direction: column; }
451.pack-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; column-gap: ${S.md}; align-items: baseline; padding: ${S.sm} ${S.lg}; border-top: 1px solid var(--color-kumo-hairline); }
452.pack-row:first-child { border-top: 0; }
453.pack-row.on, .pack-row:target { background: var(--color-kumo-warning-tint); }
454.pack-row:hover { background: var(--color-kumo-tint); }
455.pack-off { color: var(--text-color-kumo-subtle); white-space: nowrap; font-variant-numeric: tabular-nums; }
456.pack-row .sub { grid-column: 1 / -1; color: var(--text-color-kumo-subtle); font-size: var(--text-xs); }
457.meta-k { font-weight: 500; margin-right: ${S.xs}; }
458.subject { margin: 0; font-size: var(--text-base); font-weight: 600; color: var(--text-color-kumo-strong); overflow-wrap: anywhere; }
459.section-label { margin: ${S.sm} 0 0; font-size: var(--text-xs); font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--text-color-kumo-subtle); }
460.plain-list { list-style: none; margin: 0; padding: 0; font-size: var(--text-sm); }
461.plain-list li { display: flex; gap: ${S.sm}; padding: 6px 0; border-top: 1px solid var(--color-kumo-hairline); }
462.packbar { display: flex; height: ${L.packBarPx}px; width: 100%; border-radius: 6px; overflow: hidden; background: var(--color-kumo-fill); }
463.packbar a, .packbar span { display: block; height: 100%; flex: none; }
464.packbar a.on, .packbar a:focus-visible { outline: 2px solid var(--color-kumo-focus); outline-offset: -2px; }
465.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: var(--text-xs); color: var(--text-color-kumo-subtle); }
466.sw { display: inline-block; width: ${L.swatchPx}px; height: ${L.swatchPx}px; border-radius: 2px; margin-right: 5px; vertical-align: -1px; }
467.stats { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: var(--text-sm); }
468.stats strong { font-variant-numeric: tabular-nums; font-weight: 600; }
469.surface-pad { padding: ${S.md} ${S.lg}; }
470@media (prefers-reduced-motion: reduce) { .diag-chev { transition: none; } }
471${percentRules()}
475const KUMO_SHEET = kumoSubset(KUMO_STANDALONE_CSS, KUMO_USED)
477export const VIEWER_CSS = `${KUMO_SHEET}\n${colorSchemeBridge(KUMO_STANDALONE_CSS)}\n${layoutCss()}`
479/**
480 * The stylesheet's URL carries a hash of its bytes, so a browser can never pair new markup with a stale sheet: a deploy
481 * that changes the CSS changes the href (2026-10-31: an iPhone kept the old 167 KB /view.css for its max-age=3600 and
482 * rendered the redesigned HTML unstyled). The hashed URL is immutable; /view.css stays for HTML cached before this.
483 */
484export const VIEWER_CSS_HASH: string = toHex(new Sha1().update(new TextEncoder().encode(VIEWER_CSS)).digest()).slice(0, 12)
485export const VIEWER_CSS_PATH = `/view.${VIEWER_CSS_HASH}.css`
Diagnostics4 git calls · 323 ms
CallStatusSizeTime0323 ms
discover200152 B2 ms
git.upload-pack discover
http.response.status_code=200
git.upstream.cf_ray=-
git.upstream.phase=ls-refs
git.upstream.dur_ms=2
git.response.bytes=152
git.server.agent=gitty/1.0
git.server.object_format=sha1
git.server.caps=agent ls-refs fetch object-format
git.server.fetch=shallow filter sideband-all
git.protocol.version=2
git.pkt.frames=8
git.pkt.data=6
git.pkt.flush=2
git.pkt.delim=0
git.pkt.bytes=152
git.pkt.payload.max=34
ls-refs200145 B · hit2 ms
git.upload-pack ls-refs
http.response.status_code=200
git.upstream.cf_ray=-
git.upstream.phase=ls-refs
git.upstream.dur_ms=2
git.response.bytes=145
git.response.cache=HIT
git.response.duration_ms=2
git.protocol.version=2
git.pkt.frames=3
git.pkt.data=2
git.pkt.flush=1
git.pkt.delim=0
git.pkt.bytes=145
git.pkt.payload.max=76
git.ls_refs.count=2
git.ls_refs.head=refs/heads/main
fetchblob:none · deepen 1020040 KiB · hit2 ms
git.upload-pack fetch
http.response.status_code=200
git.upstream.cf_ray=-
git.upstream.phase=fetch
git.upstream.dur_ms=2
git.response.bytes=41349
git.response.cache=HIT
git.response.duration_ms=2
git.fetch.filter=blob:none
git.fetch.filter.requested=tree:0
git.fetch.filter.fallback=blob:none
git.fetch.filter.learned=false
git.fetch.wants=526b305930b8ef382f2d7a1f9c0238730a585921
git.fetch.haves.count=0
git.fetch.deepen=10
git.fetch.thin_pack=false
git.fetch.ofs_delta=true
git.protocol.version=2
git.pkt.frames=6
git.pkt.data=4
git.pkt.flush=1
git.pkt.delim=1
git.pkt.bytes=41349
git.pkt.payload.max=41254
git.sideband.band1.bytes=41253
git.sideband.band2.bytes=0
git.sideband.band3.bytes=0
git.pack.objects=61
git.pack.bytes=41253
git.pack.ofs_delta=0
git.pack.ref_delta=0
git.pack.chain.max=0
git.pack.trailer=ab60efef4b7243678c75de64a4386986ee885c1c
git.pack.full=61
Open pack map
fetch2008.1 KiB319 ms
git.upload-pack fetch
http.response.status_code=200
git.upstream.cf_ray=-
git.upstream.phase=fetch
git.upstream.dur_ms=319
git.response.bytes=8332
git.response.cache=MISS
git.response.duration_ms=319
git.fetch.wants=522d80dacb261531d4c05e18246af570e70d5ec8
git.fetch.haves.count=0
git.fetch.deepen=0
git.fetch.thin_pack=false
git.fetch.ofs_delta=true
git.protocol.version=2
git.pkt.frames=3
git.pkt.data=2
git.pkt.flush=1
git.pkt.delim=0
git.pkt.bytes=8332
git.pkt.payload.max=8311
git.sideband.band1.bytes=8310
git.sideband.band2.bytes=0
git.sideband.band3.bytes=0

Each row is one HTTP round trip ply made to the git server for this page, on one timeline. discover asks what the server speaks, ls-refs lists branch tips, fetch brings objects by id. A hit was served by Workers Cache. Tap a row for its wire details.

Remote
https://5ad2236b39de4c8bd8f6270ea63f3ea9.artifacts.cloudflare.net/git/public-v0/ply-web.git
Ref
refs/heads/main
Commit
526b305930b8ef382f2d7a1f9c0238730a585921
cf-ray
a5e30c617ee6ee28
Request
1d0762e8…
Protocol
v2 · sha1
Agent
gitty/1.0
Filter
advertised
Fetch
shallow filter sideband-all
Capabilities
agent ls-refs fetch object-format