Repository navigation
Expand file tree
/
Copy pathindex.css
More file actions
2228 lines (2123 loc) · 118 KB
/
Copy pathindex.css
File metadata and controls
2228 lines (2123 loc) · 118 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
@import "tailwindcss";
@import "tw-animate-css";
/* Math (Settings → Look and feel; lib/math/). Each engine's own stylesheet ships in its lazy chunk,
never here, so a device on Off downloads none of it. These two rules are the engine-neutral box.
Each formula pans within the reading column, including a long inline formula. */
.math-inline {
display: inline-block;
max-width: 100%;
overflow-x: auto;
vertical-align: middle;
white-space: nowrap;
}
.math-display {
display: block;
max-width: 100%;
overflow-x: auto;
}
/* Codex paints submitted user messages onto a near-white terminal-width row. The mirror's light
theme inversion turns that fill nearly black; on a narrow phone it reads as a heavy black bar
rather than message emphasis. The codex adapter marks only that exact ANSI fill. Desktop keeps
the native TUI background, while phone width makes it transparent without touching diff colours.
The marked segment carries its fill in --terminal-seg-bg instead of an inline background-color,
so these two rules can win by ordinary cascade order. An inline background-color would need
`!important` to override, which nothing else in this stylesheet does. */
.terminal-mobile-transparent-bg {
background-color: var(--terminal-seg-bg);
}
@media (max-width: 640px) {
.terminal-mobile-transparent-bg {
background-color: transparent;
}
}
/* Native-mirror bright foregrounds (Muse, .adr/0047). A marked span keeps its emitted colour as
the var() fallback and reads --terminal-light-dark-fg only when the app is light: pinned
light, or System following an OS in light. Dark (pinned or System) defines nothing, so the
emitted colour stands untouched. The value is --foreground's light half, written literally to
match the mirror's one-spelling convention (#0a0a0a is oklch(0.145); use-theme.ts re-measures
if it moves). Scoped to pre.terminal-muse so no other surface can inherit the override. */
:root.light pre.terminal-muse .terminal-light-dark-fg {
--terminal-light-dark-fg: #0a0a0a;
}
@media (prefers-color-scheme: light) {
:root:not(.dark) pre.terminal-muse .terminal-light-dark-fg {
--terminal-light-dark-fg: #0a0a0a;
}
}
/* Native-mirror muted chrome (Muse, .adr/0047). Same mechanism as above: muted spans keep the
dark-space grey as their var() fallback and read --terminal-muted-fg only in a light native
mirror. The value is --muted-foreground's light half, written literally (#5d5d5d is oklch(0.48);
use-theme.ts re-measures if it moves) — ~6:1 on the page ground, the parity of what inversion
gives the same spans elsewhere. */
:root.light pre.terminal-muse .terminal-muted {
--terminal-muted-fg: #5d5d5d;
}
@media (prefers-color-scheme: light) {
:root:not(.dark) pre.terminal-muse .terminal-muted {
--terminal-muted-fg: #5d5d5d;
}
}
/* One cell of the mirror, painted rather than typed — lib/cell-glyphs.ts has the whole argument,
and its CELL_FILL table names every `data-cell` value below.
A BLOCK ELEMENT IS PAINTED ON A BAND THAT IS THE ROW. An inline box's own background covers the
font's content area, its ascent plus descent, and that is not the row: at 10px it measured 13px
against a 12.5px row in Chromium on Linux, and sat 0.75px above the row's centre. So the paint is
not the span's background. It is a `::before` box, absolutely positioned with `top` left `auto`,
and an absolutely positioned box that started out inline takes its STATIC POSITION: the top of
the line box it sits in. `height: 1lh` is the row pitch, and `left: 0; right: 0` is the span's
own advance, so the band is exactly one cell: the row's top and bottom in Chromium and WebKit,
with no offset of its own (web/e2e/cell-glyphs.spec.ts reads it off the pixels). Every shape is
then a background layer in percentages of that band.
HALF A PIXEL OVER, at the top only. Two bands that meet exactly are rounded to device pixels one
box at a time, and at device pixel ratio 3 WebKit rounded two stacked rows one pixel APART, a
dark line through a stacked bar. The extra 0.5px reaches up under the row above, which paints
first, and closes that at ratio 2 and up. It goes up and not down because the last row's band
would otherwise poke out of the <pre> and give it half a pixel to scroll. It moves a half
block's edge by 0.25px.
IT MOVES NOTHING. An absolutely positioned box takes no room, and the span sets no width, no
display and no padding, so every row and every column lands where it did. `inline-block` sized
to one cell measured 0.27px short at each end in WebKit and was dropped. The span is a stacking
context so the band can sit under its own text: a selection still shows over a painted cell.
ONE SPAN PER CHARACTER, on purpose. A span that holds a run is split across two lines when the
mirror wraps inside it, and an absolutely positioned child has one box, so the run's second line
would lose its paint and, with the ink emptied, show nothing at all.
THE CHARACTER IS STILL IN HERE, as a text node — find offsets, link offsets, selection and copy
all read it, and none of them may change. `-webkit-text-fill-color` is what stops it being seen:
it empties the INK and leaves `color` alone, so `currentColor` in the paint still resolves to the
segment's own foreground, and .adr/0002's inversion filter treats the paint exactly like text.
`color: transparent` would take the paint with it.
A browser without `lh` (Safari before 16.4) skips all of this and keeps the font's own glyph,
short but visible.
The Powerline four are the exception, and their rule below says why. */
@supports (height: 1lh) {
.cell-glyph {
--ink: linear-gradient(currentColor, currentColor);
-webkit-text-fill-color: transparent;
}
.cell-glyph:not([data-cell^="wedge-"], [data-cell^="round-"]) {
position: relative;
z-index: 0;
}
.cell-glyph:not([data-cell^="wedge-"], [data-cell^="round-"])::before {
content: "";
position: absolute;
left: 0;
right: 0;
height: calc(1lh + 0.5px);
margin-top: -0.5px;
z-index: -1;
pointer-events: none;
background-repeat: no-repeat;
}
/* `<position> / <size>` of each rectangle, in percentages of the band. Every rectangle a block
element draws is flush to an edge, so each position is 0% or 100%. */
.cell-glyph[data-cell="full"]::before { background-image: var(--ink); }
.cell-glyph[data-cell="lower-1"]::before { background: var(--ink) 0 100% / 100% 12.5% no-repeat; }
.cell-glyph[data-cell="lower-2"]::before { background: var(--ink) 0 100% / 100% 25% no-repeat; }
.cell-glyph[data-cell="lower-3"]::before { background: var(--ink) 0 100% / 100% 37.5% no-repeat; }
.cell-glyph[data-cell="lower-4"]::before { background: var(--ink) 0 100% / 100% 50% no-repeat; }
.cell-glyph[data-cell="lower-5"]::before { background: var(--ink) 0 100% / 100% 62.5% no-repeat; }
.cell-glyph[data-cell="lower-6"]::before { background: var(--ink) 0 100% / 100% 75% no-repeat; }
.cell-glyph[data-cell="lower-7"]::before { background: var(--ink) 0 100% / 100% 87.5% no-repeat; }
.cell-glyph[data-cell="upper-1"]::before { background: var(--ink) 0 0 / 100% 12.5% no-repeat; }
.cell-glyph[data-cell="upper-4"]::before { background: var(--ink) 0 0 / 100% 50% no-repeat; }
.cell-glyph[data-cell="left-1"]::before { background: var(--ink) 0 0 / 12.5% 100% no-repeat; }
.cell-glyph[data-cell="left-2"]::before { background: var(--ink) 0 0 / 25% 100% no-repeat; }
.cell-glyph[data-cell="left-3"]::before { background: var(--ink) 0 0 / 37.5% 100% no-repeat; }
.cell-glyph[data-cell="left-4"]::before { background: var(--ink) 0 0 / 50% 100% no-repeat; }
.cell-glyph[data-cell="left-5"]::before { background: var(--ink) 0 0 / 62.5% 100% no-repeat; }
.cell-glyph[data-cell="left-6"]::before { background: var(--ink) 0 0 / 75% 100% no-repeat; }
.cell-glyph[data-cell="left-7"]::before { background: var(--ink) 0 0 / 87.5% 100% no-repeat; }
.cell-glyph[data-cell="right-1"]::before { background: var(--ink) 100% 0 / 12.5% 100% no-repeat; }
.cell-glyph[data-cell="right-4"]::before { background: var(--ink) 100% 0 / 50% 100% no-repeat; }
/* Quadrants: each quarter is half the band each way, in its own corner. */
.cell-glyph[data-cell^="quad-"] {
--ul: var(--ink) 0 0 / 50% 50% no-repeat;
--ur: var(--ink) 100% 0 / 50% 50% no-repeat;
--ll: var(--ink) 0 100% / 50% 50% no-repeat;
--lr: var(--ink) 100% 100% / 50% 50% no-repeat;
}
.cell-glyph[data-cell="quad-ll"]::before { background: var(--ll); }
.cell-glyph[data-cell="quad-lr"]::before { background: var(--lr); }
.cell-glyph[data-cell="quad-ul"]::before { background: var(--ul); }
.cell-glyph[data-cell="quad-ur"]::before { background: var(--ur); }
.cell-glyph[data-cell="quad-ul-ll-lr"]::before { background: var(--ul), var(--ll), var(--lr); }
.cell-glyph[data-cell="quad-ul-lr"]::before { background: var(--ul), var(--lr); }
.cell-glyph[data-cell="quad-ul-ur-ll"]::before { background: var(--ul), var(--ur), var(--ll); }
.cell-glyph[data-cell="quad-ul-ur-lr"]::before { background: var(--ul), var(--ur), var(--lr); }
.cell-glyph[data-cell="quad-ur-ll"]::before { background: var(--ur), var(--ll); }
.cell-glyph[data-cell="quad-ur-ll-lr"]::before { background: var(--ur), var(--ll), var(--lr); }
/* Powerline: NOT the row, on purpose. These four exist to join a segment background beside them,
a prompt pill's middle, and a segment background covers the content area, not the row. So they
paint the span's own background, the content area, and meet the pill on the same two pixels in
any face. Painted to the row they would step out of the pill wherever the two differ. A wedge
is two half layers whose 50% stop lies on the layer's own diagonal, which IS the wedge's edge;
49.8% leaves the stop a sliver to antialias in. A cap is a full cell rounded all the way out
on one side, the half-ellipse the font draws. */
.cell-glyph[data-cell="wedge-right"] {
background:
linear-gradient(to top right, currentColor 49.8%, transparent 50%) 0 0 / 100% 50% no-repeat,
linear-gradient(to bottom right, currentColor 49.8%, transparent 50%) 0 100% / 100% 50% no-repeat;
}
.cell-glyph[data-cell="wedge-left"] {
background:
linear-gradient(to top left, currentColor 49.8%, transparent 50%) 0 0 / 100% 50% no-repeat,
linear-gradient(to bottom left, currentColor 49.8%, transparent 50%) 0 100% / 100% 50% no-repeat;
}
.cell-glyph[data-cell="round-right"] {
background: var(--ink);
border-radius: 0 100% 100% 0 / 0 50% 50% 0;
}
.cell-glyph[data-cell="round-left"] {
background: var(--ink);
border-radius: 100% 0 0 100% / 50% 0 0 50%;
}
}
/* `dark:` must fire for BOTH an explicitly-pinned dark root and a system-dark root the user hasn't
pinned to light — otherwise the handful of literal `dark:` utilities silently stop working for
everyone on System (the default). Token-driven colors don't need this; these are the literals. */
@custom-variant dark {
&:is(.dark *) {
@slot;
}
@media (prefers-color-scheme: dark) {
&:is(:root:not(.light) *) {
@slot;
}
}
}
/* ── Theme tokens ───────────────────────────────────────────────────────────────────────────────
Every themed value is a single `light-dark(<light>, <dark>)` declaration, resolved by the
element's computed `color-scheme`. That is why there is ONE token block here and not two: the
media-query-plus-override shape would have to restate the whole dark palette, and nothing in CSS
can share a declaration block across an `@media` boundary.
`color-scheme` therefore does real work and is not decoration — it also makes the browser paint
native UI (scrollbars, form controls, the caret, the iOS keyboard, <select> menus) to match.
:root → `light dark`, i.e. follow the OS. The default; no class on <html>.
:root.light → pinned light, set by useTheme / theme-init.js
:root.dark → pinned dark, ditto
Pinning is done with a class rather than a `color-scheme` media query so first paint can be fixed
by public/theme-init.js before the bundle loads. */
:root {
color-scheme: light dark;
/* 2px, not the stock 0.65rem, and it does not ramp. The radius descends from the mark: the mark
holds a disc and a traced line, and it holds no stadium and no soft-cornered box anywhere. A
corner is either a full circle (width == height — a dot, an avatar, the switch thumb) or it is
effectively square. 2px is the smallest radius that still reads as intentional rather than as a
rasterizer artefact, so it is the floor the whole surface sits on. The four derived steps below
are hard-set to the same 2px: the stock shadcn calc() ramp subtracts up to 4px, which at this
base computes negative and is invalid. */
--radius: 2px;
/* THE SHAPE A THEME MAY PICK (schema version 2, lib/theme/surface.ts). Tailwind copies a shadow
step's value and the bare border width into every utility at build time, so `@theme inline`
below points them here, and a theme's `shadow` and `border` words set these properties. The
values are Tailwind 4.3.1's own (theme.css), so the default look is the one the app always had.
The radius steps, the spacing step and the two weights need no such door: utilities read them
through var() already. src/themes/themes.test.ts holds every default word equal to these. */
--surface-shadow: 0 0 #0000;
--surface-shadow-xs: 0 0 #0000;
--surface-shadow-sm: 0 0 #0000;
--surface-shadow-md: 0 0 #0000;
--surface-shadow-lg: 0 0 #0000;
--surface-shadow-xl: 0 0 #0000;
--surface-shadow-2xl: 0 0 #0000;
--surface-border-width: 1px;
--font-weight-medium: 600;
--font-weight-semibold: 700;
/* The offsets of the inset shadow that marks a selected or blocked row, used as
`shadow-[var(--edge-accent)_<colour>]`. The radius word sets it: under square corners the mark is
a 2px bar on the left edge, under soft or round corners a 2px ring on all four sides, because a
left accent bar is never combined with rounded corners. This is the sharp value. A marked row's
second shadow layer is --edge-shadow: none under sharp, a soft shadow with the ring. */
--edge-accent: inset 2px 0 0 0;
--edge-shadow: 0 0 #0000;
/* THE SEVEN MORE A THEME MAY PICK (M57 spec 17, lib/theme/surface.ts). Each is the value the app
draws by default, so the Collie theme sets none of them and looks the same:
ground `--ground-image` and `--ground-size`, painted on `html` over the page colour (the
html rule below), and the six a pattern reads: `--ground-ink`, `--ground-scale` and
the four paints `--ground-line`, `--ground-dot`, `--ground-area`, `--ground-tint`;
chrome `--band-ground` and `--band-rule`, the fill and edge of the header, the tab bar and the
bottom bar (`bg-band-ground`, `border-band-rule`), today the page colour and --rule;
rows the rows of a list group (the `[data-slot="list-group"]` rule below): `--row-gap`
between rows, `--row-rule` the width of the group's frame, and each row's own
`--row-edge` border, `--row-corner` radius, `--row-shadow` and `--row-fill`, and
`--row-inset`, the air around the rows of a list that sits flush in a card or a sheet;
icons `--icon-stroke`, the stroke of every lucide icon, lucide's own 2;
labels `--label-transform` and `--label-tracking`, read by the `label-caps` utility, today's
`uppercase` and Tailwind's `tracking-wide` (0.025em);
display `--font-display`, the face of `h1`, `h2` and the header's brand line, the UI face
unless a theme names one of the stacks below.
The mirror's own ink and ground are NOT declared here: lib/ansi.ts and components/mirror-space.ts
read `var(--mirror-ink, #fafafa)` and `var(--mirror-ground, #0a0a0a)`, so only a theme's `ansi`
block sets them. src/themes/themes.test.ts holds every default word equal to these. */
--ground-image: repeating-linear-gradient(45deg, var(--ground-line) 0 1px, transparent 1px calc(4px * var(--ground-scale))), repeating-linear-gradient(-45deg, var(--ground-line) 0 1px, transparent 1px calc(4px * var(--ground-scale)));
--ground-size: auto;
--ground-ink: var(--foreground);
--ground-scale: 1;
--ground-line: color-mix(in oklab, var(--background) 96%, var(--ground-ink));
--ground-dot: color-mix(in oklab, var(--background) 93%, var(--ground-ink));
--ground-area: color-mix(in oklab, var(--background) 97%, var(--ground-ink));
--ground-tint: color-mix(in oklab, var(--background) 88%, var(--ground-ink));
--band-ground: var(--secondary);
--band-rule: var(--border);
--row-gap: 0px;
--row-rule: var(--surface-border-width);
--row-edge: 0px;
--row-corner: 0px;
--row-shadow: none;
--row-inset: 0px;
--row-fill: transparent;
--icon-stroke: 2;
--label-transform: none;
--label-tracking: normal;
--font-display: var(--face-aldrich);
/* The seven shipped faces as stacks a theme's display face can name (`--font-display:
var(--face-<id>)`). The same stacks as the `:root.font-*` blocks and the @theme default below,
held equal by src/fonts.test.ts. A stack names a family; the browser fetches its file only when a
drawn element asks for it, so a stack nobody uses costs no byte. */
--face-system:
ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto,
"Helvetica Neue", Arial, "Noto Sans", sans-serif;
--face-grotesk:
"Space Grotesk", "Space Grotesk Fallback", ui-sans-serif, system-ui,
-apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
--face-aldrich:
"Aldrich", "Aldrich Fallback", ui-sans-serif, system-ui, -apple-system,
"Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
--face-plex:
"IBM Plex Sans", "IBM Plex Sans Fallback", ui-sans-serif, system-ui,
-apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
--face-geist:
"Geist", "Geist Fallback", ui-sans-serif, system-ui,
-apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
--face-atkinson:
"Atkinson Hyperlegible Next", "Atkinson Hyperlegible Next Fallback", ui-sans-serif,
system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
--face-nunito:
"Nunito", "Nunito Fallback", ui-sans-serif, system-ui,
-apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
/* Light deviates from stock shadcn in two places, both measured rather than taste:
--background is a step off white (stock has background == card == popover == pure white, so the
entire dashboard hierarchy rests on one 1.26:1 hairline), and --muted-foreground is darkened
for headroom (see below). oklch(0.97) rasterizes to rgb(245,245,245), which is exactly the
terminal mirror's inverted background — so the mirror stops showing a seam against the page. */
--background: light-dark(oklch(0.955 0.003 80), oklch(0.17 0.003 80));
--foreground: light-dark(oklch(0.14 0 0), oklch(0.985 0 0));
--card: light-dark(oklch(1 0 0), oklch(0.235 0.003 80));
--card-foreground: light-dark(oklch(0.14 0 0), oklch(0.985 0 0));
/* THE GROUND UNDER THE THUMB — the composer's chrome block, and nothing else. Chrome is normally
the page colour separated by a rule (see --muted below), and that rule holds everywhere the
chrome sits on the PAGE. It cannot hold here: this block sits on the terminal mirror, and in
dark --background IS the mirror's fill (components/mirror-space.ts), so page-coloured chrome
against it is invisible and the grab handle inside it stops reading as a control at all.
It needs a fill, and the fill it had was --muted: rgb(38) in dark, a bright slab under a
rgb(10) terminal, which the operator read as too light. This is the same value as --card in
dark — one raised-chrome surface app-wide, shared with the sheets — and the same value --muted
already had in light, where --card is pure white and would land 1.04:1 against the inverted
mirror. One name, because it answers one question: what does chrome stand on when it cannot
stand on the page. */
--chrome: light-dark(oklch(0.915 0.004 80), oklch(0.28 0.003 80));
/* Pinned to --card, not a value of its own. `bg-popover` / `text-popover-foreground` appear ZERO
times in src/ — Collie's floating layer is the BottomSheet (ui/sheet.tsx), which is
`bg-background` over a `bg-black/50` scrim. The pair is kept rather than deleted only so a
future `npx shadcn add` of a Popover/Tooltip primitive lands on a Collie surface instead of
stock white; it is an alias, and there is no third paper behind it. */
--popover: var(--card);
--popover-foreground: var(--card-foreground);
--primary: light-dark(oklch(0.2 0 0), oklch(0.96 0 0));
--primary-foreground: light-dark(oklch(0.985 0 0), oklch(0.17 0.003 80));
/* The "this control is ON" tint — a very light sky. Its own token pair rather than reusing
--secondary because the two say different things: secondary is a quieter surface, this is a
STATE, and the row needs the difference legible at a glance (an open dock, an armed mode). Kept
low-chroma so a row of grey controls doesn't turn into a traffic light when two are on.
The light half is tuned by CHROMA, not luminance: at "very light sky" lightness the tint is only
~1.2:1 against the page by WCAG, and no value that still reads as light sky does better — what
makes it visible is that it is the one saturated thing in a neutral row. Don't "fix" that number
by darkening it into a mid blue. Text on the tint is what has to clear a contrast bar, and does:
7.3:1 light, 9.2:1 dark. */
--control-on: light-dark(oklch(0.88 0.06 235), oklch(0.34 0.06 240));
--control-on-foreground: light-dark(oklch(0.32 0.12 245), oklch(0.92 0.06 235));
/* The frame of the pane you are working in on a large screen (ADR 0120, ADR 0174): a 1px hairline in the
"on" ink mixed into the page in OKLab, 70% in light and 60% in dark, so a quiet blue line and not a grey
ring beside the focus ring. A DERIVED token (schema.ts DERIVED_THEME_TOKENS): the file for `collie` holds no
value, and `deriveTokens` (lib/theme/derive.ts) holds every other theme's at 3:1 on the recess, the page and
the paper; a theme that sets its own `pane-active` has it mixed the same way, in place of the "on" ink. */
--pane-active: light-dark(color-mix(in oklab, var(--control-on-foreground) 70%, var(--background)), color-mix(in oklab, var(--control-on-foreground) 60%, var(--background)));
/* The open folder tab's top edge and the open pane's ring (theme surface word `tabs: folder`,
lib/tab-look.ts). Drawn only under that word. The default is the foreground ink of each half
(the same two values as --foreground above), so a theme that sets the word and not the colour
draws its folder edge in ink. A pair and not var(--foreground): the theme file for `collie` holds
every optional token but the derived ones, and a theme that sets one half is filled from it. */
--tab-active: light-dark(oklch(0.14 0 0), oklch(0.985 0 0));
/* The ground of a found or matched piece of text: Find in Chat, and the letters a list filter matches
(ui/match-text.tsx). A ground with alpha, laid over whatever the text sits on, so the ink on top
keeps its own colour (`text-inherit`) and a mark stays readable on a current or a blocked row.
The default is the amber the app drew as a literal before it had this token: Tailwind 4.3.1's
amber-300 at 70% in the light half (oklch(87.9% 0.169 91.605 / 0.7)) and amber-500 at 40% in the
dark half (oklch(76.9% 0.188 70.08 / 0.4)), written here as the same oklch with alpha, so the pixel
is the one it replaced. A pair, like --tab-active: the theme file for `collie` holds every optional
token, and a theme that sets one half is filled from it. */
--find: light-dark(oklch(0.879 0.169 91.605 / 0.7), oklch(0.769 0.188 70.08 / 0.4));
--secondary: light-dark(oklch(0.915 0.004 80), oklch(0.28 0.003 80));
--secondary-foreground: light-dark(oklch(0.16 0 0), oklch(0.985 0 0));
/* The INERT fill — a well, a disabled track, a quiet chip on a card. Value unchanged (rgb 235
light / 38 dark), but its old job is gone: it used to be the chrome band behind the header,
"a step BELOW --background so the band still reads as a distinct surface". The band existed
because the line it competed with was not a line — `border-border/60` composites to 1.09:1
against the page in light and 1.16:1 in dark, i.e. a rumour. --rule below is that line drawn
properly, and chrome is now the page colour (app-header.tsx, settings.tsx, pack.tsx).
Do NOT put --muted back behind chrome: on the pane screen it re-opens the seam --background's
0.97 was chosen to close, and it is the worst ground a status chip has ever landed on. */
--muted: light-dark(oklch(0.915 0.004 80), oklch(0.28 0.003 80));
/* Light was oklch(0.556) — 4.74:1 on white, i.e. zero headroom, so every /70, /80 and opacity-60
derivative in the app fell under 3:1 while its dark counterpart passed. Darkened to buy that
headroom back; the alpha modifiers on small text were dropped as well, since no token value
rescues a /70. */
--muted-foreground: light-dark(oklch(0.40 0.004 80), oklch(0.80 0.004 80));
/* Light --accent must be a real step off --background, not stock shadcn's 0.97. Stock is right
only while background is pure white; 0.18.0 deliberately moved background to 0.97 (see above),
which silently made accent === background — so every "this is the current one" highlight
(`bg-accent` in the pane switcher and session switcher) and every `hover:bg-accent` rendered
as nothing at all in light mode. It sits a step BELOW --muted (0.94), not between it and
--background: the switcher needs three separable values — resting 0.97, hover (bg-muted/60)
~0.94, active 0.92 — and 0.94 would have collided the last two. */
--accent: light-dark(oklch(0.885 0.004 80), oklch(0.32 0.003 80));
--accent-foreground: light-dark(oklch(0.16 0 0), oklch(0.985 0 0));
--destructive: light-dark(oklch(0.5 0.21 27), oklch(0.72 0.19 22));
--destructive-foreground: light-dark(oklch(0.985 0 0), oklch(0.17 0.003 80));
--border: light-dark(oklch(0.82 0.004 80), oklch(0.42 0.003 80));
--input: light-dark(oklch(0.64 0.004 80), oklch(0.58 0.003 80));
/* The STRUCTURAL line, and deliberately stronger than --border. --border draws one component's
edge; --rule draws the cut between two regions of chrome — the header's bottom edge, a strip
separator, the composer's top edge — where the whole job is to separate chrome from page
without a fill.
Measured against --background, which is the only ground chrome sits on:
border-border/60 1.09:1 light · 1.16:1 dark ← what the header used, invisible
border-border 1.16:1 light · 1.26:1 dark
--rule 1.34:1 light · 2.06:1 dark
rgb(214) on rgb(245) light; white 24% over rgb(10) = rgb(69) dark. At 3x DPR on a phone that
is a crisp 1px cut, which is the mark's own vocabulary — a cut, not a wash. */
--rule: light-dark(oklch(0.72 0.004 80), oklch(0.52 0.003 80));
/* THE FIRM EDGE (DESIGN.md §4, "Three line tokens"): the cut a person must SEE between the large screen's
tab bar and the work, and under a pane's header. --rule is a region's cut at 1.3:1 to 2:1, which is right
for a list and too faint for the line the selected tab stands on: on a theme whose page is black or
near-white the recess clamps to the page and --rule was the only thing left, at 1.0 to 1.3:1. This one is
the theme's own ink mixed into its own page, so it holds 3:1 or more against the recess, the page and the
paper in both halves of every bundled theme (e2e/strip-head.spec.ts measures the painted pixels).
DERIVED ONLY, never a theme token: a theme reaches it through `foreground` and `background`. For a theme
that is applied, lib/theme/derive.ts makes it from the same mix with a 3:1 floor (EDGE_SHARE there is this
58%); derive.test.ts holds this line and that share together. No component may restate the mix. */
--edge-firm: color-mix(in oklch, var(--foreground) 58%, var(--background));
/* THE WIDE LAYOUT'S THREE PLANES (DESIGN.md §4, "The large screen's three planes"). On a large screen
the navigation (the sidebar, the tab strip of the space, the strip's own ground) stands on the RECESS,
a column without focus on the page (--background), and the focused column, whole, on the PAPER: the
lightest surface on the screen in both halves, so the eye lands on the work. Both are DERIVED from the
theme's own tokens, so every theme gets the three planes without naming them; a theme may set either
one (optional, schema version 3) and need not.
recess: the page's own lightness minus 0.05. A page that is already black clamps at the page; then
the paper and the focus frame carry the order alone.
paper: in light, the card 0.05 lighter, at most white (the card is white already). In dark,
halfway between the page and the card 0.05 lighter (L 0.23 on a 0.17 page on Collie): the
full step (0.29) read as too bright a sheet on a desktop (2026-11-21), and the focus frame,
not the lift, is what marks the focus.
Relative colour, not color-mix: no token is darker than the page in dark, so no mix can reach the
recess. */
--surface-recess: oklch(from var(--background) calc(l - 0.05) c h);
--surface-paper: light-dark(oklch(from var(--card) min(1, calc(l + 0.05)) c h), color-mix(in oklch, var(--background), oklch(from var(--card) calc(l + 0.05) c h)));
/* Light is darkened off stock shadcn (0.708 → 0.62): at 0.708 the focus ring measures 2.58:1 on
white, under the 3:1 WCAG 1.4.11 floor for a non-text indicator — and components draw it at
`ring-ring/50`, which halves that again. On an app whose buttons type into a live shell, a focus
ring you can't locate is a real problem. Still worth an on-device look: even at 0.62 the /50
variant is marginal. */
--ring: light-dark(oklch(0.5 0 0), oklch(0.76 0 0));
/* THE STATE FILLS, per plane (DESIGN.md §14, ADR 0172). A hover, a selected item and an open trigger read
`--state-hover`, `--state-on` and `--state-open`; each plane class points the three at its own triple
(`RECESS_ACCENT`, `PAPER_PLANE`, `PAGE_PLANE`), and here they hold the page's. These are Collie's relations,
the colours Altan approved on 2026-11-21: the accent on the page and the paper, the paper on the recess, the
on-colour for an open trigger. A theme that is applied gets the same relations with a floor under each
(lib/theme/derive.ts, set inline by applyTheme); derive.test.ts holds the two together within 0.005. */
--state-hover-page: var(--accent);
--state-hover-recess: var(--surface-paper);
--state-hover-paper: var(--accent);
--state-on-page: var(--accent);
--state-on-recess: var(--surface-paper);
--state-on-paper: var(--accent);
--state-open-page: var(--control-on);
--state-open-recess: var(--control-on);
--state-open-paper: var(--control-on);
--state-hover: var(--state-hover-page);
--state-on: var(--state-on-page);
--state-open: var(--state-open-page);
/* Agent lifecycle status palette — the app's primary at-a-glance signal, so both halves are
tuned against their own ground rather than one set being reused. The dark values glow on
near-black; the light values are picked to clear 4.5:1 on white (measured, not estimated —
blocked 5.4:1, working 4.8:1, done 4.6:1, idle 5.5:1, unknown 6.5:1).
These carry text AND fills (`text-status-working`, `bg-status-blocked` dots). Tuning for text
makes the dots darker; if that costs the dashboard its glance-ability outdoors, the fallback is
splitting fill and text into separate tokens.
Measure the CHIP, never the dot: the chip is `bg-status-X/15` under `text-status-X`, so the
translucent wash lifts the ground toward the ink and the ratio is always worse than the solid
text. /15 is the strict case and the one the table below uses; status-badge.tsx draws its chip
at /10, which is ~0.4 kinder everywhere, so anything that passes here passes there too. Tuned against plain white these read 5.4/4.8/4.6 and failed on the chip; tuned against
the chip on a white card they read 4.90/4.58/4.46 and still failed, because the ground varies.
The historic worst ground was the header band, `bg-muted` rgb(235) — that band is GONE (see
--muted). Chips now land on --background or --card and on nothing else. The table below is
RASTERISED, not arithmetic: each cell was rendered by the browser at DPR 1 and the pixel read
back, so the oklab `color-mix` Tailwind emits for `/15` is measured rather than modelled. Plain
sRGB alpha arithmetic agrees to within 0.08 and always in the pessimistic direction.
ground blocked working done idle unknown info
--card 255 5.71 5.75 5.39 5.96 6.40 5.19 (light)
--background 245 5.23 5.28 4.95 5.47 5.88 4.77 (light, the only chrome ground)
--muted 235 4.83 4.89 4.58 5.06 5.44 *4.41 (light, the old header band)
--accent 228 4.55 4.60 *4.31 4.77 5.12 *4.16 (light, NOT A PERMITTED GROUND)
--background 10 5.59 8.67 7.37 6.79 5.75 8.41 (dark)
--card 23 4.90 7.47 6.39 5.89 5.01 7.28 (dark)
--muted 38 *4.13 6.16 5.29 4.87 *4.16 6.02 (dark, the old header band)
--accent 38 *4.13 6.16 5.29 4.87 *4.16 6.02 (dark, NOT A PERMITTED GROUND)
Every cell on --background and --card clears 4.5. The starred cells are why the two fills are
not permitted grounds, and they are recorded so nobody re-derives them the expensive way.
Both of the failures this table used to record are now CLOSED, and the fixes were of two
different kinds — keep the distinction, because it is the rule for the next one:
· dark `unknown` was 4.35 on --background and 3.82 on --card. No ground could reach it, so
the TOKEN moved. See --status-idle / --status-unknown below.
· the switcher active row was `bg-accent` (rgb 228 light / 38 dark) and it CONTAINS status
count pills: blocked 4.55 / working 4.60 light — hairline — and blocked 4.13 dark, an
outright fail. The GROUND moved: the fill is gone and the row is marked by a 2px inset rail
in --primary (session-switcher.tsx, server-switcher.tsx), so the pills land on the sheet's
--background at 5.23 / 5.28 light and 5.59 / 8.67 dark.
A chip belongs on --background or --card and on nothing else. */
--status-blocked: light-dark(oklch(0.43 0.2 25), oklch(0.8 0.15 24));
--status-working: light-dark(oklch(0.43 0.12 72), oklch(0.84 0.15 82));
--status-done: light-dark(oklch(0.41 0.14 152), oklch(0.77 0.16 152));
/* The two quiet ends of the palette, and the only pair in it tuned as a PAIR. Light halves are
untouched (chip on --background: idle 5.47, unknown 5.88).
Both dark halves were raised, and both had to move together. Dark `unknown` was oklch(0.6 0.02)
= rgb(119,129,140): its chip measured 4.35 on --background and 3.82 on --card, so it failed the
4.5 floor on every ground it is allowed to sit on and no ground change could reach it. Clearing
--card (the binding ground, since the wash lifts less over a lighter paper) needs L >= 0.645 for
a bare pass; 0.68 was taken instead so the pass has ~0.46 of headroom rather than a hairline.
Raising `unknown` to 0.68 would have put it ABOVE `idle` at 0.65 and inverted the pair, so
`idle` went up to 0.73 and the 0.05 L gap between them is preserved exactly.
The chroma went 0.02 -> 0.03 in the dark halves only, and that is the load-bearing part: at
L 0.68/0.73 these values sit on either side of --muted-foreground (0.708, rgb 161,161,161), so
lightness can no longer separate them from ordinary quiet text and the tint has to. Measured as
rgb distance, the three pairs now sit in one band — idle/unknown 26.6 (was 26.0),
idle/muted-fg 27.5 (was 32.5), unknown/muted-fg 25.2 — i.e. no pair is closer than the
idle/unknown pair this file already treats as far enough apart. 0.03 is still the lowest chroma
in the app; --control-on is 0.05 and every other status hue is 0.15 or more, so neither of these
reads as a signal blue.
Dark chips, --background / --card: idle 6.79 / 5.89 unknown 5.75 / 5.01. New rgb values are
idle 154,170,186 and unknown 139,154,171. */
--status-idle: light-dark(oklch(0.42 0.02 250), oklch(0.78 0.03 250));
--status-unknown: light-dark(oklch(0.38 0.02 250), oklch(0.75 0.03 250));
/* Calm-info sky blue — same shape as the lifecycle palette above (dark brighter to glow on
near-black). It is the palette's tightest light value: on the old rgb(235) header band its chip
measured 4.41 — under the floor the block above claims. Chrome is the page now, so the one
surface that uses it (alpha-bar.tsx, inside the header) reads 4.77. It has ~0.27 of headroom
and no more; do not lighten it, and do not put it back on a fill. Same shape as the lifecycle
values but a distinct hue (230, cool sky) so it never gets confused with `status-working`'s
amber "needs attention" signal. Used by
surfaces that are informational, not a status: currently just the prerelease strip
(alpha-bar.tsx). */
--status-info: light-dark(oklch(0.42 0.14 230), oklch(0.82 0.15 230));
/* Syntax colour for the Changes view's diff (components/changes-view.tsx, lib/diff-highlight.ts,
ADR 0065 rule 7). Six inks, all colour and nothing else: no weight, no italic, so a coloured
line keeps the plain line's glyphs and line boxes. Kinds without an ink (names, punctuation,
JSX text) keep --foreground.
Hues keep off the two row tints: no green (the added-row wash, done 152) and no red (the
deleted-row wash, blocked 25). Light halves sit at L 0.45-0.50 like the status palette, dark
halves at 0.76-0.80 like its glow. Comments are --muted-foreground's values, grey on purpose.
Contrast, computed in sRGB with the /12 row tint mixed over --background (plain alpha is the
pessimistic side of the oklab mix Tailwind emits), ground: page / card / added / deleted:
keyword light 6.17 6.73 5.15 4.92 dark 8.60 7.78 7.29 7.60
string light 6.82 7.43 5.69 5.44 dark 10.7 9.72 9.10 9.50
constant light 6.26 6.83 5.23 5.00 dark 10.3 9.33 8.74 9.12
property light 6.15 6.70 5.13 4.90 dark 11.0 9.94 9.31 9.71
entity light 6.55 7.15 5.47 5.23 dark 8.84 8.00 7.49 7.82
comment light 5.99 6.54 5.00 4.78 dark 7.63 6.91 6.47 6.75
Every cell clears 4.5. The tightest is light on the deleted row; darken there, never lighten. */
--syntax-keyword: light-dark(oklch(0.46 0.2 350), oklch(0.78 0.15 350));
--syntax-string: light-dark(oklch(0.43 0.13 250), oklch(0.82 0.1 240));
--syntax-constant: light-dark(oklch(0.44 0.13 55), oklch(0.82 0.12 60));
--syntax-property: light-dark(oklch(0.43 0.09 200), oklch(0.82 0.09 195));
--syntax-entity: light-dark(oklch(0.45 0.18 300), oklch(0.79 0.13 300));
--syntax-comment: light-dark(oklch(0.46 0.004 80), oklch(0.74 0.004 80));
/* ── Per-host identity palette (components/host-chip.tsx, lib/hosts.ts) ──────────────────────
Ten hues, `--host-0` … `--host-9`, handed to machines by lib/hosts.ts `hostSlot`. They are an
IDENTITY, never a state: nothing about a host's health, version or reachability is encoded
here, and the machine's NAME is always rendered beside the tint (WCAG 1.4.1 — colour is the
second encoding, never the only one). On a solo collie no host wears one at all.
WHY THESE TEN HUES, AND NOT TAILWIND'S SHADE RAMP. Four bands of the wheel are already spoken
for by the status palette above and a host tint must never be read as a status: blocked 24-27,
working 72-82, done 149-152, info 230. What is left is ten hues at ~20-90 degrees of
separation — orange 41, lime 132, teal 185, cyan 221, sky 241, blue 262, indigo 280,
purple 302, fuchsia 325, pink 352 — and the SLOT ORDER below interleaves them, so the linear
probe in `hostSlot` hands neighbouring slots hues from opposite sides of the wheel.
Two hues sit near a status and are kept deliberately: cyan (9 off `info`) and sky (11 off it).
`--status-info` is drawn in two places, the prerelease strip in the header (alpha-bar.tsx)
and the cache chip's cold glyph (cache-chip.tsx), and never beside a host mark. Everything
nearer a status than that was dropped: rose and red (blocked), amber and yellow (working),
green and emerald (done).
The light halves are NOT Tailwind's `-600` shades. Tailwind's 600s read 2.4-4.7:1, i.e. most of
the ramp fails 4.5 outright, and its 700s and 800s fail too for the low-chroma hues. So the
light half is tuned the way the status palette is: L 0.46, the hue's maximum in-gamut chroma
capped at 0.20. The dark half IS Tailwind's `-400` L/C at the same hue — the ramp's dark end
glows correctly on near-black and needed no work.
The tint is applied to the GLYPH ONLY (ui/address-tag.tsx, host-chip.tsx) — the tag's border,
background and name stay the literal untinted `border-border bg-muted/60 text-muted-foreground`
always; only the leading icon inside it wears `text-host-N`. A wash across the whole pill read
as too much and was dropped. The table below is a RECORD of the wash's rasterised chip contrast
from when `bg-host-N/15` under `text-host-N` was still applied to the whole tag; it no longer
drives what ships, since `text-host-N` on a small glyph over `--muted/60` clears every one of
these grounds by a wider margin than the wash did:
slot 0 cyan 5.07/5.48 light 8.39/7.27 dark
slot 1 orange 5.46/5.90 6.47/5.63
slot 2 purple 5.71/6.16 5.89/5.13
slot 3 lime 5.03/5.44 9.74/8.38
slot 4 pink 5.47/5.96 6.01/5.25
slot 5 teal 4.96/5.37 8.43/7.22
slot 6 blue 5.40/5.86 6.09/5.30
slot 7 fuchsia 5.65/6.12 6.36/5.55
slot 8 sky 5.11/5.55 7.10/6.17
slot 9 indigo 5.58/6.08 5.34/4.67 ← the palette's tightest cell
Every cell clears 4.5 on both permitted grounds. `--muted` and `--accent` are not permitted
grounds here either, for the reason the status block states. */
--host-0: light-dark(oklch(0.45 0.085 221), oklch(0.789 0.154 221));
--host-1: light-dark(oklch(0.45 0.143 41), oklch(0.75 0.183 41));
--host-2: light-dark(oklch(0.45 0.2 302), oklch(0.74 0.2 302));
--host-3: light-dark(oklch(0.45 0.129 132), oklch(0.841 0.238 132));
--host-4: light-dark(oklch(0.45 0.192 352), oklch(0.718 0.202 352));
--host-5: light-dark(oklch(0.45 0.082 185), oklch(0.777 0.152 185));
--host-6: light-dark(oklch(0.45 0.2 262), oklch(0.707 0.165 262));
--host-7: light-dark(oklch(0.45 0.2 325), oklch(0.74 0.238 325));
--host-8: light-dark(oklch(0.45 0.108 241), oklch(0.746 0.16 241));
--host-9: light-dark(oklch(0.45 0.2 280), oklch(0.7 0.18 280));
/* ── Terminal palette ─────────────────────────────────────────────────────────────────────────
The 16 indexed ANSI slots, emitted by lib/ansi.ts as var(--ansi-N).
ONE set, not two, and it is the dark one — VS Code's Dark+ terminal palette. The mirror renders
in dark space under every theme and the light theme inverts it wholesale
(components/ansi-output.tsx, .adr/0002), so a light palette here would be applied and then
inverted into nonsense. These sit next to the truecolor an agent emits, which no palette can
re-theme, so they must share its assumptions: authored for a dark ground. */
--ansi-0: #000000;
--ansi-1: #ea8885;
--ansi-2: #4dbb75;
--ansi-3: #e5e510;
--ansi-4: #57a7c7;
--ansi-5: #be85c6;
--ansi-6: #4cbbbb;
--ansi-7: #e5e5e5;
--ansi-8: #9a9a9a;
--ansi-9: #ffa6a3;
--ansi-10: #45d07e;
--ansi-11: #f5f543;
--ansi-12: #709aeb;
--ansi-13: #cf83d6;
--ansi-14: #65d0dc;
--ansi-15: #ffffff;
--mirror-ink: #f2f1ef;
--mirror-ground: #100f0d;
}
/* Every shipped theme other than the default, one `:root[data-theme="<id>"]` block each, generated
from src/themes/*.json by scripts/build-themes.ts. It sits right after the token block so a theme
block wins by order as well as by specificity. The default theme `collie` writes no block: its
values are the tokens above, and src/themes/themes.test.ts holds the two equal. */
@import "./themes.css";
/* Stretchtext hues (components/markdown-text.tsx, lib/stretch.ts): a closed stretch's underline,
and the ink of the words an open stretch added and of its «. They are the cc-stretch plugin's own
palette (0.3.4, hooks/register.tsx), so a reply reads in the same colours in Collie as in the
terminal: Claude Code's theme hues warning, autoAccept, planMode and claude, mixed toward the
text colour for `--stretch-N`, and that mixed 35% toward the background for `--stretch-N-faded`,
rounded per channel as the plugin rounds them. The faded form is the open stretches other than
the one opened last. Dark mixes 45% toward white, as the plugin does. Light mixes only 15% toward
black: at the plugin's 45% the four hues sit so close to black body text that they barely read
as colour. The light values then go darker than the plugin's mix on purpose: an open stretch's
added words are prose, so every light value, faded or not, holds 4.5:1 on the background and
card of every shipped theme (themes/stretch-contrast.test.ts measures it).
A block of their own, outside the token block: that one is ADR 0106's closed list, and these
hues are the plugin's, fixed under every theme. */
:root {
--stretch-1: light-dark(#805c1a, #ffdd77);
--stretch-1-faded: light-dark(#78684a, #a6904d);
--stretch-2: light-dark(#7300d9, #d3bdff);
--stretch-2-faded: light-dark(#8a4bc1, #897ba6);
--stretch-3: light-dark(#005757, #9ac5c0);
--stretch-3-faded: light-dark(#457171, #64807d);
--stretch-4: light-dark(#91503b, #e9b4a3);
--stretch-4-faded: light-dark(#846257, #97756a);
}
/* Explicit pins. Class-based so theme-init.js can set them before first paint. */
:root.light {
color-scheme: light;
}
:root.dark {
color-scheme: dark;
}
@theme {
/* One radius, four names. In the Collie theme there is no ramp to walk: sm/md/lg/xl all resolve
to the same 2px, so `rounded-md` and `rounded-xl` are the same corner and no component can drift
rounder than its neighbour by picking a bigger step. Written out rather than left as calc(): at
--radius: 2px the stock `- 2px` and `- 4px` forms compute 0 and -2px, and a negative radius is
invalid. In `@theme` and not `@theme inline` (schema version 2): `rounded-md` then compiles to
`var(--radius-md)`, which a theme's `radius` word sets (lib/theme/surface.ts). */
--radius-sm: 2px;
--radius-md: 2px;
--radius-lg: 2px;
--radius-xl: 2px;
}
@theme inline {
/* The shadow steps the app uses and the bare border width, each pointed at its `--surface-*`
property in :root (see there), because Tailwind writes these values into the utility itself. */
--shadow: var(--surface-shadow);
--shadow-xs: var(--surface-shadow-xs);
--shadow-sm: var(--surface-shadow-sm);
--shadow-md: var(--surface-shadow-md);
--shadow-lg: var(--surface-shadow-lg);
--shadow-xl: var(--surface-shadow-xl);
--shadow-2xl: var(--surface-shadow-2xl);
--default-border-width: var(--surface-border-width);
--color-background: var(--background);
--color-foreground: var(--foreground);
--color-card: var(--card);
--color-card-foreground: var(--card-foreground);
--color-chrome: var(--chrome);
--color-popover: var(--popover);
--color-popover-foreground: var(--popover-foreground);
--color-primary: var(--primary);
--color-primary-foreground: var(--primary-foreground);
--color-control-on: var(--control-on);
--color-control-on-foreground: var(--control-on-foreground);
--color-pane-active: var(--pane-active);
--color-tab-active: var(--tab-active);
--color-find: var(--find);
--color-secondary: var(--secondary);
--color-secondary-foreground: var(--secondary-foreground);
--color-muted: var(--muted);
--color-muted-foreground: var(--muted-foreground);
--color-accent: var(--accent);
--color-accent-foreground: var(--accent-foreground);
--color-destructive: var(--destructive);
--color-destructive-foreground: var(--destructive-foreground);
--color-border: var(--border);
--color-input: var(--input);
--color-rule: var(--rule);
--color-edge-firm: var(--edge-firm);
--color-surface-recess: var(--surface-recess);
--color-surface-paper: var(--surface-paper);
--color-ring: var(--ring);
--color-band-ground: var(--band-ground);
--color-band-rule: var(--band-rule);
--color-status-blocked: var(--status-blocked);
--color-status-working: var(--status-working);
--color-status-done: var(--status-done);
--color-syntax-keyword: var(--syntax-keyword);
--color-syntax-string: var(--syntax-string);
--color-syntax-constant: var(--syntax-constant);
--color-syntax-property: var(--syntax-property);
--color-syntax-entity: var(--syntax-entity);
--color-syntax-comment: var(--syntax-comment);
--color-status-idle: var(--status-idle);
--color-status-unknown: var(--status-unknown);
--color-status-info: var(--status-info);
--color-stretch-1: var(--stretch-1);
--color-stretch-1-faded: var(--stretch-1-faded);
--color-stretch-2: var(--stretch-2);
--color-stretch-2-faded: var(--stretch-2-faded);
--color-stretch-3: var(--stretch-3);
--color-stretch-3-faded: var(--stretch-3-faded);
--color-stretch-4: var(--stretch-4);
--color-stretch-4-faded: var(--stretch-4-faded);
--color-host-0: var(--host-0);
--color-host-1: var(--host-1);
--color-host-2: var(--host-2);
--color-host-3: var(--host-3);
--color-host-4: var(--host-4);
--color-host-5: var(--host-5);
--color-host-6: var(--host-6);
--color-host-7: var(--host-7);
--color-host-8: var(--host-8);
--color-host-9: var(--host-9);
--font-mono:
"Nerd Font Symbols", "Terminal Symbols", "JetBrains Mono", "Cascadia Mono", "Cascadia Code",
"Roboto Mono", ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas,
"Liberation Mono", monospace;
/* The UI typeface — CHROME ONLY, and the DEFAULT one. Which face this actually is became a
per-device setting in ADR 0033; this is the stack a device that has never touched the setting
gets, which is why it is still spelled here and not behind a class. The `:root.font-*` blocks
below hold the others. See the @font-face block for what "chrome only" means and why the
stand-in family in the middle of the stack is not optional. */
--font-sans:
"Atkinson Hyperlegible Next", "Atkinson Hyperlegible Next Fallback", ui-sans-serif,
system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
/* The CONTENT stack: exactly what the app rendered in before the UI typeface arrived. Anything an
agent or a machine authored wears this, so the custom face never dresses someone else's words
(see the boundary note below). It is a plain system stack on purpose — it ships no bytes. */
--font-content:
ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto,
"Helvetica Neue", Arial, "Noto Sans", sans-serif;
}
/* Nerd Font symbols, bundled — the only webfont Collie ships.
*
* WHY. Agent prompts and status lines are full of Nerd Font glyphs (Powerline separators, devicons,
* Material icons: OMP's `symbolPreset: nerd`, herdr's own output). Desktop browsers can resolve them
* from a locally installed Nerd Font; mobile browsers cannot, so on the device Collie is actually
* FOR, every one of them rendered as a tofu box (#70). Nothing but shipping the glyphs fixes that.
*
* WHY IT'S FREE FOR PEOPLE WHO DON'T NEED IT. `unicode-range` restricts each face to private-use
* codepoints, so the browser fetches a file only once a glyph in that range is actually painted — a
* herd whose agents emit no Nerd Font glyphs downloads zero bytes. The split at the plane boundary
* keeps that promise sharp: a Powerline-only prompt pulls the 626 KB BMP face and never touches the
* 492 KB Material one. Both are kept OUT of the service-worker precache for the same reason (see
* vite.config.ts) and cached on first use instead (src/sw.ts).
*
* It comes first in `--font-mono` and that is safe precisely because of `unicode-range`: it can
* never be consulted for a letter, digit or box-drawing character, and CSS picks the "first
* available font" — the one whose metrics set the line — from the faces that cover U+0020, which
* this one does not. It carries symbols and nothing else, so the real monospace face still decides
* how text looks.
*
* EXPECTED, NOT A BUG. A symbol takes this font's advance width, not the surrounding monospace's, so
* in the pane mirror an icon nudges the columns to its right by a fraction of a cell. Fixing that
* needs a terminal emulator, which Collie does not run (ADR 0008) — a glyph you can read beats a
* column you can't.
*
* The files are subsets of Symbols Nerd Font Mono v3.5.0 (MIT — public/fonts/LICENSE.txt), built by
* scripts/build-nerd-font.sh. Regenerating means a new version in the filename: public/ assets are
* unhashed and the SW caches them forever by URL. */
@font-face {
font-family: "Nerd Font Symbols";
src: url("/fonts/nerd-symbols-3.5.0-pua.woff2") format("woff2");
font-display: swap;
unicode-range: U+E000-F8FF;
}
@font-face {
font-family: "Nerd Font Symbols";
src: url("/fonts/nerd-symbols-3.5.0-spua.woff2") format("woff2");
font-display: swap;
unicode-range: U+F0000-F1AFF;
}
/* Terminal Symbols: the agents' own chrome, which phones mostly have no glyph for. Claude Code
* prints ⎿ under every tool call, ⏺ before every message, ⏵⏵ in its mode line and ⧉ for an IDE
* selection, and each of those was a tofu box in the mirror. Lazy and out of the precache on the
* same terms as the Nerd Font faces above, and in the same position in `--font-mono`: the range
* leaves out U+0020, so it can never be the face that sets the line.
*
* A subset of JuliaMono v0.63.2 (OFL — public/fonts/LICENSE.txt), renamed as the licence
* requires, 19 KB, built by scripts/build-terminal-symbols.py. Unlike the Nerd Font faces it does
* override codepoints some platforms already draw, and on purpose: a monospace glyph fills one
* cell, where a phone's own ⏺ is often a colour emoji twice as wide. The range leaves out the
* block's two-cell codepoints (⌚⌛ 〈〉 ⏩-⏬ ⏰ ⏳); the script says why. */
@font-face {
font-family: "Terminal Symbols";
src: url("/fonts/terminal-symbols-0.63.2.woff2") format("woff2");
font-display: swap;
unicode-range: U+2300-2319, U+231C-2328, U+232B-23E8, U+23ED-23EF, U+23F1-23F2, U+23F4-23FF,
U+2980-29FF;
}
/* The UI typefaces — Space Grotesk (the default) and Aldrich, both bundled. The app's own voice,
* and NOTHING ELSE'S.
*
* WHAT IT DRESSES. Chrome: headers, section labels, buttons, settings rows, banners, counts, the
* wordmark. WHICH face does that is the reader's choice, per device: the Typeface card in Settings
* writes `collie:design:v1` and public/theme-init.js turns it into a root class before first paint
* (ADR 0033). This used to say "the maker's choice and there is no setting for it"; that decision
* fell, and the ADR records why. The Terminal font card below it is a DIFFERENT setting — it
* configures --font-mono, which nothing in this block touches.
*
* WHAT IT MUST NEVER DRESS. Anything an agent or a machine authored: the pane mirror, the
* transcript, agent prose and markdown, code, command text, file paths, ANSI. Two mechanisms hold
* that line, and both must stay:
* 1. `font-mono` — every verbatim terminal surface already carries it, so it resolves through
* --font-mono and never sees this face. The colour half of the same boundary is
* components/mirror-space.ts:33-34 (MIRROR_SPACE / MIRROR_INVERT); read its header first.
* 2. `font-content` (--font-content above) — for agent-authored text that is NOT verbatim
* terminal output and therefore is not monospaced: rendered markdown, and the labels the
* interactive blocks lift out of a dialog. mirror-space.ts says those blocks are "siblings of
* the mirror, not children" and keep app theming — true for colour, and exactly why they need
* this second mechanism for family. A new surface that prints an agent's words takes one of
* the two. If you cannot tell whether a surface is chrome or content, it is content.
*
* WHY THIS FACE. The mark is a line-art collie head in an ellipse with monotone beads: one stroke,
* constant curvature, mitred corners (collie-brand/src/bead.ts). Space Grotesk is the candidate
* drawn from the same idea — geometric skeleton, monotone stroke, cut terminals — so the wordmark
* at 18px reads as one drawing with the mark beside it. Its cost is the small end: x-height is
* 486/1000, the lowest of the three faces measured, so 11px uppercase labels and the 13px tier are
* where it has to be judged. IBM Plex Sans 3.201 and Geist 1.800 were tried in the playground's
* "UI typeface" card first and now ship as the faces of the themes Nightwatch and daylight, beside
* Atkinson Hyperlegible Next for harbour (see their blocks below). That card is still where a new
* candidate is tried at real sizes before anyone argues for shipping it.
*
* WEIGHT. 27 KB, subset to Latin + Latin-Ext-A + the punctuation this app actually prints (·, —, …,
* ‹›, arrows, ×, ✓) and instanced to wght 400–700. Compare 641 KB / 504 KB for the two Nerd Font
* faces — those are lazy behind `unicode-range`; this one is on the critical path, which is why it
* had to be this small. `tnum` is kept in the subset: every count in the app is `tabular-nums`.
* Rebuild with scripts/build-ui-font.sh; the version is in the filename because public/ assets are
* unhashed and the SW caches them forever by URL (lib/sw-routes.ts FONT_URLS).
*
* NO LAYOUT SHIFT — the part that is not negotiable. `font-display: swap` paints immediately in a
* fallback, so the only question is whether the swap MOVES anything. It does not, because the two
* families below are the local system face re-declared with Space Grotesk's own metrics:
* `size-adjust` matches the average advance width over the app's real charset, and the
* ascent/descent overrides restore the line box after that scaling. A glyph changes shape at swap;
* no box changes size. index.html preloads the DEFAULT face's file (Atkinson Hyperlegible Next,
* since 2026-11-06; Aldrich before), so on a warm tailnet its swap usually never happens at all. Measured in Chrome by forcing the swap with an observer running: see the
* stand-in's own comment below for what it is matching and why one table covers every platform.
*
* Space Grotesk is SIL OFL 1.1, public/fonts/LICENSE-space-grotesk.txt. Every other face ships its
* licence beside it. */
@font-face {
font-family: "Space Grotesk";
src: url("/fonts/ui-space-grotesk-2.000-latin.woff2") format("woff2");
font-weight: 400 700;
font-style: normal;
font-display: swap;
}
/* The metric-matched stand-in. No `src: url()` — this IS the local system face, resized, so it
costs nothing and is available at the first byte of CSS. `size-adjust` is the ratio of Space
Grotesk's total advance width over a line of the app's own copy to the same line in the local
face; the ascent/descent overrides then restore the line box after that scaling. Together they
mean the swap changes glyph SHAPES and nothing else: same line breaks, same line boxes, same
block heights. Recomputed by scripts/build-ui-font.sh — do not hand-edit.
The `local()` list is deliberately one metric family: Arial and its clones (Helvetica, Liberation
Sans, Arimo) plus Roboto, which measures within 0.3% of Arial on that same line, so one override
table serves both the desktop and the Android case. Noto Sans is NOT in the list — it is ~5%
wider and would defeat the whole mechanism. If none of them resolve the family is skipped and the
stack falls through to the plain system entries, which is the behaviour this app had before the
face existed. */
@font-face {
font-family: "Space Grotesk Fallback";
src:
local("Arial"), local("Helvetica Neue"), local("Helvetica"),
local("Liberation Sans"), local("Arimo"), local("Roboto");
size-adjust: 107.53%;
ascent-override: 91.51%;
descent-override: 27.16%;
line-gap-override: 0%;
/* Latin only, for the reason Aldrich's stand-in below gives: the 107.53% was measured on Space
Grotesk's Latin, so Russian used to land here ~7.5% too large. Cyrillic now skips it for the
plain system stack. Keep in step with the same block in index.html. */
unicode-range:
U+0000-00FF, U+0100-017F, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F,
U+20A0-20BF, U+2122, U+2190-21FF, U+2212, U+2264-2265, U+2699, U+2713-2714, U+25CF;
}
/* IBM Plex Sans, the face of the theme Nightwatch (M57). A reader gets it by picking that theme,
* which writes `plex` into the Typeface setting once, or by picking it on the Typeface card. Built
* by the same scripts/build-ui-font.sh run as the faces around it: wdth pinned to 100, wght kept at
* 400 to 700, subset to the same Latin ranges, 34 KB. Its bold is a real bold, so the base layer's
* `font-synthesis-weight: none` changes nothing here. Its figures are tabular by default.
*
* It is not preloaded and not precached: like Space Grotesk it is fetched the first time a reader
* chooses it, and the SW keeps it from then on (lib/sw-routes.ts UI_FONT_URLS). Declared here,
* between Space Grotesk and Aldrich, because fonts.test.ts compares this file's URL order with
* FONT_URLS and Aldrich's Cyrillic companion must stay last.
*
* IBM Plex Sans is SIL OFL 1.1, public/fonts/LICENSE-ibm-plex-sans.txt. */
@font-face {
font-family: "IBM Plex Sans";
src: url("/fonts/ui-ibm-plex-sans-3.201-latin.woff2") format("woff2");
font-weight: 400 700;
font-style: normal;
font-display: swap;
}
/* Plex's own metric-matched stand-in, on the same terms as the two beside it: `local()` only, one
metric family, numbers printed by scripts/build-ui-font.sh, Latin only by `unicode-range` so
Cyrillic skips it. Keep in step with the same block in index.html. */
@font-face {
font-family: "IBM Plex Sans Fallback";
src:
local("Arial"), local("Helvetica Neue"), local("Helvetica"),
local("Liberation Sans"), local("Arimo"), local("Roboto");
size-adjust: 101.21%;
ascent-override: 101.27%;
descent-override: 27.17%;
line-gap-override: 0%;
unicode-range:
U+0000-00FF, U+0100-017F, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F,
U+20A0-20BF, U+2122, U+2190-21FF, U+2212, U+2264-2265, U+2699, U+2713-2714, U+25CF;
}