Skip to content
Source
Sign inSign up
fuko/trytanstackdb.com
Open History to see the last commit

styles.css

439 lines13.2 KB

1@import "tailwindcss";
2@import "tw-animate-css";
3@import "@fontsource-variable/inter";
4​
5@custom-variant dark (&:is(.dark *));
6​
7/* The shadcn "nova" components use state variants; map them to Radix's data-state attributes. */
8@custom-variant data-open (&:is([data-state="open"], [data-open]:not([data-open="false"])));
9@custom-variant data-closed (&:is([data-state="closed"], [data-closed]:not([data-closed="false"])));
10@custom-variant data-checked (&:is([data-state="checked"], [data-checked]:not([data-checked="false"])));
11@custom-variant data-unchecked (&:is([data-state="unchecked"], [data-unchecked]:not([data-unchecked="false"])));
12@custom-variant data-horizontal (&:is([data-orientation="horizontal"]));
13@custom-variant data-vertical (&:is([data-orientation="vertical"]));
14​
15/* -------------------------------------------------------------------------- */
16/* shadcn/ui tokens */
17/* -------------------------------------------------------------------------- */
18​
19:root {
20 --radius: 0.625rem;
21 --background: oklch(1 0 0);
22 --foreground: oklch(0.145 0 0);
23 --card: oklch(1 0 0);
24 --card-foreground: oklch(0.145 0 0);
25 --popover: oklch(1 0 0);
26 --popover-foreground: oklch(0.145 0 0);
27 --primary: oklch(0.205 0 0);
28 --primary-foreground: oklch(0.985 0 0);
29 --secondary: oklch(0.97 0 0);
30 --secondary-foreground: oklch(0.205 0 0);
31 --muted: oklch(0.97 0 0);
32 --muted-foreground: oklch(0.556 0 0);
33 --accent: oklch(0.97 0 0);
34 --accent-foreground: oklch(0.205 0 0);
35 --destructive: oklch(0.577 0.245 27.325);
36 --border: oklch(0.922 0 0);
37 --input: oklch(0.922 0 0);
38 --ring: oklch(0.708 0 0);
39​
40 /* Guide accent (TanStack DB orange) */
41 --guide-accent: oklch(0.7 0.18 50);
42 --guide-accent-soft: oklch(0.97 0.03 60);
43​
44 /* Fake browser chrome */
45 --browser-frame: #e8e8ea;
46 --browser-toolbar: #f7f7f8;
47 --browser-tab: #ffffff;
48 --browser-field: #ececee;
49​
50 /* Apple Notes — macOS (sampled from reference screenshots) */
51 --mac-sidebar: #f2f2f2;
52 --mac-content: #ffffff;
53 --mac-toolbar: #f6f6f6;
54 --mac-text: #1d1d1f;
55 --mac-text-secondary: #8a8a8e;
56 --mac-folder-selected: #e0e0e0;
57 --mac-row-selected: #dedede;
58 --mac-separator: #e5e5e5;
59 --mac-column-border: #e6e6e6;
60 --mac-control: #f6f6f6;
61 --mac-control-border: #e3e3e3;
62 --mac-icon: #6e6e73;
63​
64 /* Apple Notes — iOS 26 */
65 --ios-bg: #f2f2f7;
66 --ios-card: #ffffff;
67 --ios-plain: #ffffff;
68 --ios-text: #000000;
69 --ios-secondary: #8e8e93;
70 --ios-separator: #c6c6c8;
71 --ios-glass: rgb(255 255 255 / 0.72);
72 --ios-glass-border: rgb(0 0 0 / 0.06);
73​
74 /* Shared Notes accent */
75 --notes-accent: #e5b400;
76 --notes-quick: #f2c94c;
77 --notes-shared: #5ac8fa;
79​
80.dark {
81 --background: oklch(0.17 0 0);
82 --foreground: oklch(0.985 0 0);
83 --card: oklch(0.205 0 0);
84 --card-foreground: oklch(0.985 0 0);
85 --popover: oklch(0.205 0 0);
86 --popover-foreground: oklch(0.985 0 0);
87 --primary: oklch(0.922 0 0);
88 --primary-foreground: oklch(0.205 0 0);
89 --secondary: oklch(0.269 0 0);
90 --secondary-foreground: oklch(0.985 0 0);
91 --muted: oklch(0.269 0 0);
92 --muted-foreground: oklch(0.708 0 0);
93 --accent: oklch(0.269 0 0);
94 --accent-foreground: oklch(0.985 0 0);
95 --destructive: oklch(0.704 0.191 22.216);
96 --border: oklch(1 0 0 / 10%);
97 --input: oklch(1 0 0 / 15%);
98 --ring: oklch(0.556 0 0);
99​
100 --guide-accent: oklch(0.75 0.17 55);
101 --guide-accent-soft: oklch(0.26 0.04 55);
102​
103 --browser-frame: #1a1a1c;
104 --browser-toolbar: #2a2a2c;
105 --browser-tab: #2a2a2c;
106 --browser-field: #1e1e20;
107​
108 --mac-sidebar: #242424;
109 --mac-content: #1e1e1e;
110 --mac-toolbar: #2b2b2b;
111 --mac-text: #e8e8e8;
112 --mac-text-secondary: #9a9a9a;
113 --mac-folder-selected: #393939;
114 --mac-row-selected: #454545;
115 --mac-separator: #333333;
116 --mac-column-border: #2f2f2f;
117 --mac-control: #2b2b2b;
118 --mac-control-border: #383838;
119 --mac-icon: #a8a8ad;
120​
121 --ios-bg: #000000;
122 --ios-card: #1c1c1e;
123 --ios-plain: #000000;
124 --ios-text: #ffffff;
125 --ios-secondary: #8e8e93;
126 --ios-separator: #38383a;
127 --ios-glass: rgb(40 40 42 / 0.72);
128 --ios-glass-border: rgb(255 255 255 / 0.08);
129​
130 --notes-accent: #e6b32e;
132​
133@theme inline {
134 --font-sans:
135 "Inter Variable", -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, sans-serif;
136 --font-mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;
137​
138 --radius-sm: calc(var(--radius) - 4px);
139 --radius-md: calc(var(--radius) - 2px);
140 --radius-lg: var(--radius);
141 --radius-xl: calc(var(--radius) + 4px);
142​
143 --color-background: var(--background);
144 --color-foreground: var(--foreground);
145 --color-card: var(--card);
146 --color-card-foreground: var(--card-foreground);
147 --color-popover: var(--popover);
148 --color-popover-foreground: var(--popover-foreground);
149 --color-primary: var(--primary);
150 --color-primary-foreground: var(--primary-foreground);
151 --color-secondary: var(--secondary);
152 --color-secondary-foreground: var(--secondary-foreground);
153 --color-muted: var(--muted);
154 --color-muted-foreground: var(--muted-foreground);
155 --color-accent: var(--accent);
156 --color-accent-foreground: var(--accent-foreground);
157 --color-destructive: var(--destructive);
158 --color-border: var(--border);
159 --color-input: var(--input);
160 --color-ring: var(--ring);
161​
162 --color-guide-accent: var(--guide-accent);
163 --color-guide-accent-soft: var(--guide-accent-soft);
164​
165 --color-browser-frame: var(--browser-frame);
166 --color-browser-toolbar: var(--browser-toolbar);
167 --color-browser-tab: var(--browser-tab);
168 --color-browser-field: var(--browser-field);
169​
170 --color-mac-sidebar: var(--mac-sidebar);
171 --color-mac-content: var(--mac-content);
172 --color-mac-toolbar: var(--mac-toolbar);
173 --color-mac-text: var(--mac-text);
174 --color-mac-text-secondary: var(--mac-text-secondary);
175 --color-mac-folder-selected: var(--mac-folder-selected);
176 --color-mac-row-selected: var(--mac-row-selected);
177 --color-mac-separator: var(--mac-separator);
178 --color-mac-column-border: var(--mac-column-border);
179 --color-mac-control: var(--mac-control);
180 --color-mac-control-border: var(--mac-control-border);
181 --color-mac-icon: var(--mac-icon);
182​
183 --color-ios-bg: var(--ios-bg);
184 --color-ios-card: var(--ios-card);
185 --color-ios-plain: var(--ios-plain);
186 --color-ios-text: var(--ios-text);
187 --color-ios-secondary: var(--ios-secondary);
188 --color-ios-separator: var(--ios-separator);
189 --color-ios-glass: var(--ios-glass);
190 --color-ios-glass-border: var(--ios-glass-border);
191​
192 --color-notes-accent: var(--notes-accent);
193 --color-notes-quick: var(--notes-quick);
194 --color-notes-shared: var(--notes-shared);
196​
197@layer base {
198 * {
199 @apply border-border outline-ring/50;
200 }
201​
202 html,
203 body {
204 height: 100%;
205 }
206​
207 body {
208 @apply bg-background font-sans text-foreground antialiased;
209 margin: 0;
210 }
212​
213/* -------------------------------------------------------------------------- */
214/* Code highlighting (sugar-high) */
215/* -------------------------------------------------------------------------- */
216​
217:root {
218 --sh-class: #8250df;
219 --sh-identifier: #24292f;
220 --sh-sign: #57606a;
221 --sh-property: #0550ae;
222 --sh-entity: #8250df;
223 --sh-jsxliterals: #24292f;
224 --sh-string: #0a3069;
225 --sh-keyword: #cf222e;
226 --sh-comment: #6e7781;
228​
229.dark {
230 --sh-class: #d2a8ff;
231 --sh-identifier: #e6edf3;
232 --sh-sign: #8b949e;
233 --sh-property: #79c0ff;
234 --sh-entity: #d2a8ff;
235 --sh-jsxliterals: #e6edf3;
236 --sh-string: #a5d6ff;
237 --sh-keyword: #ff7b72;
238 --sh-comment: #8b949e;
240​
241/* -------------------------------------------------------------------------- */
242/* Bottom sheet (the app on small screens) */
243/* -------------------------------------------------------------------------- */
244​
245:root {
246 /* Open: ~450ms with a hint of overshoot, like a spring settling. Close: a bit faster. */
247 --sheet-open-duration: 450ms;
248 --sheet-open-easing: cubic-bezier(0.22, 1.15, 0.36, 1);
249 --sheet-close-duration: 320ms;
250 --sheet-close-easing: cubic-bezier(0.32, 0.72, 0, 1);
251 --sheet-fade-duration: 200ms;
253​
254@layer components {
255 .bottom-sheet {
256 transform: translate3d(0, calc(100% + 2rem), 0);
257 visibility: hidden;
258 transition:
259 transform var(--sheet-close-duration) var(--sheet-close-easing),
260 visibility 0s linear var(--sheet-close-duration);
261 }
262 .bottom-sheet[data-state="open"] {
263 transform: none;
264 visibility: visible;
265 transition:
266 transform var(--sheet-open-duration) var(--sheet-open-easing),
267 visibility 0s;
268 }
269​
270 .bottom-sheet-backdrop {
271 opacity: 0;
272 pointer-events: none;
273 transition: opacity var(--sheet-close-duration) ease-out;
274 }
275 .bottom-sheet-backdrop[data-state="open"] {
276 opacity: 1;
277 pointer-events: auto;
278 transition-duration: var(--sheet-open-duration);
279 }
280​
281 /* Reduced motion: fade in place instead of sliding. */
282 @media (prefers-reduced-motion: reduce) {
283 .bottom-sheet,
284 .bottom-sheet[data-state="open"] {
285 transform: none;
286 }
287 .bottom-sheet {
288 opacity: 0;
289 transition:
290 opacity var(--sheet-fade-duration) ease-out,
291 visibility 0s linear var(--sheet-fade-duration);
292 }
293 .bottom-sheet[data-state="open"] {
294 opacity: 1;
295 transition:
296 opacity var(--sheet-fade-duration) ease-out,
297 visibility 0s;
298 }
299 .bottom-sheet-backdrop,
300 .bottom-sheet-backdrop[data-state="open"] {
301 transition-duration: var(--sheet-fade-duration);
302 }
303 }
305​
306/* -------------------------------------------------------------------------- */
307/* Guide code blocks on small screens */
308/* -------------------------------------------------------------------------- */
309​
310/*
311 * In the small-screen guide ([data-wrap-code]) long lines soft-wrap instead of
312 * scrolling sideways, and each continuation hangs two characters past its
313 * line's own indentation (`--indent`, set per line by `withLineIndents`).
314 * Unlayered on purpose, so it overrides the block's utility classes.
315 */
316/* No hover on phones: keep the Copy button visible. */
317[data-wrap-code] .code-block-copy {
318 opacity: 1;
320[data-wrap-code] .code-block-pre {
321 padding-inline: 0.875rem;
322 font-size: 12px;
324[data-wrap-code] .code-block-pre code {
325 display: block;
326 /* The newlines between line blocks are just markup now. */
327 white-space: normal;
329[data-wrap-code] .code-block-pre .sh__line {
330 --hang: calc(var(--indent, 0ch) + 2ch);
331 display: block;
332 min-height: 1lh;
333 padding-left: var(--hang);
334 text-indent: calc(-1 * var(--hang));
335 white-space: pre-wrap;
336 overflow-wrap: anywhere;
338​
339/* Apple-style hairline scrollbars inside the fake app */
340.notes-scroll {
341 scrollbar-width: thin;
342 scrollbar-color: color-mix(in srgb, currentColor 22%, transparent) transparent;
344​
345/* -------------------------------------------------------------------------- */
346/* Guide typography */
347/* -------------------------------------------------------------------------- */
348​
349@layer components {
350 .guide-prose {
351 @apply text-[15px] leading-7 text-foreground/85;
352 }
353 .guide-prose > p + p {
354 @apply mt-3;
355 }
356 .guide-prose h3 {
357 @apply mt-6 mb-2 text-base font-semibold text-foreground;
358 }
359 .guide-prose ul {
360 @apply my-3 list-disc space-y-1 pl-5 marker:text-muted-foreground;
361 }
362 .guide-prose ol {
363 @apply my-3 list-decimal space-y-1 pl-5 marker:text-muted-foreground;
364 }
365 .guide-prose :not(pre) > code {
366 @apply rounded-md bg-muted px-1.5 py-0.5 font-mono text-[0.85em] text-foreground;
367 }
368 .guide-prose a {
369 @apply font-medium text-foreground underline decoration-guide-accent/60 underline-offset-4 hover:decoration-guide-accent;
370 }
371 .guide-prose strong {
372 @apply font-semibold text-foreground;
373 }
375​
376/* -------------------------------------------------------------------------- */
377/* Spotlight (the guide pointing at part of the app) */
378/* -------------------------------------------------------------------------- */
379​
380@layer components {
381 /* A ring around the target; its huge spread dims everything else. */
382 .spotlight-ring {
383 box-shadow:
384 0 0 0 3px var(--guide-accent),
385 0 0 0 9999px rgb(0 0 0 / 0.3);
386 }
387 .dark .spotlight-ring {
388 box-shadow:
389 0 0 0 3px var(--guide-accent),
390 0 0 0 9999px rgb(0 0 0 / 0.55);
391 }
392​
393 /* Motion only when the reader is fine with it: fade in, then pulse three times. */
394 @media (prefers-reduced-motion: no-preference) {
395 .spotlight-ring {
396 animation: spotlight-in 220ms ease-out;
397 }
398 .spotlight-ring::after {
399 content: "";
400 position: absolute;
401 inset: -3px;
402 border-radius: inherit;
403 border: 3px solid var(--guide-accent);
404 animation: spotlight-pulse 1.2s ease-out 220ms 3 both;
405 }
406 .spotlight-label {
407 animation: spotlight-in 220ms ease-out;
408 }
409 }
411​
412@keyframes spotlight-in {
413 from {
414 opacity: 0;
415 }
417​
418@keyframes spotlight-pulse {
419 from {
420 opacity: 0.9;
421 transform: scale(1);
422 }
423 to {
424 opacity: 0;
425 transform: scale(1.04);
426 }
428​
429/* -------------------------------------------------------------------------- */
430/* Charts (TanStack Charts inherits `color`; bars use its palette tokens) */
431/* -------------------------------------------------------------------------- */
432​
433.analytics-chart {
434 /* A darker Notes yellow in light mode, so bars keep 3:1 contrast on white. */
435 --ts-chart-1: #b58900;
437.dark .analytics-chart {
438 --ts-chart-1: var(--notes-accent);