Repository navigation
Expand file tree
/
Copy pathindex.css
More file actions
408 lines (366 loc) · 14.9 KB
/
Copy pathindex.css
File metadata and controls
408 lines (366 loc) · 14.9 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
@import "tailwindcss";
/*
* Stories 201–203: the dark scheme. With System no attribute is set and the
* stylesheet follows `prefers-color-scheme` on its own, live and with no flash
* on load; a Light or Dark choice sets `data-theme` on the root element, which
* wins over the system. `dark:` means exactly that, so a rule written with it
* and the colour names below can never disagree about which scheme is drawn.
*/
@custom-variant dark {
@media (prefers-color-scheme: dark) {
&:not(:where([data-theme="light"], [data-theme="light"] *)) {
@slot;
}
}
&:where([data-theme="dark"], [data-theme="dark"] *) {
@slot;
}
}
/*
* Colours named by what they mean, not by palette step. Each light value is
* the colour the app uses today, so moving a class or a rule onto a name
* changes nothing on screen: the hex values are the Editor's own, and the
* oklch values are Tailwind's palette steps copied exactly. Every name has a
* dark value too, below the light ones. A palette class in UI source fails the
* build (`scripts/gates/palette.mjs`), so the table is how to read old code,
* not a choice still open.
*
* Moving a component is mechanical: replace each palette class with the name
* in the table, keeping its variant (hover:, focus-visible:, disabled:) and
* its opacity (/60) as they are. `bg-stone-100/60` becomes `bg-sunk/60`.
*
* bg-white paper
* bg-stone-50 ground
* bg-stone-100 sunk
* bg-stone-200 sunk-strong
* bg-stone-300 rule
* bg-stone-700 quiet-ink the hover of an ink fill
* bg-stone-900 ink an ink fill: the primary button
* text-stone-50 on-ink text on an ink fill
* text-stone-100 sunk text on an ink/90 fill
* text-stone-400 ghost-ink
* text-stone-500 faint-ink
* text-stone-600 muted-ink
* text-stone-700 quiet-ink
* text-stone-800 soft-ink
* text-stone-900 ink
* border-stone-100 rule-faint
* border-stone-200, divide-stone-200 rule-soft
* border-stone-300 rule
* border-stone-400 rule-strong
* border-stone-500 rule-focus a focused field's border
* border-stone-900 ink the selected tab or choice
* border-t-stone-700 quiet-ink the spinner's arc
* ring-stone-600 focus
*
* bg-amber-100 mark-wash the Current Finding's row
* bg-amber-50 warning-surface
* text-amber-50 warning-surface text on a warning fill
* border-amber-200 warning-rule
* border-amber-300 warning-rule-strong
* text-amber-700 warning-muted
* ring-amber-700 warning-focus
* text-amber-800, bg-amber-800 warning-soft
* text-amber-900, bg-amber-900 warning
* bg-amber-200 milestone the milestone badge
* text-amber-900 on that badge milestone-ink (both violet now: story 208)
*
* text-red-700 failure
* bg-red-50 failure-surface
* border-red-300 failure-rule
* ring-red-600 failure-focus
* text-emerald-700 success a Connection test that passed
*
* green-50 / green-200 / green-900 agreement-surface / agreement-rule /
* agreement a Prediction the Judge agreed with
* bg-green-100, text-green-900 added, added-ink the Judge's word diff
* bg-red-100, text-red-900 removed, removed-ink the Judge's word diff
*
* decoration-rose-500 violation the strike through a Violation
* text-rose-800 violation-ink
* bg-rose-50 violation-surface
* bg-rose-100 violation-wash
* border-rose-300 violation-rule
* ring-rose-600 violation-focus
*
* text-blue-700 link a link in the tool's own text
* text-blue-900 link-hover
*/
@theme {
/* The page and its surroundings. */
--color-paper: #ffffff; /* white: the page the Writer's prose sits on */
--color-ground: oklch(98.5% 0.001 106.423); /* stone-50: the app behind the page */
--color-sunk: #f5f5f4; /* stone-100: a recessed surface; inline code */
--color-sunk-strong: oklch(92.3% 0.003 48.717); /* stone-200: a chip, a selected row */
/* Ink, from strongest to faintest. */
--color-ink: #1c1917; /* stone-900 */
--color-soft-ink: oklch(26.8% 0.007 34.298); /* stone-800 */
--color-quiet-ink: oklch(37.4% 0.01 67.558); /* stone-700 */
--color-muted-ink: #57534e; /* stone-600 */
--color-faint-ink: oklch(55.3% 0.013 58.071); /* stone-500 */
--color-ghost-ink: oklch(70.9% 0.01 56.259); /* stone-400 */
--color-on-ink: oklch(98.5% 0.001 106.423); /* stone-50: text on an ink fill */
/* Rules, from faintest to strongest, and the focus ring. */
--color-rule-faint: oklch(97% 0.001 106.424); /* stone-100 */
--color-rule-soft: oklch(92.3% 0.003 48.717); /* stone-200 */
--color-rule: #d6d3d1; /* stone-300 */
--color-rule-strong: oklch(70.9% 0.01 56.259); /* stone-400 */
--color-rule-focus: oklch(55.3% 0.013 58.071); /* stone-500 */
--color-focus: oklch(44.4% 0.011 73.639); /* stone-600 */
/* The mark. */
--color-mark: #fde68a; /* amber-200: a Highlight */
--color-mark-line: #d97706; /* amber-600: a Highlight's underline */
--color-mark-hover: #fcd34d; /* amber-300: a Highlight under the pointer */
--color-current-mark: #fbbf24; /* amber-400: the Current Finding's Highlight */
--color-current-mark-line: #b45309; /* amber-700: its underline and ring */
--color-mark-wash: oklch(96.2% 0.059 95.617); /* amber-100: the Current Finding's row */
/* Warning: something to know about, not something that broke. */
--color-warning: oklch(41.4% 0.112 45.904); /* amber-900: a notice's text */
--color-warning-soft: oklch(47.3% 0.137 46.201); /* amber-800 */
--color-warning-muted: oklch(55.5% 0.163 48.998); /* amber-700 */
--color-warning-focus: oklch(55.5% 0.163 48.998); /* amber-700 */
--color-warning-surface: oklch(98.7% 0.022 95.277); /* amber-50 */
--color-warning-rule: oklch(92.4% 0.12 95.746); /* amber-200 */
--color-warning-rule-strong: oklch(87.9% 0.169 91.605); /* amber-300 */
/*
* Milestone: a Revision the Writer chose to mark. Violet rather than amber, so
* a milestone never reads as a warning or a mark (story 208).
*/
--color-milestone: oklch(89.4% 0.057 293.283); /* violet-200: a milestone badge */
--color-milestone-ink: oklch(38% 0.189 293.745); /* violet-900: its text */
/* Failure, and its opposite. */
--color-failure: oklch(50.5% 0.213 27.518); /* red-700 */
--color-failure-surface: oklch(97.1% 0.013 17.38); /* red-50 */
--color-failure-rule: oklch(80.8% 0.114 19.571); /* red-300 */
--color-failure-focus: oklch(57.7% 0.245 27.325); /* red-600 */
--color-success: oklch(50.8% 0.118 165.612); /* emerald-700 */
/* The Judge: a Prediction it agreed with, and its word diff. */
--color-agreement: oklch(39.3% 0.095 152.535); /* green-900 */
--color-agreement-surface: oklch(98.2% 0.018 155.826); /* green-50 */
--color-agreement-rule: oklch(92.5% 0.084 155.995); /* green-200 */
--color-added: oklch(96.2% 0.044 156.743); /* green-100 */
--color-added-ink: oklch(39.3% 0.095 152.535); /* green-900 */
--color-removed: oklch(93.6% 0.032 17.717); /* red-100 */
--color-removed-ink: oklch(39.6% 0.141 25.723); /* red-900 */
/* A Violation: praise or a rewrite the linter struck through. */
--color-violation: oklch(64.5% 0.246 16.439); /* rose-500: the strike */
--color-violation-ink: oklch(45.5% 0.188 13.697); /* rose-800 */
--color-violation-surface: oklch(96.9% 0.015 12.422); /* rose-50 */
--color-violation-wash: oklch(94.1% 0.03 12.58); /* rose-100 */
--color-violation-rule: oklch(81% 0.117 11.638); /* rose-300 */
--color-violation-focus: oklch(58.6% 0.253 17.585); /* rose-600 */
/*
* Links. A link in the Writer's prose and a link in the tool's own text are
* different blues today: the Editor's hex is Tailwind v3's blue-700, and the
* palette class is v4's, which renders brighter.
*/
--color-prose-link: #1d4ed8; /* a link in the Writer's prose */
--color-link: oklch(48.8% 0.243 264.376); /* blue-700 */
--color-link-hover: oklch(37.9% 0.146 265.522); /* blue-900 */
}
/*
* The same names in the dark scheme. The page is a dark paper, warm and not
* black (story 206), lifted a step above the ground behind it as the white page
* is in light. Ink runs the other way, light on dark, and never pure white, so
* a long session does not glare. An ink fill becomes a light fill with dark
* text on it; `on-ink` follows.
*
* Contrast is story 187's, kept in dark (story 210): `muted-ink`, the Rail's
* quiet text and a disabled Pass name, is at least 4.5:1 on paper, sunk and
* sunk-strong, and so is `faint-ink` on paper and ground. `ghost-ink` is for
* what is decorative, as in light.
*
* The mark is still amber here: a deep amber wash with a bright amber
* underline, so ink stays readable on it.
*/
@layer theme {
:root {
color-scheme: light;
@variant dark {
color-scheme: dark;
--color-paper: #1f1d1a;
--color-ground: #191816;
--color-sunk: #292724;
--color-sunk-strong: #34312d;
--color-ink: #ebe7e1;
--color-soft-ink: #ddd8d1;
--color-quiet-ink: #cbc5bd;
--color-muted-ink: #b3aca3;
--color-faint-ink: #a29b92;
--color-ghost-ink: #7a746c;
--color-on-ink: #1c1a18;
--color-rule-faint: #25231f;
--color-rule-soft: #322f2b;
--color-rule: #45413b;
--color-rule-strong: #5d5850;
--color-rule-focus: #8a837a;
--color-focus: #b3aca3;
--color-mark: #4e3a12;
--color-mark-line: #e0a53a;
--color-mark-hover: #614815;
--color-current-mark: #7a5a17;
--color-current-mark-line: #f5c461;
--color-mark-wash: #3a2e15;
--color-warning: #f2c872;
--color-warning-soft: #e9b75a;
--color-warning-muted: #dcaa52;
--color-warning-focus: #dcaa52;
--color-warning-surface: #2c2414;
--color-warning-rule: #5a4619;
--color-warning-rule-strong: #7a5f22;
--color-milestone: #3d3163;
--color-milestone-ink: #d9ccff;
--color-failure: #f5958c;
--color-failure-surface: #321c1a;
--color-failure-rule: #6e302b;
--color-failure-focus: #f5958c;
--color-success: #6fd6a6;
--color-agreement: #93dcaa;
--color-agreement-surface: #17281c;
--color-agreement-rule: #2e5539;
--color-added: #1e3a26;
--color-added-ink: #a8e4ba;
--color-removed: #401f1e;
--color-removed-ink: #f6aea7;
--color-violation: #f7768a;
--color-violation-ink: #fca5b3;
--color-violation-surface: #2f1a1e;
--color-violation-wash: #45222a;
--color-violation-rule: #7a2e3b;
--color-violation-focus: #f7768a;
--color-prose-link: #8fb4ff;
--color-link: #93b6ff;
--color-link-hover: #c4d6ff;
}
}
}
/*
* The root is the ground, so the loading screen, an overscroll and the moment
* before the app mounts are the scheme's colour, never the browser's own.
*
* A focus ring's offset is drawn in the page's colour rather than Tailwind's
* white, so an ink-filled control's ring in dark is not set off by a white band.
*/
@layer base {
html {
background-color: var(--color-ground);
}
*,
::before,
::after {
--tw-ring-offset-color: var(--color-paper);
}
}
/*
* The rich text surface. Tailwind's preflight resets list and heading styling,
* so the editor restates what a Writer expects from a document. These are the
* rendered forms the Writer edits; the Markdown that Core derives is separate.
*/
.obelus-editor {
font-size: 1rem;
line-height: 1.75;
color: var(--color-ink);
}
.obelus-editor > * + * {
margin-top: 0.75rem;
}
.obelus-editor h1 {
font-size: 1.875rem;
font-weight: 700;
line-height: 1.2;
margin-top: 1.5rem;
}
.obelus-editor h2 {
font-size: 1.5rem;
font-weight: 600;
line-height: 1.25;
margin-top: 1.25rem;
}
.obelus-editor h3 {
font-size: 1.25rem;
font-weight: 600;
line-height: 1.3;
margin-top: 1rem;
}
.obelus-editor ul {
list-style: disc;
padding-left: 1.5rem;
}
.obelus-editor ol {
list-style: decimal;
padding-left: 1.5rem;
}
.obelus-editor li > ul,
.obelus-editor li > ol {
margin-top: 0.25rem;
}
.obelus-editor blockquote {
border-left: 3px solid var(--color-rule);
padding-left: 1rem;
color: var(--color-muted-ink);
font-style: italic;
}
.obelus-editor code {
background: var(--color-sunk);
padding: 0.1rem 0.25rem;
border-radius: 0.25rem;
font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
font-size: 0.9em;
}
.obelus-editor pre {
background: var(--color-ink);
color: var(--color-sunk);
padding: 0.75rem 1rem;
border-radius: 0.5rem;
overflow-x: auto;
font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
font-size: 0.875rem;
}
.obelus-editor pre code {
background: transparent;
padding: 0;
color: inherit;
font-size: inherit;
}
.obelus-editor a {
color: var(--color-prose-link);
text-decoration: underline;
}
/*
* A Highlight is the visual rendering of an Anchor. Amber so it reads as a mark
* the Writer works through, not as an error; the underline keeps it legible
* over bold and code.
*
* The underline is a text decoration, never a box-shadow, and the span has no
* border-radius. A Document can carry hundreds of Highlights, and WebKit
* repaints an inset shadow on every one of them as the Writer types: measured in
* WebKit with ~490 Highlights, the shadow tripled the time a keystroke took.
*/
.obelus-highlight {
background-color: var(--color-mark);
text-decoration-line: underline;
text-decoration-color: var(--color-mark-line);
text-decoration-thickness: 0.15em;
text-underline-offset: 0.15em;
}
/*
* The Current Finding's Highlight, drawn beside `.obelus-highlight` rather than
* instead of it. A deeper amber and a ring mark the one the queue is on without
* changing what a Highlight means. The ring is an outline: only one Highlight is
* ever current, so it never costs what a ring on every Highlight would.
*/
.obelus-highlight-current {
background-color: var(--color-current-mark);
text-decoration-color: var(--color-current-mark-line);
outline: 1px solid var(--color-current-mark-line);
}
/*
* A click on a Highlight opens its Findings beside the prose; deepening it
* under the pointer says so without changing what a Highlight means.
*/
.obelus-highlight:hover {
background-color: var(--color-mark-hover);
}
.obelus-editor:focus {
outline: none;
}