css-tags 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (63) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +875 -0
  3. package/carousel.js +86 -0
  4. package/components/accessibility.css +51 -0
  5. package/components/actions.css +76 -0
  6. package/components/alert.css +122 -0
  7. package/components/application-patterns.css +122 -0
  8. package/components/badge.css +125 -0
  9. package/components/box-extra.css +220 -0
  10. package/components/box.css +75 -0
  11. package/components/card.css +130 -0
  12. package/components/carousel.css +76 -0
  13. package/components/chip.css +71 -0
  14. package/components/container.css +55 -0
  15. package/components/content-patterns.css +234 -0
  16. package/components/disclosure.css +581 -0
  17. package/components/divider.css +68 -0
  18. package/components/flex.css +59 -0
  19. package/components/form-patterns.css +273 -0
  20. package/components/form.css +130 -0
  21. package/components/grid.css +82 -0
  22. package/components/identity.css +59 -0
  23. package/components/img-container.css +141 -0
  24. package/components/img-container.js +75 -0
  25. package/components/list.css +69 -0
  26. package/components/loading.css +112 -0
  27. package/components/masonry.css +48 -0
  28. package/components/modal.css +73 -0
  29. package/components/navigation-patterns.css +245 -0
  30. package/components/navigation.css +200 -0
  31. package/components/popover.css +49 -0
  32. package/components/site-shell.css +180 -0
  33. package/components/status.css +110 -0
  34. package/components/table.css +98 -0
  35. package/components/tabs.css +103 -0
  36. package/components/tooltip.css +87 -0
  37. package/components/tooltips.css +73 -0
  38. package/components/view-transition.css +73 -0
  39. package/core/base.css +62 -0
  40. package/core/defaults.css +490 -0
  41. package/core/engine.css +32 -0
  42. package/core/mixins.css +376 -0
  43. package/core/palette-accent.css +8 -0
  44. package/core/palette-base.css +107 -0
  45. package/core/palette-extended.css +142 -0
  46. package/core/palette-feedback.css +62 -0
  47. package/core/palette.css +7 -0
  48. package/core/reset.css +270 -0
  49. package/core/text.css +171 -0
  50. package/core/theme.css +608 -0
  51. package/core/tokens.css +488 -0
  52. package/core/typography.css +327 -0
  53. package/index.css +66 -0
  54. package/layouts/layout-extra.css +204 -0
  55. package/layouts/layout-extras-helpers.css +19 -0
  56. package/layouts/layout.css +348 -0
  57. package/package.json +66 -0
  58. package/theme-generator.css +979 -0
  59. package/themes/example-brand.css +59 -0
  60. package/themes/theme-packs.css +31 -0
  61. package/types/css-tags.d.ts +482 -0
  62. package/utilities/utilities.css +564 -0
  63. package/view-transition.js +111 -0
@@ -0,0 +1,979 @@
1
+ /**
2
+ * Universal UI Color Theme Generator
3
+ * ==================================
4
+ *
5
+ * A standalone CSS file that generates complete color schemes using OKLCH.
6
+ * Can be used independently or integrated with the main framework.
7
+ *
8
+ * Features:
9
+ * - OKLCH color space for perceptually uniform colors
10
+ * - Auto-contrast text calculation (Lea Verou method)
11
+ * - Comprehensive color roles for UI components
12
+ * - Light/dark mode and high contrast support
13
+ * - Tailwind CSS integration
14
+ * - Utility classes for easy application
15
+ *
16
+ * Based on: https://lea.verou.me/blog/2024/contrast-color/
17
+ * Inspired by: https://meodai.github.io/rampensau/
18
+ */
19
+
20
+ @import url("core/tokens.css") layer(tokens); /* Optional: import existing tokens */
21
+
22
+ :root {
23
+ /* ============================================ */
24
+ /* INPUT VARIABLES - Customize these values */
25
+ /* ============================================ */
26
+
27
+ /* Core Brand Color (OKLCH) */
28
+ --accent-h: 280; /* Hue (0-360°) - Purple by default */
29
+ --accent-c: 0.15; /* Chroma (0-1) - Saturation */
30
+ --accent-l: 60%; /* Lightness (0-100%) */
31
+
32
+ /* Theme Configuration */
33
+ --surface-saturation: 0.015; /* Surface chroma multiplier (0-1) */
34
+ --contrast-factor: 1.0; /* Overall contrast multiplier (0.5-2.0) */
35
+ --outline-width: 1px; /* Default outline width */
36
+ --outline-width-thick: 2px; /* Thick outline width */
37
+
38
+ /* Border Radius Scale */
39
+ --border-radius-sm: 3px;
40
+ --border-radius-md: 6px;
41
+ --border-radius-lg: 8px;
42
+ --border-radius-xl: 12px;
43
+ --border-radius-full: 9999px;
44
+
45
+ /* Typography */
46
+ --font-family: system-ui, -apple-system, sans-serif;
47
+ --font-size-base: 1rem;
48
+ --font-weight-normal: 400;
49
+ --font-weight-medium: 500;
50
+ --font-weight-semibold: 600;
51
+ --font-weight-bold: 700;
52
+ --line-height-base: 1.5;
53
+
54
+ /* Color Relationships */
55
+ --secondary-hue-shift: 60; /* Degrees to shift for secondary (+60° = complementary) */
56
+ --tertiary-hue-shift: -90; /* Degrees to shift for tertiary (-90° = triadic) */
57
+
58
+ /* Bedrock Mode: 'complementary' or 'dark' */
59
+ --bedrock-mode: complementary;
60
+
61
+ /* ============================================ */
62
+ /* DERIVED VARIABLES - Auto-generated colors */
63
+ /* ============================================ */
64
+
65
+ /* Secondary & Tertiary Hues */
66
+ --secondary-h: calc((var(--accent-h) + var(--secondary-hue-shift)) mod 360);
67
+ --tertiary-h: calc((var(--accent-h) + var(--tertiary-hue-shift)) mod 360);
68
+
69
+ /* Feedback Hues (Semantic colors) */
70
+ --success-h: 145; /* Green */
71
+ --warning-h: 55; /* Amber */
72
+ --error-h: 25; /* Red */
73
+ --info-h: 245; /* Blue */
74
+
75
+ /* Base & Bedrock Colors */
76
+ --base: oklch(97.5% calc(var(--surface-saturation) * 0.9) var(--accent-h));
77
+ --bedrock: oklch(
78
+ var(--bedrock-mode, complementary) = complementary ?
79
+ calc(100% - oklch(from var(--base) l)) :
80
+ 15%
81
+ calc(var(--surface-saturation) * 1.2) var(--accent-h)
82
+ );
83
+
84
+ /* Surface Hierarchy (content containers) */
85
+ --surface-muted: oklch(95% calc(var(--surface-saturation) * 0.8) var(--accent-h));
86
+ --surface-subtle: oklch(96% calc(var(--surface-saturation) * 1.05) var(--accent-h));
87
+ --surface: oklch(94% calc(var(--surface-saturation) * 1.2) var(--accent-h));
88
+ --surface-overt: oklch(77.5% calc(var(--surface-saturation) * 2.25) var(--accent-h));
89
+
90
+ /* ============================================ */
91
+ /* TEXT COLORS - Auto-contrast calculation */
92
+ /* ============================================ */
93
+
94
+ /* Base text colors (for general use) */
95
+ --text-muted: oklch(45% calc(var(--surface-saturation) * 1.5 * var(--contrast-factor)) var(--accent-h));
96
+ --text-subtle: oklch(35% calc(var(--surface-saturation) * 1.8 * var(--contrast-factor)) var(--accent-h));
97
+ --text: oklch(20% calc(var(--surface-saturation) * 2 * var(--contrast-factor)) var(--accent-h));
98
+ --text-overt: oklch(10% calc(var(--surface-saturation) * 2.2 * var(--contrast-factor)) var(--accent-h));
99
+
100
+ /* Auto-contrast text on surfaces (Lea Verou method) */
101
+ /* These calculate optimal text color for readability on any background */
102
+ --text-on-base: oklch(from var(--base) calc(clamp(0, (0.5 - l) * -infinity, 1) * 0.8 + 0.2) calc(c * 0.1) h);
103
+ --text-on-bedrock: oklch(from var(--bedrock) calc(clamp(0, (0.5 - l) * -infinity, 1) * 0.8 + 0.2) calc(c * 0.1) h);
104
+ --text-on-surface-muted: oklch(from var(--surface-muted) calc(clamp(0, (0.5 - l) * -infinity, 1) * 0.8 + 0.2) calc(c * 0.1) h);
105
+ --text-on-surface-subtle: oklch(from var(--surface-subtle) calc(clamp(0, (0.5 - l) * -infinity, 1) * 0.8 + 0.2) calc(c * 0.1) h);
106
+ --text-on-surface: oklch(from var(--surface) calc(clamp(0, (0.5 - l) * -infinity, 1) * 0.8 + 0.2) calc(c * 0.1) h);
107
+ --text-on-surface-overt: oklch(from var(--surface-overt) calc(clamp(0, (0.5 - l) * -infinity, 1) * 0.8 + 0.2) calc(c * 0.1) h);
108
+
109
+ /* Link colors */
110
+ --text-link: oklch(from var(--accent) calc(l + 0.1) calc(c + 0.05) h);
111
+ --text-link-hover: oklch(from var(--text-link) calc(l - 0.1) c h);
112
+ --text-link-visited: oklch(from var(--text-link) calc(l - 0.05) calc(c + 0.02) h);
113
+
114
+ /* Highlighted text (code, emphasis) */
115
+ --text-highlight-subtle: oklch(from var(--accent) calc(l + 0.2) calc(c - 0.05) h);
116
+ --text-highlight-overt: oklch(from var(--accent) calc(l - 0.1) calc(c + 0.05) h);
117
+ --text-highlight-bg: oklch(from var(--accent) calc(l + 0.8) calc(c - 0.3) h);
118
+
119
+ /* ============================================ */
120
+ /* OUTLINE & BORDER COLORS */
121
+ /* ============================================ */
122
+
123
+ /* General outlines */
124
+ --outline-muted: oklch(from var(--base) calc(l - 0.04) calc(c + var(--surface-saturation) * 0.5) h);
125
+ --outline-subtle: oklch(from var(--base) calc(l - 0.05) calc(c + var(--surface-saturation)) h);
126
+ --outline: oklch(from var(--base) calc(l - 0.06) calc(c + var(--surface-saturation) * 1.5) h);
127
+ --outline-overt: oklch(from var(--base) calc(l - 0.07) calc(c + var(--surface-saturation) * 2) h);
128
+
129
+ /* Semantic outlines */
130
+ --outline-focus: oklch(from var(--accent) calc(l - 0.1) calc(c + 0.1) h);
131
+ --outline-active: oklch(from var(--accent) calc(l - 0.05) calc(c + 0.05) h);
132
+ --outline-error: oklch(50% 0.2 var(--error-h));
133
+ --outline-warning: oklch(65% 0.15 var(--warning-h));
134
+ --outline-success: oklch(55% 0.15 var(--success-h));
135
+ --outline-info: oklch(60% 0.15 var(--info-h));
136
+
137
+ /* Highlight outlines */
138
+ --outline-highlight-subtle: oklch(from var(--accent) calc(l + 0.3) calc(c - 0.2) h);
139
+ --outline-highlight-overt: oklch(from var(--accent) calc(l + 0.1) calc(c - 0.1) h);
140
+
141
+ /* ============================================ */
142
+ /* HIGHLIGHT & INTERACTION COLORS */
143
+ /* ============================================ */
144
+
145
+ /* Selection and hover backgrounds */
146
+ --highlight-muted: oklch(from var(--base) calc(l - 0.01) c h);
147
+ --highlight-subtle: oklch(from var(--base) calc(l - 0.03) c h);
148
+ --highlight-overt: oklch(from var(--accent) calc(l + 0.8) calc(c - 0.3) h);
149
+
150
+ /* Scrim (overlay) */
151
+ --scrim: oklch(0% 0 0 / 0.5);
152
+ --scrim-light: oklch(100% 0 0 / 0.3);
153
+
154
+ /* ============================================ */
155
+ /* ACCENT COLOR SYSTEM */
156
+ /* ============================================ */
157
+
158
+ /* Primary accent variations */
159
+ --accent: oklch(var(--accent-l) var(--accent-c) var(--accent-h));
160
+ --accent-muted: oklch(from var(--accent) calc(l + 0.15) calc(c - 0.05) h);
161
+ --accent-subtle: oklch(from var(--accent) calc(l + 0.05) calc(c - 0.02) h);
162
+ --accent-surface: oklch(from var(--accent) calc(l + 0.8) calc(c - 0.1) h);
163
+ --accent-overt: oklch(from var(--accent) calc(l - 0.1) calc(c + 0.05) h);
164
+ --accent-highlight: oklch(from var(--accent) calc(l + 0.5) calc(c - 0.2) h);
165
+
166
+ /* Accent text on different surfaces */
167
+ --accent-on-base: oklch(from var(--base) calc(clamp(0, (0.5 - l) * -infinity, 1) * 0.8 + 0.2) calc(c * 0.1) h);
168
+ --accent-on-bedrock: oklch(from var(--bedrock) calc(clamp(0, (0.5 - l) * -infinity, 1) * 0.8 + 0.2) calc(c * 0.1) h);
169
+ --accent-on-surface: oklch(from var(--surface) calc(clamp(0, (0.5 - l) * -infinity, 1) * 0.8 + 0.2) calc(c * 0.1) h);
170
+
171
+ /* ============================================ */
172
+ /* SECONDARY & TERTIARY SYSTEMS */
173
+ /* ============================================ */
174
+
175
+ /* Secondary colors */
176
+ --secondary: oklch(var(--accent-l) var(--accent-c) var(--secondary-h));
177
+ --secondary-muted: oklch(from var(--secondary) calc(l + 0.15) calc(c - 0.05) h);
178
+ --secondary-subtle: oklch(from var(--secondary) calc(l + 0.05) calc(c - 0.02) h);
179
+ --secondary-overt: oklch(from var(--secondary) calc(l - 0.1) calc(c + 0.05) h);
180
+
181
+ /* Tertiary colors */
182
+ --tertiary: oklch(var(--accent-l) var(--accent-c) var(--tertiary-h));
183
+ --tertiary-muted: oklch(from var(--tertiary) calc(l + 0.15) calc(c - 0.05) h);
184
+ --tertiary-subtle: oklch(from var(--tertiary) calc(l + 0.05) calc(c - 0.02) h);
185
+ --tertiary-overt: oklch(from var(--tertiary) calc(l - 0.1) calc(c + 0.05) h);
186
+
187
+ /* ============================================ */
188
+ /* SEMANTIC COLORS (Success, Warning, etc.) */
189
+ /* ============================================ */
190
+
191
+ --success: oklch(55% 0.15 var(--success-h));
192
+ --warning: oklch(70% 0.15 var(--warning-h));
193
+ --error: oklch(60% 0.2 var(--error-h));
194
+ --info: oklch(65% 0.15 var(--info-h));
195
+
196
+ /* Semantic text colors */
197
+ --text-success: var(--success);
198
+ --text-warning: var(--warning);
199
+ --text-error: var(--error);
200
+ --text-info: var(--info);
201
+
202
+ /* Semantic surface colors */
203
+ --surface-success: oklch(from var(--success) calc(l + 0.9) calc(c - 0.1) h);
204
+ --surface-warning: oklch(from var(--warning) calc(l + 0.8) calc(c - 0.1) h);
205
+ --surface-error: oklch(from var(--error) calc(l + 0.8) calc(c - 0.1) h);
206
+ --surface-info: oklch(from var(--info) calc(l + 0.8) calc(c - 0.1) h);
207
+
208
+ /* ============================================ */
209
+ /* BUTTON SYSTEM */
210
+ /* ============================================ */
211
+
212
+ /* Button base styles */
213
+ --button-padding-x: 1rem;
214
+ --button-padding-y: 0.5rem;
215
+ --button-font-weight: var(--font-weight-medium);
216
+ --button-border-width: var(--outline-width);
217
+ --button-transition: all 0.15s ease;
218
+
219
+ /* Button variants */
220
+ --button: var(--surface);
221
+ --button-hover: oklch(from var(--button) calc(l - 0.05) c h);
222
+ --button-active: oklch(from var(--button) calc(l - 0.08) c h);
223
+ --button-disabled: var(--surface-muted);
224
+
225
+ --button-primary: var(--accent);
226
+ --button-primary-hover: oklch(from var(--button-primary) calc(l - 0.05) c h);
227
+ --button-primary-active: oklch(from var(--button-primary) calc(l - 0.08) c h);
228
+ --button-primary-disabled: var(--accent-muted);
229
+
230
+ --button-secondary: var(--secondary);
231
+ --button-secondary-hover: oklch(from var(--button-secondary) calc(l - 0.05) c h);
232
+ --button-secondary-active: oklch(from var(--button-secondary) calc(l - 0.08) c h);
233
+ --button-secondary-disabled: var(--secondary-muted);
234
+
235
+ --button-outline: transparent;
236
+ --button-outline-hover: var(--highlight-subtle);
237
+ --button-outline-active: var(--highlight-overt);
238
+ --button-outline-disabled: transparent;
239
+
240
+ --button-ghost: transparent;
241
+ --button-ghost-hover: var(--highlight-subtle);
242
+ --button-ghost-active: var(--highlight-overt);
243
+ --button-ghost-disabled: transparent;
244
+
245
+ /* Button text colors */
246
+ --button-text: var(--accent);
247
+ --button-text-hover: oklch(from var(--button-text) calc(l - 0.05) c h);
248
+ --button-text-active: oklch(from var(--button-text) calc(l - 0.08) c h);
249
+ --button-text-disabled: var(--text-muted);
250
+
251
+ /* Accent color variations for theming */
252
+ --accent-light: oklch(from var(--accent) calc(l + 0.8) calc(c - 0.1) h);
253
+ --accent-dark: oklch(from var(--accent) calc(l - 0.3) calc(c + 0.05) h);
254
+
255
+ /* Form component colors */
256
+ --ec-frm-tooltipSuccessBg: var(--accent-light);
257
+ --ec-frm-tooltipSuccessFg: var(--accent-dark);
258
+ }
259
+
260
+ /* ============================================ */
261
+ /* TAILWIND INTEGRATION */
262
+ /* ============================================ */
263
+
264
+ /*
265
+ Tailwind Config Extension:
266
+
267
+ module.exports = {
268
+ theme: {
269
+ extend: {
270
+ colors: {
271
+ 'base': 'var(--base)',
272
+ 'bedrock': 'var(--bedrock)',
273
+ 'surface': {
274
+ 'muted': 'var(--surface-muted)',
275
+ 'subtle': 'var(--surface-subtle)',
276
+ DEFAULT: 'var(--surface)',
277
+ 'overt': 'var(--surface-overt)',
278
+ },
279
+ 'text': {
280
+ 'muted': 'var(--text-muted)',
281
+ 'subtle': 'var(--text-subtle)',
282
+ DEFAULT: 'var(--text)',
283
+ 'overt': 'var(--text-overt)',
284
+ 'link': 'var(--text-link)',
285
+ 'highlight': {
286
+ 'subtle': 'var(--text-highlight-subtle)',
287
+ 'overt': 'var(--text-highlight-overt)',
288
+ },
289
+ },
290
+ 'accent': {
291
+ DEFAULT: 'var(--accent)',
292
+ 'muted': 'var(--accent-muted)',
293
+ 'subtle': 'var(--accent-subtle)',
294
+ 'overt': 'var(--accent-overt)',
295
+ },
296
+ 'secondary': 'var(--secondary)',
297
+ 'tertiary': 'var(--tertiary)',
298
+ 'success': 'var(--success)',
299
+ 'warning': 'var(--warning)',
300
+ 'error': 'var(--error)',
301
+ 'info': 'var(--info)',
302
+ },
303
+ borderColor: {
304
+ 'muted': 'var(--outline-muted)',
305
+ 'subtle': 'var(--outline-subtle)',
306
+ DEFAULT: 'var(--outline)',
307
+ 'overt': 'var(--outline-overt)',
308
+ 'focus': 'var(--outline-focus)',
309
+ 'error': 'var(--outline-error)',
310
+ },
311
+ backgroundColor: {
312
+ 'highlight': {
313
+ 'muted': 'var(--highlight-muted)',
314
+ 'subtle': 'var(--highlight-subtle)',
315
+ 'overt': 'var(--highlight-overt)',
316
+ },
317
+ },
318
+ },
319
+ },
320
+ }
321
+ */
322
+
323
+ /* ============================================ */
324
+ /* DARK MODE SUPPORT */
325
+ /* ============================================ */
326
+
327
+ @media (prefers-color-scheme: dark) {
328
+ :root {
329
+ /* Dark mode adjustments */
330
+ --accent-l: 70%;
331
+ --accent-c: 0.18;
332
+ --surface-saturation: 0.02;
333
+
334
+ /* Invert surface hierarchy for dark backgrounds */
335
+ --base: oklch(22% calc(var(--surface-saturation) * 0.9) var(--accent-h));
336
+ --bedrock: oklch(95% calc(var(--surface-saturation) * 0.7) var(--accent-h));
337
+
338
+ --surface-muted: oklch(20% calc(var(--surface-saturation) * 0.5) var(--accent-h));
339
+ --surface-subtle: oklch(21% calc(var(--surface-saturation) * 0.7) var(--accent-h));
340
+ --surface: oklch(25% var(--surface-saturation) var(--accent-h));
341
+ --surface-overt: oklch(30% calc(var(--surface-saturation) * 1.2) var(--accent-h));
342
+
343
+ /* Adjust text for dark backgrounds */
344
+ --text-muted: oklch(65% calc(var(--surface-saturation) * 1.2) var(--accent-h));
345
+ --text-subtle: oklch(75% calc(var(--surface-saturation) * 1.0) var(--accent-h));
346
+ --text: oklch(88% calc(var(--surface-saturation) * 0.8) var(--accent-h));
347
+ --text-overt: oklch(95% calc(var(--surface-saturation) * 0.6) var(--accent-h));
348
+
349
+ /* Dark mode semantic colors */
350
+ --success: oklch(65% 0.15 var(--success-h));
351
+ --warning: oklch(75% 0.15 var(--warning-h));
352
+ --error: oklch(70% 0.2 var(--error-h));
353
+ --info: oklch(75% 0.15 var(--info-h));
354
+ }
355
+ }
356
+
357
+ /* ============================================ */
358
+ /* HIGH CONTRAST MODE SUPPORT */
359
+ /* ============================================ */
360
+
361
+ @media (prefers-contrast: high) {
362
+ :root {
363
+ --contrast-factor: 1.3;
364
+ --outline-width: 2px;
365
+ --outline-width-thick: 3px;
366
+
367
+ /* Enhanced contrasts */
368
+ --text-subtle: oklch(30% 0.03 var(--accent-h));
369
+ --text-muted: oklch(25% 0.02 var(--accent-h));
370
+ --outline-focus: oklch(50% 0.3 var(--accent-h));
371
+ --outline: oklch(from var(--base) calc(l - 0.08) calc(c + var(--surface-saturation) * 2) h);
372
+ }
373
+ }
374
+
375
+ /* ============================================ */
376
+ /* USAGE EXAMPLES */
377
+ /* ============================================ */
378
+
379
+ /*
380
+ Basic Usage:
381
+
382
+ <main class="bg-base text-on-base">
383
+ <header class="bg-bedrock text-on-bedrock">
384
+ <h1 class="text-overt">Title</h1>
385
+ <p class="text-subtle">Subtitle</p>
386
+ </header>
387
+
388
+ <section class="bg-surface text-on-surface">
389
+ <h2 class="text-overt">Section Title</h2>
390
+ <p class="text">Main content with <a href="#" class="text-link">links</a></p>
391
+ <div class="bg-surface-subtle text-on-surface-subtle">
392
+ <p class="text-subtle">Secondary content</p>
393
+ </div>
394
+ </section>
395
+
396
+ <button class="button-primary">Primary Action</button>
397
+ <button class="button-outline">Secondary Action</button>
398
+ <button class="button-text">Text Button</button>
399
+ </main>
400
+
401
+ Customization:
402
+
403
+ :root {
404
+ --accent-h: 45; /* Yellow theme */
405
+ --accent-c: 0.14; /* Moderate saturation */
406
+ --accent-l: 65%; /* Good lightness */
407
+ --surface-saturation: 0.012; /* Subtle surfaces */
408
+ --contrast-factor: 1.2; /* Higher contrast */
409
+ }
410
+ */
411
+
412
+ @import url("core/tokens.css") layer(tokens); /* Optional: import existing tokens */
413
+
414
+ :root {
415
+ /* ============================================ */
416
+ /* INPUT VARIABLES - Customize these values */
417
+ /* ============================================ */
418
+
419
+ /* Core Brand Color (OKLCH) */
420
+ --accent-h: 280; /* Hue (0-360°) - Purple by default */
421
+ --accent-c: 0.15; /* Chroma (0-1) - Saturation */
422
+ --accent-l: 60%; /* Lightness (0-100%) */
423
+
424
+ /* Theme Configuration */
425
+ --surface-saturation: 0.015; /* Surface chroma multiplier (0-1) */
426
+ --contrast-factor: 1.0; /* Overall contrast multiplier (0.5-2.0) */
427
+ --outline-width: 1px; /* Default outline width */
428
+ --outline-width-thick: 2px; /* Thick outline width */
429
+
430
+ /* Border Radius Scale */
431
+ --border-radius-sm: 3px;
432
+ --border-radius-md: 6px;
433
+ --border-radius-lg: 8px;
434
+ --border-radius-xl: 12px;
435
+ --border-radius-full: 9999px;
436
+
437
+ /* Typography */
438
+ --font-family: system-ui, -apple-system, sans-serif;
439
+ --font-size-base: 1rem;
440
+ --font-weight-normal: 400;
441
+ --font-weight-medium: 500;
442
+ --font-weight-semibold: 600;
443
+ --font-weight-bold: 700;
444
+ --line-height-base: 1.5;
445
+
446
+ /* Color Relationships */
447
+ --secondary-hue-shift: 60; /* Degrees to shift for secondary (+60° = complementary) */
448
+ --tertiary-hue-shift: -90; /* Degrees to shift for tertiary (-90° = triadic) */
449
+
450
+ /* Bedrock Mode: 'complementary' or 'dark' */
451
+ --bedrock-mode: complementary;
452
+
453
+ /* ============================================ */
454
+ /* DERIVED VARIABLES - Auto-generated colors */
455
+ /* ============================================ */
456
+
457
+ /* Secondary & Tertiary Hues */
458
+ --secondary-h: calc((var(--accent-h) + var(--secondary-hue-shift)) mod 360);
459
+ --tertiary-h: calc((var(--accent-h) + var(--tertiary-hue-shift)) mod 360);
460
+
461
+ /* Feedback Hues (Semantic colors) */
462
+ --success-h: 145; /* Green */
463
+ --warning-h: 55; /* Amber */
464
+ --error-h: 25; /* Red */
465
+ --info-h: 245; /* Blue */
466
+
467
+ /* Base & Bedrock Colors */
468
+ --base: oklch(97.5% calc(var(--surface-saturation) * 0.9) var(--accent-h));
469
+ --bedrock: oklch(
470
+ var(--bedrock-mode, complementary) = complementary ?
471
+ calc(100% - oklch(from var(--base) l)) :
472
+ 15%
473
+ calc(var(--surface-saturation) * 1.2) var(--accent-h)
474
+ );
475
+
476
+ /* Surface Hierarchy (content containers) */
477
+ --surface-muted: oklch(95% calc(var(--surface-saturation) * 0.8) var(--accent-h));
478
+ --surface-subtle: oklch(96% calc(var(--surface-saturation) * 1.05) var(--accent-h));
479
+ --surface: oklch(94% calc(var(--surface-saturation) * 1.2) var(--accent-h));
480
+ --surface-overt: oklch(77.5% calc(var(--surface-saturation) * 2.25) var(--accent-h));
481
+
482
+ /* ============================================ */
483
+ /* TEXT COLORS - Auto-contrast calculation */
484
+ /* ============================================ */
485
+
486
+ /* Base text colors (for general use) */
487
+ --text-muted: oklch(45% calc(var(--surface-saturation) * 1.5 * var(--contrast-factor)) var(--accent-h));
488
+ --text-subtle: oklch(35% calc(var(--surface-saturation) * 1.8 * var(--contrast-factor)) var(--accent-h));
489
+ --text: oklch(20% calc(var(--surface-saturation) * 2 * var(--contrast-factor)) var(--accent-h));
490
+ --text-overt: oklch(10% calc(var(--surface-saturation) * 2.2 * var(--contrast-factor)) var(--accent-h));
491
+
492
+ /* Auto-contrast text on surfaces (Lea Verou method) */
493
+ /* These calculate optimal text color for readability on any background */
494
+ --text-on-base: oklch(from var(--base) calc(clamp(0, (0.5 - l) * -infinity, 1) * 0.8 + 0.2) calc(c * 0.1) h);
495
+ --text-on-bedrock: oklch(from var(--bedrock) calc(clamp(0, (0.5 - l) * -infinity, 1) * 0.8 + 0.2) calc(c * 0.1) h);
496
+ --text-on-surface-muted: oklch(from var(--surface-muted) calc(clamp(0, (0.5 - l) * -infinity, 1) * 0.8 + 0.2) calc(c * 0.1) h);
497
+ --text-on-surface-subtle: oklch(from var(--surface-subtle) calc(clamp(0, (0.5 - l) * -infinity, 1) * 0.8 + 0.2) calc(c * 0.1) h);
498
+ --text-on-surface: oklch(from var(--surface) calc(clamp(0, (0.5 - l) * -infinity, 1) * 0.8 + 0.2) calc(c * 0.1) h);
499
+ --text-on-surface-overt: oklch(from var(--surface-overt) calc(clamp(0, (0.5 - l) * -infinity, 1) * 0.8 + 0.2) calc(c * 0.1) h);
500
+
501
+ /* Link colors */
502
+ --text-link: oklch(from var(--accent) calc(l + 0.1) calc(c + 0.05) h);
503
+ --text-link-hover: oklch(from var(--text-link) calc(l - 0.1) c h);
504
+ --text-link-visited: oklch(from var(--text-link) calc(l - 0.05) calc(c + 0.02) h);
505
+
506
+ /* Highlighted text (code, emphasis) */
507
+ --text-highlight-subtle: oklch(from var(--accent) calc(l + 0.2) calc(c - 0.05) h);
508
+ --text-highlight-overt: oklch(from var(--accent) calc(l - 0.1) calc(c + 0.05) h);
509
+ --text-highlight-bg: oklch(from var(--accent) calc(l + 0.8) calc(c - 0.3) h);
510
+
511
+ /* ============================================ */
512
+ /* OUTLINE & BORDER COLORS */
513
+ /* ============================================ */
514
+
515
+ /* General outlines */
516
+ --outline-muted: oklch(from var(--base) calc(l - 0.04) calc(c + var(--surface-saturation) * 0.5) h);
517
+ --outline-subtle: oklch(from var(--base) calc(l - 0.05) calc(c + var(--surface-saturation)) h);
518
+ --outline: oklch(from var(--base) calc(l - 0.06) calc(c + var(--surface-saturation) * 1.5) h);
519
+ --outline-overt: oklch(from var(--base) calc(l - 0.07) calc(c + var(--surface-saturation) * 2) h);
520
+
521
+ /* Semantic outlines */
522
+ --outline-focus: oklch(from var(--accent) calc(l - 0.1) calc(c + 0.1) h);
523
+ --outline-active: oklch(from var(--accent) calc(l - 0.05) calc(c + 0.05) h);
524
+ --outline-error: oklch(50% 0.2 var(--error-h));
525
+ --outline-warning: oklch(65% 0.15 var(--warning-h));
526
+ --outline-success: oklch(55% 0.15 var(--success-h));
527
+ --outline-info: oklch(60% 0.15 var(--info-h));
528
+
529
+ /* Highlight outlines */
530
+ --outline-highlight-subtle: oklch(from var(--accent) calc(l + 0.3) calc(c - 0.2) h);
531
+ --outline-highlight-overt: oklch(from var(--accent) calc(l + 0.1) calc(c - 0.1) h);
532
+
533
+ /* ============================================ */
534
+ /* HIGHLIGHT & INTERACTION COLORS */
535
+ /* ============================================ */
536
+
537
+ /* Selection and hover backgrounds */
538
+ --highlight-muted: oklch(from var(--base) calc(l - 0.01) c h);
539
+ --highlight-subtle: oklch(from var(--base) calc(l - 0.03) c h);
540
+ --highlight-overt: oklch(from var(--accent) calc(l + 0.8) calc(c - 0.3) h);
541
+
542
+ /* Scrim (overlay) */
543
+ --scrim: oklch(0% 0 0 / 0.5);
544
+ --scrim-light: oklch(100% 0 0 / 0.3);
545
+
546
+ /* ============================================ */
547
+ /* ACCENT COLOR SYSTEM */
548
+ /* ============================================ */
549
+
550
+ /* Primary accent variations */
551
+ --accent: oklch(var(--accent-l) var(--accent-c) var(--accent-h));
552
+ --accent-muted: oklch(from var(--accent) calc(l + 0.15) calc(c - 0.05) h);
553
+ --accent-subtle: oklch(from var(--accent) calc(l + 0.05) calc(c - 0.02) h);
554
+ --accent-surface: oklch(from var(--accent) calc(l + 0.8) calc(c - 0.1) h);
555
+ --accent-overt: oklch(from var(--accent) calc(l - 0.1) calc(c + 0.05) h);
556
+ --accent-highlight: oklch(from var(--accent) calc(l + 0.5) calc(c - 0.2) h);
557
+
558
+ /* Accent text on different surfaces */
559
+ --accent-on-base: oklch(from var(--base) calc(clamp(0, (0.5 - l) * -infinity, 1) * 0.8 + 0.2) calc(c * 0.1) h);
560
+ --accent-on-bedrock: oklch(from var(--bedrock) calc(clamp(0, (0.5 - l) * -infinity, 1) * 0.8 + 0.2) calc(c * 0.1) h);
561
+ --accent-on-surface: oklch(from var(--surface) calc(clamp(0, (0.5 - l) * -infinity, 1) * 0.8 + 0.2) calc(c * 0.1) h);
562
+
563
+ /* ============================================ */
564
+ /* SECONDARY & TERTIARY SYSTEMS */
565
+ /* ============================================ */
566
+
567
+ /* Secondary colors */
568
+ --secondary: oklch(var(--accent-l) var(--accent-c) var(--secondary-h));
569
+ --secondary-muted: oklch(from var(--secondary) calc(l + 0.15) calc(c - 0.05) h);
570
+ --secondary-subtle: oklch(from var(--secondary) calc(l + 0.05) calc(c - 0.02) h);
571
+ --secondary-overt: oklch(from var(--secondary) calc(l - 0.1) calc(c + 0.05) h);
572
+
573
+ /* Tertiary colors */
574
+ --tertiary: oklch(var(--accent-l) var(--accent-c) var(--tertiary-h));
575
+ --tertiary-muted: oklch(from var(--tertiary) calc(l + 0.15) calc(c - 0.05) h);
576
+ --tertiary-subtle: oklch(from var(--tertiary) calc(l + 0.05) calc(c - 0.02) h);
577
+ --tertiary-overt: oklch(from var(--tertiary) calc(l - 0.1) calc(c + 0.05) h);
578
+
579
+ /* ============================================ */
580
+ /* SEMANTIC COLORS (Success, Warning, etc.) */
581
+ /* ============================================ */
582
+
583
+ --success: oklch(55% 0.15 var(--success-h));
584
+ --warning: oklch(70% 0.15 var(--warning-h));
585
+ --error: oklch(60% 0.2 var(--error-h));
586
+ --info: oklch(65% 0.15 var(--info-h));
587
+
588
+ /* Semantic text colors */
589
+ --text-success: var(--success);
590
+ --text-warning: var(--warning);
591
+ --text-error: var(--error);
592
+ --text-info: var(--info);
593
+
594
+ /* Semantic surface colors */
595
+ --surface-success: oklch(from var(--success) calc(l + 0.9) calc(c - 0.1) h);
596
+ --surface-warning: oklch(from var(--warning) calc(l + 0.8) calc(c - 0.1) h);
597
+ --surface-error: oklch(from var(--error) calc(l + 0.8) calc(c - 0.1) h);
598
+ --surface-info: oklch(from var(--info) calc(l + 0.8) calc(c - 0.1) h);
599
+
600
+ /* ============================================ */
601
+ /* BUTTON SYSTEM */
602
+ /* ============================================ */
603
+
604
+ /* Button base styles */
605
+ --button-padding-x: 1rem;
606
+ --button-padding-y: 0.5rem;
607
+ --button-font-weight: var(--font-weight-medium);
608
+ --button-border-width: var(--outline-width);
609
+ --button-transition: all 0.15s ease;
610
+
611
+ /* Button variants */
612
+ --button: var(--surface);
613
+ --button-hover: oklch(from var(--button) calc(l - 0.05) c h);
614
+ --button-active: oklch(from var(--button) calc(l - 0.08) c h);
615
+ --button-disabled: var(--surface-muted);
616
+
617
+ --button-primary: var(--accent);
618
+ --button-primary-hover: oklch(from var(--button-primary) calc(l - 0.05) c h);
619
+ --button-primary-active: oklch(from var(--button-primary) calc(l - 0.08) c h);
620
+ --button-primary-disabled: var(--accent-muted);
621
+
622
+ --button-secondary: var(--secondary);
623
+ --button-secondary-hover: oklch(from var(--button-secondary) calc(l - 0.05) c h);
624
+ --button-secondary-active: oklch(from var(--button-secondary) calc(l - 0.08) c h);
625
+ --button-secondary-disabled: var(--secondary-muted);
626
+
627
+ --button-outline: transparent;
628
+ --button-outline-hover: var(--highlight-subtle);
629
+ --button-outline-active: var(--highlight-overt);
630
+ --button-outline-disabled: transparent;
631
+
632
+ --button-ghost: transparent;
633
+ --button-ghost-hover: var(--highlight-subtle);
634
+ --button-ghost-active: var(--highlight-overt);
635
+ --button-ghost-disabled: transparent;
636
+
637
+ /* Button text colors */
638
+ --button-text: var(--accent);
639
+ --button-text-hover: oklch(from var(--button-text) calc(l - 0.05) c h);
640
+ --button-text-active: oklch(from var(--button-text) calc(l - 0.08) c h);
641
+ --button-text-disabled: var(--text-muted);
642
+ }
643
+
644
+ /* ============================================ */
645
+ /* UTILITY CLASSES - For easy application */
646
+ /* ============================================ */
647
+
648
+ /* Background Colors */
649
+ .bg-base { background-color: var(--base); }
650
+ .bg-bedrock { background-color: var(--bedrock); }
651
+ .bg-surface-muted { background-color: var(--surface-muted); }
652
+ .bg-surface-subtle { background-color: var(--surface-subtle); }
653
+ .bg-surface { background-color: var(--surface); }
654
+ .bg-surface-overt { background-color: var(--surface-overt); }
655
+
656
+ /* Text Colors */
657
+ .text-muted { color: var(--text-muted); }
658
+ .text-subtle { color: var(--text-subtle); }
659
+ .text { color: var(--text); }
660
+ .text-overt { color: var(--text-overt); }
661
+ .text-link { color: var(--text-link); }
662
+ .text-link:hover { color: var(--text-link-hover); }
663
+ .text-highlight-subtle { color: var(--text-highlight-subtle); }
664
+ .text-highlight-overt { color: var(--text-highlight-overt); }
665
+
666
+ /* Text on Surfaces */
667
+ .text-on-base { color: var(--text-on-base); }
668
+ .text-on-bedrock { color: var(--text-on-bedrock); }
669
+ .text-on-surface-muted { color: var(--text-on-surface-muted); }
670
+ .text-on-surface-subtle { color: var(--text-on-surface-subtle); }
671
+ .text-on-surface { color: var(--text-on-surface); }
672
+ .text-on-surface-overt { color: var(--text-on-surface-overt); }
673
+
674
+ /* Outline/Border Colors */
675
+ .border-muted { border-color: var(--outline-muted); }
676
+ .border-subtle { border-color: var(--outline-subtle); }
677
+ .border { border-color: var(--outline); }
678
+ .border-overt { border-color: var(--outline-overt); }
679
+ .border-focus { border-color: var(--outline-focus); }
680
+ .border-active { border-color: var(--outline-active); }
681
+ .border-error { border-color: var(--outline-error); }
682
+ .border-warning { border-color: var(--outline-warning); }
683
+ .border-success { border-color: var(--outline-success); }
684
+ .border-info { border-color: var(--outline-info); }
685
+
686
+ /* Highlight Backgrounds */
687
+ .bg-highlight-muted { background-color: var(--highlight-muted); }
688
+ .bg-highlight-subtle { background-color: var(--highlight-subtle); }
689
+ .bg-highlight-overt { background-color: var(--highlight-overt); }
690
+ .bg-text-highlight { background-color: var(--text-highlight-bg); }
691
+
692
+ /* Accent Colors */
693
+ .bg-accent { background-color: var(--accent); }
694
+ .bg-accent-muted { background-color: var(--accent-muted); }
695
+ .bg-accent-subtle { background-color: var(--accent-subtle); }
696
+ .bg-accent-surface { background-color: var(--accent-surface); }
697
+ .bg-accent-overt { background-color: var(--accent-overt); }
698
+ .bg-accent-highlight { background-color: var(--accent-highlight); }
699
+
700
+ .text-accent { color: var(--accent); }
701
+ .text-accent-muted { color: var(--accent-muted); }
702
+ .text-accent-subtle { color: var(--accent-subtle); }
703
+ .text-accent-overt { color: var(--accent-overt); }
704
+
705
+ .text-accent-on-base { color: var(--accent-on-base); }
706
+ .text-accent-on-bedrock { color: var(--accent-on-bedrock); }
707
+ .text-accent-on-surface { color: var(--accent-on-surface); }
708
+
709
+ /* Secondary Colors */
710
+ .bg-secondary { background-color: var(--secondary); }
711
+ .bg-secondary-muted { background-color: var(--secondary-muted); }
712
+ .bg-secondary-subtle { background-color: var(--secondary-subtle); }
713
+ .bg-secondary-overt { background-color: var(--secondary-overt); }
714
+
715
+ .text-secondary { color: var(--secondary); }
716
+ .text-secondary-muted { color: var(--secondary-muted); }
717
+ .text-secondary-subtle { color: var(--secondary-subtle); }
718
+ .text-secondary-overt { color: var(--secondary-overt); }
719
+
720
+ /* Tertiary Colors */
721
+ .bg-tertiary { background-color: var(--tertiary); }
722
+ .bg-tertiary-muted { background-color: var(--tertiary-muted); }
723
+ .bg-tertiary-subtle { background-color: var(--tertiary-subtle); }
724
+ .bg-tertiary-overt { background-color: var(--tertiary-overt); }
725
+
726
+ .text-tertiary { color: var(--tertiary); }
727
+ .text-tertiary-muted { color: var(--tertiary-muted); }
728
+ .text-tertiary-subtle { color: var(--tertiary-subtle); }
729
+ .text-tertiary-overt { color: var(--tertiary-overt); }
730
+
731
+ /* Semantic Colors */
732
+ .bg-success { background-color: var(--surface-success); }
733
+ .bg-warning { background-color: var(--surface-warning); }
734
+ .bg-error { background-color: var(--surface-error); }
735
+ .bg-info { background-color: var(--surface-info); }
736
+
737
+ .text-success { color: var(--text-success); }
738
+ .text-warning { color: var(--text-warning); }
739
+ .text-error { color: var(--text-error); }
740
+ .text-info { color: var(--text-info); }
741
+
742
+ .border-success { border-color: var(--outline-success); }
743
+ .border-warning { border-color: var(--outline-warning); }
744
+ .border-error { border-color: var(--outline-error); }
745
+ .border-info { border-color: var(--outline-info); }
746
+
747
+ /* Button Classes */
748
+ .button {
749
+ display: inline-flex;
750
+ align-items: center;
751
+ justify-content: center;
752
+ padding: var(--button-padding-y) var(--button-padding-x);
753
+ font-family: var(--font-family);
754
+ font-weight: var(--button-font-weight);
755
+ font-size: var(--font-size-base);
756
+ line-height: var(--line-height-base);
757
+ border: var(--button-border-width) solid var(--outline);
758
+ border-radius: var(--border-radius-md);
759
+ background-color: var(--button);
760
+ color: var(--text-on-surface);
761
+ cursor: pointer;
762
+ transition: var(--button-transition);
763
+ text-decoration: none;
764
+ }
765
+
766
+ .button:hover { background-color: var(--button-hover); }
767
+ .button:active { background-color: var(--button-active); }
768
+ .button:disabled {
769
+ background-color: var(--button-disabled);
770
+ cursor: not-allowed;
771
+ opacity: 0.6;
772
+ }
773
+
774
+ .button-primary {
775
+ background-color: var(--button-primary);
776
+ border-color: var(--accent);
777
+ color: var(--accent-on-base);
778
+ }
779
+ .button-primary:hover { background-color: var(--button-primary-hover); }
780
+ .button-primary:active { background-color: var(--button-primary-active); }
781
+ .button-primary:disabled { background-color: var(--button-primary-disabled); }
782
+
783
+ .button-secondary {
784
+ background-color: var(--button-secondary);
785
+ border-color: var(--secondary);
786
+ color: var(--secondary-on-base);
787
+ }
788
+ .button-secondary:hover { background-color: var(--button-secondary-hover); }
789
+ .button-secondary:active { background-color: var(--button-secondary-active); }
790
+ .button-secondary:disabled { background-color: var(--button-secondary-disabled); }
791
+
792
+ .button-outline {
793
+ background-color: var(--button-outline);
794
+ border-color: var(--outline);
795
+ color: var(--text);
796
+ }
797
+ .button-outline:hover { background-color: var(--button-outline-hover); }
798
+ .button-outline:active { background-color: var(--button-outline-active); }
799
+ .button-outline:disabled { background-color: var(--button-outline-disabled); }
800
+
801
+ .button-ghost {
802
+ background-color: var(--button-ghost);
803
+ border-color: transparent;
804
+ color: var(--text);
805
+ }
806
+ .button-ghost:hover { background-color: var(--button-ghost-hover); }
807
+ .button-ghost:active { background-color: var(--button-ghost-active); }
808
+ .button-ghost:disabled { background-color: var(--button-ghost-disabled); }
809
+
810
+ .button-text {
811
+ background-color: transparent;
812
+ border-color: transparent;
813
+ color: var(--button-text);
814
+ padding: var(--button-padding-y) var(--button-padding-x);
815
+ }
816
+ .button-text:hover { color: var(--button-text-hover); }
817
+ .button-text:active { color: var(--button-text-active); }
818
+ .button-text:disabled { color: var(--button-text-disabled); }
819
+
820
+ /* Scrim */
821
+ .scrim { background-color: var(--scrim); }
822
+ .scrim-light { background-color: var(--scrim-light); }
823
+
824
+ /* ============================================ */
825
+ /* TAILWIND INTEGRATION */
826
+ /* ============================================ */
827
+
828
+ /*
829
+ Tailwind Config Extension:
830
+
831
+ module.exports = {
832
+ theme: {
833
+ extend: {
834
+ colors: {
835
+ 'base': 'var(--base)',
836
+ 'bedrock': 'var(--bedrock)',
837
+ 'surface': {
838
+ 'muted': 'var(--surface-muted)',
839
+ 'subtle': 'var(--surface-subtle)',
840
+ DEFAULT: 'var(--surface)',
841
+ 'overt': 'var(--surface-overt)',
842
+ },
843
+ 'text': {
844
+ 'muted': 'var(--text-muted)',
845
+ 'subtle': 'var(--text-subtle)',
846
+ DEFAULT: 'var(--text)',
847
+ 'overt': 'var(--text-overt)',
848
+ 'link': 'var(--text-link)',
849
+ 'highlight': {
850
+ 'subtle': 'var(--text-highlight-subtle)',
851
+ 'overt': 'var(--text-highlight-overt)',
852
+ },
853
+ },
854
+ 'accent': {
855
+ DEFAULT: 'var(--accent)',
856
+ 'muted': 'var(--accent-muted)',
857
+ 'subtle': 'var(--accent-subtle)',
858
+ 'overt': 'var(--accent-overt)',
859
+ },
860
+ 'secondary': 'var(--secondary)',
861
+ 'tertiary': 'var(--tertiary)',
862
+ 'success': 'var(--success)',
863
+ 'warning': 'var(--warning)',
864
+ 'error': 'var(--error)',
865
+ 'info': 'var(--info)',
866
+ },
867
+ borderColor: {
868
+ 'muted': 'var(--outline-muted)',
869
+ 'subtle': 'var(--outline-subtle)',
870
+ DEFAULT: 'var(--outline)',
871
+ 'overt': 'var(--outline-overt)',
872
+ 'focus': 'var(--outline-focus)',
873
+ 'error': 'var(--outline-error)',
874
+ },
875
+ backgroundColor: {
876
+ 'highlight': {
877
+ 'muted': 'var(--highlight-muted)',
878
+ 'subtle': 'var(--highlight-subtle)',
879
+ 'overt': 'var(--highlight-overt)',
880
+ },
881
+ },
882
+ },
883
+ },
884
+ }
885
+ */
886
+
887
+ /* ============================================ */
888
+ /* DARK MODE SUPPORT */
889
+ /* ============================================ */
890
+
891
+ @media (prefers-color-scheme: dark) {
892
+ :root {
893
+ /* Dark mode adjustments */
894
+ --accent-l: 70%;
895
+ --accent-c: 0.18;
896
+ --surface-saturation: 0.02;
897
+
898
+ /* Invert surface hierarchy for dark backgrounds */
899
+ --base: oklch(22% calc(var(--surface-saturation) * 0.9) var(--accent-h));
900
+ --bedrock: oklch(95% calc(var(--surface-saturation) * 0.7) var(--accent-h));
901
+
902
+ --surface-muted: oklch(20% calc(var(--surface-saturation) * 0.5) var(--accent-h));
903
+ --surface-subtle: oklch(21% calc(var(--surface-saturation) * 0.7) var(--accent-h));
904
+ --surface: oklch(25% var(--surface-saturation) var(--accent-h));
905
+ --surface-overt: oklch(30% calc(var(--surface-saturation) * 1.2) var(--accent-h));
906
+
907
+ /* Adjust text for dark backgrounds */
908
+ --text-muted: oklch(65% calc(var(--surface-saturation) * 1.2) var(--accent-h));
909
+ --text-subtle: oklch(75% calc(var(--surface-saturation) * 1.0) var(--accent-h));
910
+ --text: oklch(88% calc(var(--surface-saturation) * 0.8) var(--accent-h));
911
+ --text-overt: oklch(95% calc(var(--surface-saturation) * 0.6) var(--accent-h));
912
+
913
+ /* Dark mode semantic colors */
914
+ --success: oklch(65% 0.15 var(--success-h));
915
+ --warning: oklch(75% 0.15 var(--warning-h));
916
+ --error: oklch(70% 0.2 var(--error-h));
917
+ --info: oklch(75% 0.15 var(--info-h));
918
+ }
919
+ }
920
+
921
+ /* ============================================ */
922
+ /* HIGH CONTRAST MODE SUPPORT */
923
+ /* ============================================ */
924
+
925
+ @media (prefers-contrast: high) {
926
+ :root {
927
+ --contrast-factor: 1.3;
928
+ --outline-width: 2px;
929
+ --outline-width-thick: 3px;
930
+
931
+ /* Enhanced contrasts */
932
+ --text-subtle: oklch(30% 0.03 var(--accent-h));
933
+ --text-muted: oklch(25% 0.02 var(--accent-h));
934
+ --outline-focus: oklch(50% 0.3 var(--accent-h));
935
+ --outline: oklch(from var(--base) calc(l - 0.08) calc(c + var(--surface-saturation) * 2) h);
936
+ }
937
+
938
+ /* High contrast form elements */
939
+ input, select, textarea, button {
940
+ border-width: var(--outline-width-thick) !important;
941
+ }
942
+ }
943
+
944
+ /* ============================================ */
945
+ /* USAGE EXAMPLES */
946
+ /* ============================================ */
947
+
948
+ /*
949
+ Basic Usage:
950
+
951
+ <main class="bg-base text-on-base">
952
+ <header class="bg-bedrock text-on-bedrock">
953
+ <h1 class="text-overt">Title</h1>
954
+ <p class="text-subtle">Subtitle</p>
955
+ </header>
956
+
957
+ <section class="bg-surface text-on-surface">
958
+ <h2 class="text-overt">Section Title</h2>
959
+ <p class="text">Main content with <a href="#" class="text-link">links</a></p>
960
+ <div class="bg-surface-subtle text-on-surface-subtle">
961
+ <p class="text-subtle">Secondary content</p>
962
+ </div>
963
+ </section>
964
+
965
+ <button class="button-primary">Primary Action</button>
966
+ <button class="button-outline">Secondary Action</button>
967
+ <button class="button-text">Text Button</button>
968
+ </main>
969
+
970
+ Customization:
971
+
972
+ :root {
973
+ --accent-h: 45; /* Yellow theme */
974
+ --accent-c: 0.14; /* Moderate saturation */
975
+ --accent-l: 65%; /* Good lightness */
976
+ --surface-saturation: 0.012; /* Subtle surfaces */
977
+ --contrast-factor: 1.2; /* Higher contrast */
978
+ }
979
+ */