forked from Liquifact/Liquifact-frontend
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathglobals.css
More file actions
422 lines (361 loc) · 12.5 KB
/
Copy pathglobals.css
File metadata and controls
422 lines (361 loc) · 12.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
@import "tailwindcss";
/*
LiquiFact global theming tokens.
Theme is driven by a `data-theme` attribute set on <html> by the
ThemeToggle component (and the pre-paint inline script in layout.js).
Supported values: data-theme="dark" | data-theme="light"
Token mapping:
- --color-bg : page background
- --color-fg : primary text
- --color-muted : secondary / muted text
- --color-surface : card / panel background
- --color-border : subtle border colour
- --color-primary : cyan brand accent (#22d3ee / cyan-400)
- --color-focus-ring : focus-visible outline colour (high-contrast in both themes)
*/
/* ── Dark theme (default — matches existing slate-950 palette) ─────────────── */
:root,
[data-theme="dark"] {
--color-bg: #020617; /* slate-950 */
--color-fg: #f1f5f9; /* slate-100 */
--color-muted: #94a3b8; /* slate-400 */
--color-surface: #0f172a; /* slate-900 */
--color-border: #1e293b; /* slate-800 */
--color-primary: #22d3ee; /* cyan-400 */
--color-focus-ring: #22d3ee; /* cyan-400 — 10:1 against slate-950 */
--market-card-padding: 1.25rem;
--market-card-gap: 1rem;
--market-card-title-font-size: 0.95rem;
--market-card-title-font-weight: 600;
--market-card-title-line-height: 1.4;
--market-card-meta-font-size: 0.875rem;
--market-card-meta-line-height: 1.5;
--market-card-meta-letter-spacing: 0.01em;
}
/* ── Light theme ───────────────────────────────────────────────────────────── */
[data-theme="light"] {
--color-bg: #f8fafc; /* slate-50 */
--color-fg: #0f172a; /* slate-900 */
--color-muted: #64748b; /* slate-500 */
--color-surface: #ffffff; /* white */
--color-border: #e2e8f0; /* slate-200 */
--color-primary: #0891b2; /* cyan-600 — stays legible on white */
--color-focus-ring: #0891b2; /* cyan-600 — 3.5:1 against slate-50 */
--market-card-padding: 1.25rem;
--market-card-gap: 1rem;
--market-card-title-font-size: 0.95rem;
--market-card-title-font-weight: 600;
--market-card-title-line-height: 1.4;
--market-card-meta-font-size: 0.875rem;
--market-card-meta-line-height: 1.5;
--market-card-meta-letter-spacing: 0.01em;
}
@theme inline {
--color-bg: var(--color-bg);
--color-foreground: var(--color-fg);
--color-muted: var(--color-muted);
--color-primary: var(--color-primary);
--color-focus-ring: var(--color-focus-ring);
/* Geist fonts (provided by app/layout.js via next/font) */
--font-sans: var(--font-geist-sans);
--font-mono: var(--font-geist-mono);
}
html,
body {
background: var(--color-bg);
color: var(--color-fg);
font-family: var(--font-geist-sans);
}
body {
margin: 0;
}
/* Skip-to-content: off-screen until focused, then anchors to top-left of viewport.
Only visible to keyboard users (on first Tab press). Mouse users never see it. */
.skip-link {
position: absolute;
left: -9999px;
top: 1rem;
width: 1px;
height: 1px;
overflow: hidden;
z-index: 9999;
padding: 0.5rem 1rem;
background: var(--color-primary);
color: var(--color-bg);
font-weight: 600;
border-radius: 0.375rem;
text-decoration: none;
white-space: nowrap;
}
.skip-link:focus-visible {
left: 1rem;
width: auto;
height: auto;
overflow: visible;
outline: 2px solid var(--color-bg);
outline-offset: 2px;
}
/*
Reusable focus ring — high-contrast outline driven by --color-focus-ring.
Apply the .focus-ring class to any interactive element (button, link, input, toggle)
that needs a consistent, theme-aware focus-visible indicator.
The colour token --color-focus-ring is set in both dark and light theme blocks
above and is verified by the WCAG contrast harness in
app/globals.contrast-ratio.test.tsx.
*/
.focus-ring:focus-visible {
outline: 2px solid var(--color-focus-ring);
outline-offset: 2px;
outline-style: solid;
border-radius: 0.25rem;
}
/* ── Accessibility: reduced motion ─────────────────────────────────────────── */
/*
Disables non-essential animation/transition for users who have requested
reduced motion at the OS level. Tailwind's `motion-reduce:` variant covers
a few components explicitly (e.g. UploadZone's progress bar and spinner);
this global rule is the safety net for everything else that renders
`animate-*`/`transition-*` utility classes without an explicit override.
The class-specific rules below complement the universal wildcard by
explicitly zeroing out the most-common Tailwind animation/transition
utilities. They are required by the CSS-source integrity tests in
app/invest/reduced-motion-contrast.test.tsx (issue #689) and serve as
reliable hooks for components that can't add `motion-reduce:` inline.
invoice-detail-* classes target InvoiceDetailClient.jsx and FundActions.jsx
specifically (issue #31) — they suppress the `transition-colors` buttons
and the low-opacity background fills that are illegible under reduced
motion preference.
*/
@media (prefers-reduced-motion: reduce) {
*,
*::before,
*::after {
animation-duration: 0.001ms !important;
animation-iteration-count: 1 !important;
transition-duration: 0.001ms !important;
scroll-behavior: auto !important;
}
/* Tailwind animation utilities — explicit overrides required by test harness */
.animate-pulse {
animation: none;
}
.animate-spin {
animation: none;
}
/* Tailwind transition utilities — explicit overrides required by test harness */
.transition {
transition: none;
}
.transition-colors {
transition: none;
}
.transition-all {
transition: none;
}
/* Invoice-detail action buttons — suppress hover color transitions */
.invoice-detail-action-btn {
transition: none;
}
/* Invoice-detail section — suppress any background-color transitions
on the surface panel (bg-slate-900/50 hover or focus effects) */
.invoice-detail-section {
transition: none;
}
/* Wallet status copy button and dot transitions */
.wallet-copy-btn,
.wallet-status-dot {
transition: none;
}
}
/* ── Accessibility: high contrast ──────────────────────────────────────────── */
/*
Strengthens low-opacity decorative fills/borders that are hard to read
under Windows High Contrast Mode (forced-colors) or a user's OS-level
"increase contrast" preference. Scoped via utility classes rather than
every existing selector.
.upload-* → UploadZone component (issue #699)
.invoice-detail-* → InvoiceDetailClient + FundActions (issue #31)
.opacity-60 → marketplace "Soon" filters wrapper (issue #689)
*/
@media (forced-colors: active) {
.upload-dropzone {
border: 2px solid CanvasText;
background-color: Canvas;
}
.upload-subtle-panel {
border-color: CanvasText;
background-color: Canvas;
}
/* Invoice-detail summary section — replace semi-transparent bg with system Canvas */
.invoice-detail-section {
border: 2px solid CanvasText;
background-color: Canvas;
forced-color-adjust: none;
}
/* Definition-list terms → GrayText for correct semantic mapping */
.invoice-detail-dt {
color: GrayText;
forced-color-adjust: none;
}
/* Definition-list values → CanvasText so they are never lost */
.invoice-detail-dd {
color: CanvasText;
forced-color-adjust: none;
}
/* Action buttons — replace semi-transparent fills with ButtonFace/ButtonText */
.invoice-detail-action-btn {
background-color: ButtonFace;
color: ButtonText;
border: 1px solid ButtonText;
forced-color-adjust: none;
}
/* Disclaimer note — same surface treatment as the section */
.invoice-detail-disclaimer {
border: 1px solid CanvasText;
background-color: Canvas;
color: CanvasText;
forced-color-adjust: none;
}
/* Wallet components */
.wallet-status-dot {
forced-color-adjust: none;
}
.wallet-address-text {
color: CanvasText;
forced-color-adjust: none;
}
.wallet-balance-text {
color: GrayText;
forced-color-adjust: none;
}
.wallet-helper-text {
color: CanvasText;
forced-color-adjust: none;
}
.wallet-skeleton-text-primary,
.wallet-skeleton-text-secondary,
.wallet-skeleton-btn {
border: 1px solid CanvasText;
background-color: Canvas;
}
}
@media (prefers-contrast: more) {
.upload-dropzone {
border-color: #e2e8f0; /* slate-200 — far stronger than the default slate-700 */
}
.upload-subtle-panel {
border-color: #67e8f9; /* cyan-300 */
background-color: rgba(8, 145, 178, 0.18); /* cyan-600, opaque enough to read */
}
.upload-muted-text {
color: #cbd5e1; /* slate-300 — far stronger than slate-500 */
}
/* Marketplace "Soon" filters — remove opacity so controls are legible (issue #689) */
.opacity-60 {
opacity: 1;
}
/* Invoice-detail: strengthen the low-opacity surface and muted text */
.invoice-detail-section {
border-color: #cbd5e1; /* slate-300 */
background-color: #0f172a; /* slate-900 — fully opaque */
}
.invoice-detail-dt {
color: #94a3b8; /* slate-400 — stronger than slate-500 */
}
.invoice-detail-dd {
color: #f1f5f9; /* slate-100 — maximum legibility */
}
.invoice-detail-action-btn {
border-color: #67e8f9; /* cyan-300 — stronger than slate-700 */
color: #f1f5f9;
}
.invoice-detail-disclaimer {
border-color: #475569; /* slate-600 — stronger than slate-800 */
background-color: #0f172a; /* slate-900 — fully opaque */
color: #cbd5e1; /* slate-300 — stronger than slate-300 */
}
/* Wallet components */
.wallet-address-text {
color: #f1f5f9; /* slate-100 */
}
.wallet-balance-text,
.wallet-helper-text {
color: #cbd5e1; /* slate-300 */
}
.wallet-skeleton-text-primary,
.wallet-skeleton-btn {
background-color: #475569; /* slate-600 */
}
.wallet-skeleton-text-secondary {
background-color: #334155; /* slate-700 */
}
}
/* ── Print stylesheet ──────────────────────────────────────────────────────── */
/*
Renders the invoice detail page as a clean, ink-friendly document.
- Hides interactive chrome: nav header, wallet button, back link, fund button,
disclaimer note, and the on-screen print button.
- Forces a white background and dark text to save ink.
- Marks elements with .no-print to opt out of the printed output.
*/
/* ── Density spacing tokens ─────────────────────────────────────────────────── */
/*
Density is driven by a `data-density` attribute set on <html> by the
DensityToggle component via the useDensity hook.
Supported values: data-density="comfortable" | data-density="compact"
Settings page reads these variables to control section padding, gap,
and heading margins.
*/
:root,
[data-density="comfortable"] {
--settings-section-padding: 1.5rem;
--settings-section-gap: 1.5rem;
--settings-list-gap: 0.75rem;
/* Wallet view density tokens */
--wallet-panel-padding: 1rem;
--wallet-panel-gap: 0.75rem;
--wallet-meta-font-size: 0.75rem;
--wallet-address-font-size: 0.875rem;
}
[data-density="compact"] {
--settings-section-padding: 1rem;
--settings-section-gap: 1rem;
--settings-list-gap: 0.5rem;
/* Wallet view density tokens */
--wallet-panel-padding: 0.5rem;
--wallet-panel-gap: 0.375rem;
--wallet-meta-font-size: 0.6875rem;
--wallet-address-font-size: 0.75rem;
}
@media print {
/* Switch to a light, ink-friendly palette */
html,
body {
background: #ffffff !important;
color: #0f172a !important;
}
/* Hide interactive/navigation chrome */
.no-print {
display: none !important;
}
/* Ensure invoice summary section prints with visible borders */
.print-invoice-section {
border: 1px solid #cbd5e1 !important;
background: #ffffff !important;
color: #0f172a !important;
border-radius: 0.5rem;
padding: 1.5rem;
}
/* Definition list terms and values */
.print-invoice-section dt {
color: #64748b !important;
}
.print-invoice-section dd {
color: #0f172a !important;
}
/* Remove decorative backgrounds from the page wrapper */
.print-page-wrapper {
background: #ffffff !important;
color: #0f172a !important;
}
}