xonecas.io
8058
Ir

irvc / files

irvc / web / src / index.css

8.1 KB
1@import "tailwindcss";
2
3/* ─────────────────────────────────────────────────────────────────────────
4   Semantic design tokens.
5
6   Everything in the UI is expressed in terms of these roles, never raw
7   colors. Palettes (below) and per-user overrides both just set these
8   variables, so a component written once re-themes for free.
9   ───────────────────────────────────────────────────────────────────────── */
10
11@theme inline {
12  --font-sans: ui-monospace, SFMono-Regular, Menlo, Consolas, "DejaVu Sans Mono", monospace;
13
14  --color-bg: var(--bg);
15  --color-surface: var(--surface);
16  --color-raised: var(--raised);
17  --color-fg: var(--fg);
18  --color-muted: var(--muted);
19  --color-faint: var(--faint);
20  --color-line: var(--line);
21  --color-accent: var(--accent);
22  --color-accent-fg: var(--accent-fg);
23  --color-danger: var(--danger);
24  --color-scrim: var(--scrim);
25}
26
27/* ── palettes ──────────────────────────────────────────────────────────── */
28
29/* 80s nicotine: sepia paper, the default. */
30:root {
31  --bg: #f6efe2;
32  --surface: #ece2cf;
33  --raised: #fdfaf3;
34  --fg: #4a3418;
35  --muted: #8a6f4a;
36  --faint: #b3a086;
37  --line: #ddceb4;
38  --accent: #a9791f;
39  --accent-fg: #fdfaf3;
40  --danger: #b4432f;
41  --scrim: rgb(20 12 4 / 0.5);
42}
43
44.dark {
45  --bg: #0b0906;
46  --surface: #100c08;
47  --raised: #1a130c;
48  --fg: #d8b98f;
49  --muted: #9c7d57;
50  --faint: #6d583c;
51  --line: #2a2016;
52  --accent: #ffcc55;
53  --accent-fg: #171109;
54  --danger: #e0715a;
55  --scrim: rgb(0 0 0 / 0.6);
56}
57
58/* tuxedo: pure grayscale. */
59[data-preset="tuxedo"] {
60  --bg: #ffffff;
61  --surface: #f1f1f1;
62  --raised: #ffffff;
63  --fg: #141414;
64  --muted: #666666;
65  --faint: #a0a0a0;
66  --line: #dcdcdc;
67  --accent: #333333;
68  --accent-fg: #ffffff;
69  --danger: #b3261e;
70  --scrim: rgb(0 0 0 / 0.4);
71}
72
73.dark[data-preset="tuxedo"] {
74  --bg: #000000;
75  --surface: #0b0b0b;
76  --raised: #161616;
77  --fg: #e8e8e8;
78  --muted: #9a9a9a;
79  --faint: #6b6b6b;
80  --line: #272727;
81  --accent: #d4d4d4;
82  --accent-fg: #0a0a0a;
83  --danger: #e07a6a;
84  --scrim: rgb(0 0 0 / 0.65);
85}
86
87/* ── base ──────────────────────────────────────────────────────────────── */
88
89@layer base {
90  html {
91    height: 100%;
92    font-family: var(--font-sans);
93    background: var(--bg);
94    color-scheme: light;
95  }
96  html.dark {
97    color-scheme: dark;
98  }
99  body {
100    height: 100%;
101    margin: 0;
102    background: var(--bg);
103    color: var(--fg);
104    overscroll-behavior: none;
105    -webkit-font-smoothing: antialiased;
106  }
107  #root {
108    height: 100%;
109  }
110  button:not(:disabled),
111  [role="button"]:not(:disabled) {
112    cursor: pointer;
113  }
114  :focus-visible {
115    outline: 2px solid var(--accent);
116    outline-offset: 1px;
117  }
118  ::placeholder {
119    color: var(--faint);
120  }
121  ::-webkit-scrollbar {
122    width: 8px;
123    height: 8px;
124  }
125  ::-webkit-scrollbar-thumb {
126    background: color-mix(in srgb, var(--fg) 22%, transparent);
127    border-radius: 4px;
128  }
129  ::-webkit-scrollbar-track {
130    background: transparent;
131  }
132}
133
134/* ── components ──────────────────────────────────────────────────────────
135   The shared vocabulary. Feature code composes these classes (usually via
136   the wrappers in src/ui) instead of inventing its own Tailwind recipes.
137   ───────────────────────────────────────────────────────────────────────── */
138
139@layer components {
140  /* buttons */
141  .btn {
142    @apply inline-flex shrink-0 items-center justify-center gap-1.5 rounded-md border border-transparent px-3 text-sm font-medium whitespace-nowrap select-none transition-colors outline-none disabled:pointer-events-none disabled:opacity-40;
143  }
144  .btn-primary {
145    @apply bg-accent text-accent-fg hover:brightness-110;
146  }
147  .btn-secondary {
148    @apply border-line bg-raised text-fg hover:bg-surface;
149  }
150  .btn-ghost {
151    @apply text-muted hover:bg-raised hover:text-fg;
152  }
153  .btn-danger {
154    @apply text-danger hover:bg-danger/10;
155  }
156  .btn-sm {
157    @apply h-8 px-2.5 text-xs;
158  }
159  .btn-md {
160    @apply h-9;
161  }
162  .btn-lg {
163    @apply h-11 px-4;
164  }
165  .icon-btn {
166    @apply w-9 px-0;
167  }
168  .icon-btn-sm {
169    @apply h-7 w-7 text-xs;
170  }
171  .icon-btn-md {
172    @apply h-9 w-9;
173  }
174  .icon-btn-lg {
175    @apply h-11 w-11;
176  }
177  .btn svg {
178    @apply size-4 shrink-0;
179  }
180
181  /* inputs */
182  .input {
183    @apply w-full rounded-md border border-line bg-raised px-3 text-sm text-fg outline-none transition-colors focus:border-accent;
184  }
185  .input-md {
186    @apply h-9;
187  }
188  .input-lg {
189    @apply h-11 text-base;
190  }
191
192  /* surfaces */
193  .menu {
194    @apply min-w-44 rounded-lg border border-line bg-raised p-1 shadow-xl;
195  }
196  .menu-item {
197    @apply flex w-full items-center gap-2.5 rounded px-2.5 py-2 text-left text-sm text-fg transition-colors hover:bg-surface;
198  }
199  .menu-item-danger {
200    @apply text-danger hover:bg-danger/10;
201  }
202  .divider {
203    @apply my-1 h-px bg-line;
204  }
205
206  /* transient errors, driven by src/lib/toast.ts */
207  .toast {
208    @apply max-w-[min(28rem,100%)] rounded-md border border-danger/40 bg-raised px-3 py-1.5 text-xs break-words text-danger shadow-lg;
209    animation: toast 5s ease-out forwards;
210  }
211
212  /* sidebar rows */
213  .row {
214    @apply flex min-w-0 items-center gap-2 rounded-md px-2 py-2 text-left text-sm text-muted transition-colors hover:bg-raised hover:text-fg;
215  }
216  .row-unread {
217    @apply font-medium text-accent;
218  }
219
220  .badge {
221    @apply inline-flex min-w-5 shrink-0 items-center justify-center rounded-full bg-accent px-1.5 text-[0.7rem] leading-5 font-semibold text-accent-fg;
222  }
223  .chip {
224    @apply inline-flex items-center gap-1 rounded-md border border-line px-1.5 py-1 text-xs leading-none text-muted transition-colors hover:border-accent/60;
225  }
226  .chip-active {
227    @apply border-accent/60 bg-accent/15 text-fg;
228  }
229  .section-label {
230    @apply px-2 text-[0.7rem] font-medium tracking-[0.14em] text-faint uppercase;
231  }
232
233  /* markdown */
234  .md {
235    @apply text-sm leading-6 break-words;
236  }
237  .md > :first-child {
238    margin-top: 0;
239  }
240  .md > :last-child {
241    margin-bottom: 0;
242  }
243  .md p {
244    margin: 0 0 0.5rem;
245  }
246  .md a {
247    @apply text-accent underline underline-offset-2;
248  }
249  .md strong {
250    @apply font-semibold text-fg;
251  }
252  .md em {
253    @apply text-fg;
254  }
255  .md del {
256    @apply text-faint;
257  }
258  .md ul,
259  .md ol {
260    margin: 0 0 0.5rem;
261    padding-left: 1.4rem;
262  }
263  .md ul {
264    list-style: disc;
265  }
266  .md ol {
267    list-style: decimal;
268  }
269  .md li {
270    margin: 0.1rem 0;
271  }
272  .md blockquote {
273    margin: 0.4rem 0;
274    border-left: 3px solid color-mix(in srgb, var(--accent) 55%, transparent);
275    padding-left: 0.75rem;
276    color: var(--muted);
277  }
278  .md code {
279    @apply rounded border border-line bg-surface px-1 py-px text-[0.85em];
280  }
281  .md pre {
282    @apply my-2 overflow-x-auto rounded-md border border-line bg-surface p-3;
283  }
284  .md pre code {
285    @apply border-0 bg-transparent p-0;
286  }
287  .md hr {
288    @apply my-3 border-line;
289  }
290  .md table {
291    @apply my-2 border-collapse text-[0.9em];
292  }
293  .md th,
294  .md td {
295    @apply border border-line px-2 py-1 text-left;
296  }
297  .md img,
298  .md video {
299    @apply my-1 max-h-80 max-w-full rounded-md border border-line;
300  }
301}
302
303@utility scroll-none {
304  scrollbar-width: none;
305  &::-webkit-scrollbar {
306    display: none;
307  }
308}
309
310/* Fade in, hold, fade out, so a toast is gone before toast.ts drops it at 5s. */
311@keyframes toast {
312  0% {
313    opacity: 0;
314    transform: translateY(4px);
315  }
316  3%,
317  90% {
318    opacity: 1;
319    transform: translateY(0);
320  }
321  100% {
322    opacity: 0;
323  }
324}