Debian Codegraph @

www/src/assets/css/site.css

raw symbols SCIP
1 @layer reset, base, components, utilities;
2
3 @import "./reset.css" layer(reset);
4
5 /* ─── Local fonts ──────────────────────────────────────────────────────── */
6 @font-face {
7 font-family: 'ChicagoFLF';
8 src: url('/fonts/ChicagoFLF.ttf') format('truetype');
9 }
10
11 /* ─── Tokens ─────── */
12 :root {
13 color-scheme: light dark;
14
15 /* Body */
16 --font-sans: 'Inter Variable', 'Inter', sans-serif;
17 /* Headings & Buttons */
18 --font-chicago: 'ChicagoFLF', sans-serif;
19 /* Code */
20 --font-mono: 'JetBrains Mono Variable', 'JetBrains Mono', 'Menlo', 'Monaco', 'Courier New', monospace;
21
22 /* Gray tones
23
24 Text colors:
25 Primary (titles, body): neutral-700 / dark:neutral-300
26 Secondary (descriptions, labels, footer, breadcrumbs): neutral-600 / dark:neutral-400
27 Interact/hover: text-black / dark:text-white (max contrast)
28 Disabled: neutral-300 / dark:neutral-700
29 (exceptions exist when bg differs, e.g. FinderLink inverts text on colored bg)
30
31 Backgrounds:
32 Page: neutral-25 / dark:neutral-920
33 Header/Footer: neutral-10 / dark:neutral-920
34 Cards: neutral-25 / dark:neutral-910
35 Elevated (modals, code): white / dark:neutral-950
36 Hover state: neutral-75 / dark:neutral-875
37
38 Borders:
39 Primary: neutral-200 / dark:neutral-850
40 Hover: neutral-300 / dark:neutral-600
41
42 Links:
43 Default: blue-700 / dark:blue-350
44 Hover: blue-700 / dark:blue-300 */
45 --color-neutral-10: oklch(99.8% 0 0);
46 --color-neutral-25: oklch(99.5% 0 0);
47 --color-neutral-50: oklch(98.5% 0 0);
48 --color-neutral-75: oklch(97.8% 0 0);
49 --color-neutral-100: oklch(97% 0 0);
50 --color-neutral-150: oklch(95.6% 0 0);
51 --color-neutral-200: oklch(92.2% 0 0);
52 --color-neutral-300: oklch(87% 0 0);
53 --color-neutral-350: oklch(80.9% 0 0);
54 --color-neutral-400: oklch(70.8% 0 0);
55 --color-neutral-450: oklch(62.9% 0 0);
56 --color-neutral-500: oklch(55.6% 0 0);
57 --color-neutral-550: oklch(49.7% 0 0);
58 --color-neutral-600: oklch(43.9% 0 0);
59 --color-neutral-650: oklch(40.5% 0 0);
60 --color-neutral-700: oklch(37.1% 0 0);
61 --color-neutral-750: oklch(32.0% 0 0);
62 --color-neutral-800: oklch(26.9% 0 0);
63 --color-neutral-850: oklch(23.7% 0 0);
64 --color-neutral-875: oklch(22.1% 0 0);
65 --color-neutral-900: oklch(20.5% 0 0);
66 --color-neutral-910: oklch(19.3% 0 0);
67 --color-neutral-920: oklch(18.1% 0 0); /* primary dark mode background */
68 --color-neutral-930: oklch(16.9% 0 0);
69 --color-neutral-940: oklch(15.7% 0 0);
70 --color-neutral-950: oklch(14.5% 0 0);
71
72 /* Blue that matches htmx logo */
73 --color-blue-50: oklch(0.9714 0.0108 256.69);
74 --color-blue-100: oklch(0.9375 0.0235 250.08);
75 --color-blue-200: oklch(0.8908 0.043 249.39);
76 --color-blue-300: oklch(0.8196 0.0739 247.52);
77 --color-blue-350: oklch(0.7729 0.0925 249.30);
78 --color-blue-400: oklch(0.7262 0.111 251.08);
79 --color-blue-500: oklch(0.6393 0.1445 257.27);
80 --color-blue-600: oklch(0.5693 0.1653 261.81); /* htmx brand blue */
81 --color-blue-700: oklch(0.505 0.1698 264.24);
82 --color-blue-800: oklch(0.4421 0.1412 265.64);
83 --color-blue-900: oklch(0.3934 0.1075 265.08);
84 --color-blue-950: oklch(0.2936 0.068 267.21);
85
86 --radius-xs: 0.125rem;
87 --radius-sm: 0.25rem;
88 --radius-md: 0.375rem;
89 --radius-lg: 0.625rem; /* override of Tailwind default 0.5rem */
90 --radius-xl: 0.75rem;
91 --radius-full: 9999px;
92
93 --tracking-tightest: -0.075em;
94 --tracking-tight: -0.025em;
95
96 /* ─── Layout ─────────────────────────────────────────────────────── */
97 --navigation-bar-height: 56px;
98 @media (width >= 64rem) {
99 --navigation-bar-height: 76px;
100 }
101 --header-height: var(--navigation-bar-height);
102 --construction-banner-height: 40px;
103
104 /* ─── Shiki (was in input.css base layer; light-dark()-ified) ────── */
105 --astro-code-foreground: light-dark(#1a1a1a, var(--color-neutral-350));
106 --astro-code-background: light-dark(white, var(--color-neutral-930));
107 --astro-code-token-string-expression: #bca26c; /* HTML tags (yellow) */
108 --astro-code-token-function: light-dark(#5a5a5a, var(--color-neutral-350)); /* HTML attrs */
109 --astro-code-token-keyword: #6aab73; /* attribute = */
110 --astro-code-token-string: #6aab73; /* attribute values */
111 --astro-code-token-constant: #ce8e6d; /* function, async, export */
112 --astro-code-token-parameter: #57a8f5; /* functions/methods */
113 --astro-code-token-punctuation: #c87dbb; /* properties */
114 --astro-code-token-comment: #808080;
115 --astro-code-token-link: #57a8f5;
116 }
117
118 /* ─── Base ─────────────────────────────────────────────────────────────── */
119 @layer base {
120 body {
121 overflow-x: hidden;
122 color: light-dark(var(--color-neutral-700), var(--color-neutral-300));
123 background-color: light-dark(var(--color-neutral-25), var(--color-neutral-920));
124 }
125
126 button, a, [role="button"] {
127 touch-action: manipulation;
128 }
129
130 h1, h2, h3, h4, h5, h6 {
131 font-family: var(--font-chicago), serif;
132 letter-spacing: var(--tracking-tightest);
133 @media (width >= 40rem) {
134 letter-spacing: var(--tracking-tight);
135 }
136 }
137
138 a, a * {
139 text-decoration-thickness: 0.125em;
140 text-underline-offset: 0.25em;
141 }
142 }
143
144 /* ─── Components ───────────────────────────────────────────────────────── */
145 @layer components {
146 /* Card — neutral background, thin border, rounded corners.
147 Variants tweak corner radius: .xs / .sm / .lg / .xl (default = md). */
148 .card {
149 background: light-dark(var(--color-neutral-25), var(--color-neutral-910));
150 border: 1px solid light-dark(var(--color-neutral-200), var(--color-neutral-800));
151 border-radius: var(--radius-md);
152
153 &.xs {
154 border-radius: var(--radius-xs);
155 }
156
157 &.sm {
158 border-radius: var(--radius-sm);
159 }
160
161 &.lg {
162 border-radius: var(--radius-lg);
163 }
164
165 &.xl {
166 border-radius: var(--radius-xl);
167 }
168 }
169
170 /* Demo window chrome — border, title bar with dots + label, content padding.
171 Ported from input.css lines 442–502. @variant dark blocks rewritten as light-dark(). */
172 .demo-container {
173 position: relative;
174 margin-block: 2rem;
175 padding: 1.5rem;
176 padding-top: calc(2rem + 1.5rem); /* title bar + content gutter */
177 border: 1px solid light-dark(var(--color-neutral-200), var(--color-neutral-850));
178 border-radius: var(--radius-lg);
179 background: light-dark(white, var(--color-neutral-930));
180 overflow: hidden;
181
182 /* Title bar */
183
184 &::before {
185 content: 'DEMO';
186 position: absolute;
187 inset: 0 0 auto 0;
188 height: 2rem;
189 display: flex;
190 align-items: center;
191 justify-content: center;
192 font-family: var(--font-sans);
193 font-size: 0.675rem;
194 font-weight: 500;
195 letter-spacing: 0.1em;
196 color: light-dark(
197 var(--color-neutral-500),
198 color-mix(in srgb, var(--color-neutral-500) 80%, transparent)
199 );
200 background: light-dark(var(--color-neutral-50), var(--color-neutral-920));
201 border-bottom: 1px solid light-dark(var(--color-neutral-100), var(--color-neutral-900));
202 }
203
204 /* Traffic-light dots */
205
206 &::after {
207 content: '';
208 position: absolute;
209 top: calc((2rem - 9px) / 2);
210 left: 0.75rem;
211 width: 9px;
212 height: 9px;
213 border-radius: 9999px;
214 background: light-dark(var(--color-neutral-200), var(--color-neutral-800));
215 box-shadow: 15px 0 0 light-dark(var(--color-neutral-200), var(--color-neutral-800)),
216 30px 0 0 light-dark(var(--color-neutral-200), var(--color-neutral-800));
217 }
218 }
219 }
220
221 /* ─── Stretched link (unlayered to override prose table padding) ───────── */
222 table:has(.stretch-link) {
223 border-collapse: separate;
224 border-spacing: 0;
225 }
226
227 tr.stretch-link {
228 position: relative;
229
230 & td {
231 padding-block: 0.75em;
232 }
233
234 & td:first-child {
235 padding-inline-start: 0.75rem;
236 }
237
238 & td:last-child {
239 padding-inline-end: 0.75rem;
240 }
241
242 & td:first-child a {
243 position: static;
244
245 &::after {
246 content: '';
247 position: absolute;
248 inset: 0;
249 }
250 }
251
252 @media (hover: hover) {
253 &:hover td {
254 color: light-dark(var(--color-neutral-900), var(--color-neutral-100));
255 }
256 }
257
258 }
259
260 /* ─── Docs full-page sticky section headers ───────────────────────────── */
261 article.sticky-headers > section > h2 {
262 position: sticky;
263 top: var(--header-height);
264 scroll-margin-top: var(--header-height);
265 z-index: 20;
266 font-size: 1.15em;
267 margin-bottom: 0;
268 background: light-dark(var(--color-neutral-25), var(--color-neutral-920));
269 padding-block: 0.75rem;
270 @media (width >= 40rem) {
271 padding-block: 1rem;
272 }
273 margin-inline: -1rem;
274 padding-inline: 1rem;
275 border-bottom: 1px solid light-dark(var(--color-neutral-200), var(--color-neutral-850));
276 }
277
278 html:has(#construction-banner) article.sticky-headers > section > h2 {
279 top: calc(var(--header-height) + var(--construction-banner-height));
280 scroll-margin-top: calc(var(--header-height) + var(--construction-banner-height));
281 }
282
283 /* Scroll-driven: show bg/border only when stuck.
284 Tracks parent section (not the sticky h2, which never exits the viewport).
285 Uses cover range with absolute offset: fires when section top reaches the sticky threshold. */
286 @supports (animation-timeline: view()) {
287 article.sticky-headers > section {
288 view-timeline: --section block;
289 }
290
291 article.sticky-headers > section > h2 {
292 background: transparent;
293 border-bottom-color: transparent;
294 animation: stick-bg linear both;
295 animation-timeline: --section;
296 animation-range:
297 cover calc(100vh - var(--header-height))
298 cover calc(100vh - var(--header-height) + 1px);
299 }
300
301 html:has(#construction-banner) article.sticky-headers > section > h2 {
302 animation-range:
303 cover calc(100vh - var(--header-height) - var(--construction-banner-height))
304 cover calc(100vh - var(--header-height) - var(--construction-banner-height) + 1px);
305 }
306
307 @keyframes stick-bg {
308 to {
309 background: light-dark(var(--color-neutral-25), var(--color-neutral-920));
310 border-bottom-color: light-dark(var(--color-neutral-200), var(--color-neutral-850));
311 }
312 }
313 }
314
315 /* ─── Utilities ────────────────────────────────────────────────────────── */
316 @layer utilities {
317 /* `interact` semantic — apply per-element inside scoped <style> blocks:
318
319 .btn {
320 color: var(--color-blue-700);
321 &:focus-visible, &:active { color: var(--color-blue-600); }
322 @media (hover: hover) { &:hover { color: var(--color-blue-600); } }
323 }
324
325 No global helper class — replicating the Tailwind variant in vanilla CSS
326 would need a preprocessor. Document the pattern, keep it manual. */
327 /* Scan lines mask. Dark-mode shifts the gradient stop (light-dark() takes
328 colors only, so swap via custom property + @media). */
329 .scan-lines {
330 --scan-stop: 12.5%;
331 mask-size: 100% max(1.5px, 0.02em);
332 mask-image: linear-gradient(to bottom, transparent 0%, black var(--scan-stop));
333 }
334
335 @media (prefers-color-scheme: dark) {
336 .scan-lines {
337 --scan-stop: 17.5%;
338 }
339 }
340
341 /* 3D drop shadow (block).
342 Parameterize via inline style:
343 <div class="shadow-3d" style="--shadow-color: var(--color-blue-900)"></div>
344 Optional --shadow-depth (any <length>, default 0.375cqh). */
345 .shadow-3d {
346 box-shadow: 0 calc(var(--shadow-depth, 0.375cqh) / 2) 0 color-mix(in srgb, var(--shadow-color) 95%, white),
347 0 var(--shadow-depth, 0.375cqh) 0 color-mix(in srgb, var(--shadow-color) 95%, black);
348 }
349
350 /* 3D drop shadow (text). Parameterize identically via --shadow-color. */
351 .text-shadow-3d {
352 text-shadow: 0 2px 0 color-mix(in srgb, var(--shadow-color) 95%, white),
353 0 4px 0 color-mix(in srgb, var(--shadow-color) 95%, black);
354 }
355
356 /* Subtle scrollbar. */
357 .scrollbar-subtle {
358 scrollbar-width: thin;
359 scrollbar-color: light-dark(var(--color-neutral-300), var(--color-neutral-700)) transparent;
360
361 &::-webkit-scrollbar {
362 width: 6px;
363 }
364
365 &::-webkit-scrollbar-track {
366 background: transparent;
367 }
368
369 &::-webkit-scrollbar-thumb {
370 background: light-dark(var(--color-neutral-300), var(--color-neutral-700));
371 border-radius: 3px;
372
373 &:hover {
374 background: light-dark(var(--color-neutral-400), var(--color-neutral-600));
375 }
376 }
377 }
378
379 /* Screen-reader only. */
380 .sr-only {
381 position: absolute;
382 width: 1px;
383 height: 1px;
384 padding: 0;
385 margin: -1px;
386 overflow: hidden;
387 clip: rect(0, 0, 0, 0);
388 white-space: nowrap;
389 border-width: 0;
390 }
391 }