Repository navigation
Expand file tree
/
Copy pathlayout.css
More file actions
494 lines (472 loc) · 15.5 KB
/
Copy pathlayout.css
File metadata and controls
494 lines (472 loc) · 15.5 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
@import 'tailwindcss';
@import 'tw-animate-css';
/*
* Served from this site rather than Google Fonts, so there is no stylesheet to wait for and no
* other server to connect to. `optional` never swaps a font in after text is drawn, which would
* nudge the layout. Not preloaded: Chrome holds back the first paint for preloaded fonts.
*/
@font-face {
font-family: 'Besley';
font-style: normal;
font-weight: 400 700;
font-display: optional;
src: url('../lib/assets/fonts/besley-normal-latin.woff2') format('woff2');
unicode-range:
U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329,
U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
font-family: 'Besley';
font-style: normal;
font-weight: 400 700;
font-display: optional;
src: url('../lib/assets/fonts/besley-normal-latin-ext.woff2') format('woff2');
unicode-range:
U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329,
U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F,
U+A720-A7FF;
}
@font-face {
font-family: 'Besley';
font-style: italic;
font-weight: 400;
font-display: optional;
src: url('../lib/assets/fonts/besley-italic-latin.woff2') format('woff2');
unicode-range:
U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329,
U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
font-family: 'Besley';
font-style: italic;
font-weight: 400;
font-display: optional;
src: url('../lib/assets/fonts/besley-italic-latin-ext.woff2') format('woff2');
unicode-range:
U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329,
U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F,
U+A720-A7FF;
}
@font-face {
font-family: 'Source Serif 4';
font-style: normal;
font-weight: 400 700;
font-display: optional;
src: url('../lib/assets/fonts/source-serif-4-normal-latin.woff2') format('woff2');
unicode-range:
U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329,
U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
font-family: 'Source Serif 4';
font-style: normal;
font-weight: 400 700;
font-display: optional;
src: url('../lib/assets/fonts/source-serif-4-normal-latin-ext.woff2') format('woff2');
unicode-range:
U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329,
U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F,
U+A720-A7FF;
}
@font-face {
font-family: 'Source Serif 4';
font-style: italic;
font-weight: 400;
font-display: optional;
src: url('../lib/assets/fonts/source-serif-4-italic-latin.woff2') format('woff2');
unicode-range:
U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329,
U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
font-family: 'Source Serif 4';
font-style: italic;
font-weight: 400;
font-display: optional;
src: url('../lib/assets/fonts/source-serif-4-italic-latin-ext.woff2') format('woff2');
unicode-range:
U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329,
U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F,
U+A720-A7FF;
}
@custom-variant dark (&:is(.dark *));
/*
* Colours follow Open Collective, so the app sits comfortably next to the site it submits to.
* paper slate-50 page behind white sheets
* ink slate-900 text
* navy Open Collective navy: the main action, page titles and the current place
* blue Open Collective blue: focus and links that want a second look
* band a pale blue stripe on every other row, like ruled ledger paper
*/
:root {
--radius: 0.375rem;
/* Under a card that stays at the top while the page scrolls under it. */
--raised-shadow: 0 3px 8px -4px rgb(12 39 100 / 0.14), 0 1px 2px -1px rgb(12 39 100 / 0.06);
/* Page titles, and skeletons standing in for them. */
--h1-size: clamp(1.875rem, 1.5rem + 1.4vw, 2.5rem);
--background: #f8fafc;
--foreground: #0f172a;
--card: #ffffff;
--card-foreground: #0f172a;
--popover: #ffffff;
--popover-foreground: #0f172a;
--primary: #0c2764;
--primary-foreground: #ffffff;
--secondary: #f1f5f9;
--secondary-foreground: #0f172a;
--muted: #f1f5f9;
--muted-foreground: #5d6b80;
--accent: #eef3fc;
--accent-foreground: #0c2764;
--destructive: #c42a4f;
--border: #e2e8f0;
--input: #cbd5e1;
--ring: #1869f5;
--band: #f3f7fe;
--rule: #0c2764;
--heading: #0c2764;
--status-draft: #5d6b80;
--status-submitted: #1153d6;
--status-paid: #0a7b4d;
/* Amber for things that need attention but have not gone wrong, like a pending expense. Solid
colours, not a tint, so the page does not show through and muddy them. */
--warning: #7a5600;
--warning-surface: #fff8db;
--warning-border: #f2dc8a;
/* A dot that flags something unfinished. Dark enough for 3:1 against the card and muted rows,
as a graphic that carries meaning needs. */
--attention: #b45309;
--chart-income: #1869f5;
--chart-expenses: #e0577d;
--chart-expenses-muted: #f6c3d1;
--chart-income-muted: #bcd3fb;
/* Categories are shades of the two hues the charts already use, told apart by lightness: blue
for money coming in and for anything else, pink for expenses. Other is slate. */
--chart-1: #1869f5;
--chart-2: #0c2764;
--chart-3: #7ba7f7;
--chart-4: #bcd3fb;
--chart-expenses-1: #e0577d;
--chart-expenses-2: #8c2347;
--chart-expenses-3: #ee93ac;
--chart-expenses-4: #f6c3d1;
--chart-other: #8794a8;
/* A progress ring, from where it starts to its tip, before and after its goal. Vivid, as a reward. */
--ring-from: oklch(0.45 0.2 264);
--ring-to: oklch(0.7 0.19 245);
--ring-done-from: oklch(0.5 0.16 155);
--ring-done-to: oklch(0.82 0.22 135);
--chart-balance: #0c2764;
}
.dark {
--background: #0b1430;
--foreground: #e2e8f0;
--card: #111c3d;
--card-foreground: #e2e8f0;
--popover: #111c3d;
--popover-foreground: #e2e8f0;
--primary: #8fb4ff;
--primary-foreground: #0b1430;
--secondary: #1a2650;
--secondary-foreground: #e2e8f0;
--muted: #1a2650;
--muted-foreground: #94a3b8;
--accent: #1c2a58;
--accent-foreground: #e2e8f0;
--destructive: #f28ba6;
--border: #233163;
--input: #2c3b72;
--ring: #5b95ff;
--band: #142043;
--rule: #8fb4ff;
--heading: #dbe6ff;
--status-draft: #a3b0c4;
--status-submitted: #8fb4ff;
--status-paid: #6fd3a5;
--warning: #f3d27a;
--warning-surface: #2a2614;
--warning-border: #4d4422;
--attention: #f7b955;
--chart-income: #5b95ff;
--chart-expenses: #f28ba6;
--chart-expenses-muted: #5a2a3a;
--chart-income-muted: #23386e;
--chart-1: #5b95ff;
--chart-2: #c9dbff;
--chart-3: #3365d1;
--chart-4: #23386e;
--chart-expenses-1: #f28ba6;
--chart-expenses-2: #fbd3de;
--chart-expenses-3: #c4486e;
--chart-expenses-4: #5a2a3a;
--chart-other: #5f6e98;
--ring-from: oklch(0.55 0.2 264);
--ring-to: oklch(0.8 0.15 240);
--ring-done-from: oklch(0.55 0.17 155);
--ring-done-to: oklch(0.88 0.23 130);
--chart-balance: #8fb4ff;
}
@theme inline {
--shadow-raised: var(--raised-shadow);
--font-serif: 'Source Serif 4', Georgia, serif;
/* Clarendon, the face of ledgers and banknotes. Titles, the wordmark and headline figures only. */
--font-display: 'Besley', 'Source Serif 4', Georgia, serif;
--radius-sm: calc(var(--radius) - 3px);
--radius-md: calc(var(--radius) - 2px);
--radius-lg: var(--radius);
--radius-xl: calc(var(--radius) + 2px);
--color-background: var(--background);
--color-foreground: var(--foreground);
--color-card: var(--card);
--color-card-foreground: var(--card-foreground);
--color-popover: var(--popover);
--color-popover-foreground: var(--popover-foreground);
--color-primary: var(--primary);
--color-primary-foreground: var(--primary-foreground);
--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-border: var(--border);
--color-input: var(--input);
--color-ring: var(--ring);
--color-band: var(--band);
--color-rule: var(--rule);
--color-status-draft: var(--status-draft);
--color-status-submitted: var(--status-submitted);
--color-status-paid: var(--status-paid);
--color-warning: var(--warning);
--color-warning-surface: var(--warning-surface);
--color-warning-border: var(--warning-border);
--color-attention: var(--attention);
--color-chart-income: var(--chart-income);
--color-chart-expenses: var(--chart-expenses);
--color-chart-expenses-muted: var(--chart-expenses-muted);
--color-chart-income-muted: var(--chart-income-muted);
--color-chart-1: var(--chart-1);
--color-chart-2: var(--chart-2);
--color-chart-3: var(--chart-3);
--color-chart-4: var(--chart-4);
--color-chart-expenses-1: var(--chart-expenses-1);
--color-chart-expenses-2: var(--chart-expenses-2);
--color-chart-expenses-3: var(--chart-expenses-3);
--color-chart-expenses-4: var(--chart-expenses-4);
--color-chart-other: var(--chart-other);
--color-chart-balance: var(--chart-balance);
}
@layer base {
* {
@apply border-border outline-ring/50;
}
/*
Links to a part of a page land below the sticky header, not under it. The header and footer
are inset from the edges, so the canvas iOS shows past the top and bottom takes the page's
colour.
*/
html {
@apply bg-background;
scroll-padding-top: 5.5rem;
}
/*
In Work, only the Work row stays at the top, so only it covers the page. Its pages link to
fields, so there is also room for the label above one.
*/
html:has([data-work-row]) {
scroll-padding-top: 4.5rem;
}
/* The header scrolls away on short screens; see Header.svelte. */
@media (max-height: 30rem) {
html,
html:has([data-work-row]) {
scroll-padding-top: 1rem;
}
}
/*
A column at least as tall as the window, so the footer sits at its bottom on short pages
rather than following the content up and down as skeletons give way to it.
*/
body {
@apply flex min-h-dvh flex-col bg-background font-serif text-foreground antialiased;
font-optical-sizing: auto;
font-size: 100%;
font-variant-numeric: lining-nums;
line-height: 1.6;
}
h1,
h2,
h3 {
font-weight: 600;
line-height: 1.2;
text-wrap: balance;
}
/*
iOS Safari draws a date field at its own width and height, past the edge of its column and
taller than the fields beside it, with the date at the top. Without its native look it takes
the size it is given, with the date left-aligned. Only as a flex box, which the field is unless
a class changes it, is the date centred from top to bottom.
*/
input[type='date'] {
appearance: none;
align-items: center;
}
input[type='date']::-webkit-date-and-time-value {
margin: 0;
text-align: start;
}
/* Page titles share one size and face everywhere. */
h1 {
font-family: var(--font-display);
color: var(--heading);
font-size: var(--h1-size);
font-weight: 500;
letter-spacing: -0.01em;
}
}
/*
* One clear outline for everything focused from the keyboard, in place of the faint ring components
* pair with `outline-none`. Outside a layer, so it wins over both. Text fields and the parts of a
* date or time are left out: their box already turns the ring colour, and an outline on the field
* inside a box, like the search, would draw a second one.
*/
:focus-visible:not(
input:not([type='checkbox'], [type='radio'], [type='range'], [type='file']),
textarea,
[role='spinbutton']
) {
outline: 2px solid var(--ring);
/* Set `--focus-offset` negative to draw it inside, where a box would clip it. */
outline-offset: var(--focus-offset, 2px);
--tw-ring-shadow: 0 0 #0000;
}
/* Links within text are underlined, so they are not told apart by colour alone. */
:is(p, dd, figcaption, small) a:not([data-slot]) {
text-decoration-line: underline;
text-underline-offset: 0.2em;
}
@layer components {
/*
* Tables read like green-bar accounting paper: a double rule under the column heads and a
* faint band on every other row, so the eye can follow a line across wide figures.
*/
.ledger {
width: 100%;
font-variant-numeric: tabular-nums lining-nums;
}
.ledger thead {
border-bottom: 3px double var(--rule);
color: var(--muted-foreground);
}
/* On the cells, since a header cell centres itself rather than inheriting from the row. */
.ledger th {
font-weight: 500;
text-align: left;
}
.ledger tbody > tr:nth-child(even),
.ledger-rows > li:nth-child(even) {
background-color: var(--band);
}
}
/*
* A ledger too wide for its space turns each row into a short record: its first cell as the title,
* then each figure on its own line beside its column head, taken from the cell's `data-label`. Used
* with a variant, like `max-sm:ledger-stacked`, so each table stacks where it stops fitting. Its
* selectors outweigh the cells' own padding and alignment utilities.
*/
@utility ledger-stacked {
& thead {
position: absolute;
width: 1px;
height: 1px;
overflow: hidden;
clip-path: inset(50%);
white-space: nowrap;
}
& tr {
display: block;
padding-block: 0.5rem;
}
& :is(td, th) {
display: block;
padding-block: 0.125rem;
text-align: right;
}
& tr > :first-child {
text-align: left;
font-weight: 500;
}
& [data-label]::before {
content: attr(data-label);
float: left;
margin-right: 1rem;
color: var(--muted-foreground);
}
}
/*
* Reduced motion keeps fades and colour changes but nothing moves: enters and exits from
* tw-animate-css lose their zoom and slide, and the few hover and press movements are gated with
* `motion-safe:` where they are declared.
*/
@media (prefers-reduced-motion: reduce) {
* {
--tw-enter-scale: 1 !important;
--tw-exit-scale: 1 !important;
--tw-enter-translate-x: 0 !important;
--tw-enter-translate-y: 0 !important;
--tw-exit-translate-x: 0 !important;
--tw-exit-translate-y: 0 !important;
--tw-enter-rotate: 0 !important;
--tw-exit-rotate: 0 !important;
}
}
/*
* Skeletons stay hidden for a moment, so data that arrives quickly goes straight from nothing to
* content instead of flashing a skeleton first. Outside a layer so it wins over `animate-pulse`.
*/
[data-slot='skeleton'] {
animation:
skeleton-wait 300ms step-end,
pulse 2s cubic-bezier(0.4, 0, 0.6, 1) 300ms infinite;
}
@keyframes skeleton-wait {
from,
to {
visibility: hidden;
}
}
/* Stays hidden for a moment, so a load that finishes quickly never flashes it. */
@utility appear-delayed {
animation: skeleton-wait 300ms step-end;
}
/* A card that stays at the top casts a shadow once the page scrolls under it. */
@utility shadow-on-scroll {
@supports (animation-timeline: scroll()) {
animation: shadow-on-scroll linear both;
animation-timeline: scroll(root);
animation-range: 0 1rem;
}
}
@keyframes shadow-on-scroll {
from {
box-shadow: 0 0 #0000;
}
to {
box-shadow: var(--raised-shadow);
}
}
/*
* iOS Safari zooms into a field whose text is under 16px when it is focused, so on touch screens
* fields, and editable parts like a time field's segments, keep at least that size, at any width
* and whatever size a component gives them. Outside a layer so it wins over `text-sm` and
* `md:text-sm`.
*/
@media (pointer: coarse) {
input:not([type='checkbox'], [type='radio'], [type='range'], [type='color'], [type='file']),
textarea,
select,
[contenteditable]:not([contenteditable='false']) {
font-size: max(1rem, 16px);
}
}