@infonomic/uikit 3.8.0 → 3.9.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 (53) hide show
  1. package/dist/components/dropdown/dropdown_module.css +1 -1
  2. package/dist/components/forms/calendar_module.css +12 -45
  3. package/dist/components/forms/radio-group_module.css +2 -2
  4. package/dist/components/notifications/alert_module.css +15 -15
  5. package/dist/components/table/table_module.css +2 -2
  6. package/dist/components/tabs/tabs_module.css +4 -5
  7. package/dist/styles/styles.css +1 -1
  8. package/dist/widgets/datepicker/datepicker.js +2 -2
  9. package/dist/widgets/datepicker/datepicker_module.css +13 -13
  10. package/dist/widgets/drawer/drawer_module.css +6 -6
  11. package/dist/widgets/modal/modal_module.css +12 -12
  12. package/dist/widgets/timeline/timeline_module.css +7 -7
  13. package/package.json +1 -1
  14. package/src/components/accordion/accordion.stories.tsx +2 -2
  15. package/src/components/avatar/avatar.stories.tsx +1 -1
  16. package/src/components/badge/badge.stories.tsx +1 -1
  17. package/src/components/button/button-group.stories.tsx +1 -1
  18. package/src/components/button/button-intents.stories.tsx +1 -1
  19. package/src/components/button/button-variants.stories.tsx +1 -1
  20. package/src/components/button/control-buttons.stories.tsx +2 -2
  21. package/src/components/button/icon-button.stories.tsx +2 -2
  22. package/src/components/card/card.stories.tsx +2 -2
  23. package/src/components/container/container.stories.tsx +2 -8
  24. package/src/components/dropdown/dropdown.module.css +1 -1
  25. package/src/components/forms/calendar.module.css +12 -58
  26. package/src/components/forms/radio-group.module.css +2 -2
  27. package/src/components/notifications/alert.module.css +15 -15
  28. package/src/components/notifications/alert.stories.tsx +1 -1
  29. package/src/components/table/table.module.css +2 -2
  30. package/src/components/tabs/tabs.module.css +7 -5
  31. package/src/components/tabs/tabs.stories.tsx +1 -1
  32. package/src/loaders/loaders.stories.tsx +1 -1
  33. package/src/styles/base/base.css +1 -0
  34. package/src/styles/base/size.css +24 -0
  35. package/src/styles/base/spacing.css +20 -17
  36. package/src/styles/functional/borders.css +23 -0
  37. package/src/styles/functional/colors.css +51 -94
  38. package/src/styles/functional/functional.css +3 -0
  39. package/src/styles/functional/grid-flex.css +11 -11
  40. package/src/styles/functional/surfaces.css +115 -0
  41. package/src/styles/functional/typography.css +44 -0
  42. package/src/styles/theme/autofill.css +14 -5
  43. package/src/styles/theme/defaults.css +75 -0
  44. package/src/styles/theme/scrollers.css +4 -2
  45. package/src/styles/theme/theme.css +15 -130
  46. package/src/styles/theme/theme.stories.tsx +1 -1
  47. package/src/styles/utils/utility-classes.css +190 -58
  48. package/src/widgets/datepicker/datepicker.module.css +13 -13
  49. package/src/widgets/datepicker/datepicker.tsx +2 -2
  50. package/src/widgets/drawer/drawer.module.css +6 -6
  51. package/src/widgets/modal/modal.module.css +12 -12
  52. package/src/widgets/timeline/timeline.module.css +7 -7
  53. package/src/styles/theme/typography.css +0 -26
@@ -1,21 +1,24 @@
1
1
  @layer infonomic-base {
2
2
  :root {
3
- /* ========================================
4
- SPACING SYSTEM (8px grid)
5
- ======================================== */
6
- --spacing-0: 0px;
7
- --spacing-1: 4px;
8
- --spacing-2: 8px;
9
- --spacing-3: 12px;
10
- --spacing-4: 16px;
11
- --spacing-5: 20px;
12
- --spacing-6: 24px;
13
- --spacing-8: 32px;
14
- --spacing-10: 40px;
15
- --spacing-12: 48px;
16
- --spacing-16: 64px;
17
- --spacing-20: 80px;
18
- --spacing-24: 96px;
19
- --spacing-32: 128px;
3
+ --spacing-0: 0;
4
+ --spacing-2: 0.125rem;
5
+ --spacing-4: 0.25rem;
6
+ --spacing-6: 0.375rem;
7
+ --spacing-8: 0.5rem;
8
+ --spacing-12: 0.75rem;
9
+ --spacing-16: 1rem;
10
+ --spacing-20: 1.25rem;
11
+ --spacing-24: 1.5rem;
12
+ --spacing-28: 1.75rem;
13
+ --spacing-32: 2rem;
14
+ --spacing-36: 2.25rem;
15
+ --spacing-40: 2.5rem;
16
+ --spacing-44: 2.75rem;
17
+ --spacing-48: 3rem;
18
+ --spacing-64: 4rem;
19
+ --spacing-80: 5rem;
20
+ --spacing-96: 6rem;
21
+ --spacing-112: 7rem;
22
+ --spacing-128: 8rem;
20
23
  }
21
24
  }
@@ -0,0 +1,23 @@
1
+ /**
2
+ * BORDER FUNCTIONAL TOKENS
3
+ *
4
+ * Semantic tokens for borders, including colors and potentially
5
+ * widths, styles, and radii in the future.
6
+ */
7
+
8
+ @layer infonomic-functional {
9
+ :root {
10
+ --border-color: var(--gray-100);
11
+ }
12
+
13
+ /* Dark mode */
14
+ .dark,
15
+ [data-theme="dark"] {
16
+ --border-color: var(--canvas-600);
17
+ }
18
+
19
+ /* Force light mode (local override) */
20
+ .not-dark {
21
+ --border-color: var(--gray-100);
22
+ }
23
+ }
@@ -26,28 +26,28 @@
26
26
  ----------------------------------------------------------------- */
27
27
 
28
28
  /* Fill tokens - for solid backgrounds (filled variant) */
29
- --fill-primary-strong: var(--primary-600);
30
- --fill-primary-strong-hover: oklch(from var(--primary-600) calc(l * 0.9) c h);
31
- --fill-primary-strong-disabled: oklch(from var(--primary-600) calc(l * 1.1) calc(c * 0.85) h);
29
+ --fill-primary-strong: var(--primary-500);
30
+ --fill-primary-strong-hover: oklch(from var(--primary-500) calc(l * 0.9) c h);
31
+ --fill-primary-strong-disabled: oklch(from var(--primary-500) calc(l * 1.1) calc(c * 0.85) h);
32
32
 
33
33
  /* Weak fill - for subtle backgrounds (outlined hover states) */
34
- --fill-primary-weak: oklch(from var(--primary-600) calc(l * 2.15) calc(c * 0.2) h);
34
+ --fill-primary-weak: oklch(from var(--primary-500) calc(l * 2.04) calc(c * 0.2) h);
35
35
  --fill-primary-weak-hover: oklch(from var(--canvas-50) calc(l * 0.995) c h);
36
36
 
37
37
  /* Text tokens - for foreground colors */
38
38
  --text-on-primary: white; /* Text on primary fill */
39
39
  --text-on-primary-disabled: oklch(from white calc(l * 0.9) calc(c * 0.85) h);
40
- --text-primary-strong: var(--primary-700); /* Primary-colored text (outlined, text variants) */
41
- --text-primary-weak: oklch(from var(--primary-600) calc(l * 0.7) c h); /* Muted primary text */
42
- --text-primary-disabled: oklch(from var(--primary-700) calc(l * 1.5) calc(c * 0.5) h);
40
+ --text-primary-strong: var(--primary-600); /* Primary-colored text (outlined, text variants) */
41
+ --text-primary-weak: oklch(from var(--primary-500) calc(l * 0.7) c h); /* Muted primary text */
42
+ --text-primary-disabled: oklch(from var(--primary-600) calc(l * 1.5) calc(c * 0.5) h);
43
43
 
44
44
  /* Stroke tokens - for borders */
45
- --stroke-primary: var(--primary-700);
46
- --stroke-primary-hover: oklch(from var(--primary-700) calc(l * 0.85) c h);
47
- --stroke-primary-disabled: oklch(from var(--primary-700) calc(l * 1.5) calc(c * 0.8) h);
45
+ --stroke-primary: var(--primary-600);
46
+ --stroke-primary-hover: oklch(from var(--primary-600) calc(l * 0.85) c h);
47
+ --stroke-primary-disabled: oklch(from var(--primary-600) calc(l * 1.5) calc(c * 0.8) h);
48
48
 
49
49
  /* Ring tokens - for focus states */
50
- --ring-primary: var(--primary-600);
50
+ --ring-primary: var(--primary-500);
51
51
 
52
52
  /* Gradient tokens */
53
53
  --gradient-primary-start: var(--primary-500);
@@ -210,53 +210,38 @@
210
210
  --gradient-danger-end: var(--red-700);
211
211
  --gradient-danger-foreground: white;
212
212
  --gradient-danger-disabled: oklch(from var(--red-700) calc(l * 1.2) calc(c * 0.85) h);
213
-
214
- /* SURFACE TOKENS (for panels, dropdowns, menus, lists)
215
- ----------------------------------------------------------------- */
216
-
217
- /* Panel/container backgrounds */
218
- --surface-panel: var(--canvas-25);
219
- --surface-panel-elevated: white; /* For dropdowns/popovers with shadow */
220
- --surface-panel-border: var(--border-color);
221
-
222
- /* Item backgrounds (default transparent, inherits panel) */
223
- --surface-item: transparent;
224
- --surface-item-hover: var(--canvas-50);
225
- --surface-item-active: var(--canvas-100);
226
-
227
- /* Item text colors */
228
- --surface-item-text: var(--text);
229
- --surface-item-text-hover: var(--text);
230
- --surface-item-text-active: var(--text);
231
- --surface-item-text-disabled: var(--gray-400);
232
-
233
- /* Panel scrollers */
234
- --surface-panel-scrollbar: var(--gray-50);
235
- --surface-panel-scrollbar-thumb: var(--primary-100);
236
213
 
237
214
  }
238
215
 
239
- /* ===================================================================
240
- DARK MODE
241
- =================================================================== */
242
- .dark {
216
+
217
+ /* 🌙 Dark via `.dark` class or [data-theme="dark"] attribute.
218
+ * We rely on the consuming application to detect a user's
219
+ * preferred color scheme - either by header or cookie, and to set
220
+ * a root html class accordingly (for now), which unfortunately means
221
+ * relying on either a server-side render or JS to set the theme
222
+ * on initial load.
223
+ */
224
+ .dark,
225
+ [data-theme="dark"],
226
+ [data-theme="dark"] ::backdrop
227
+ {
243
228
  /* PRIMARY INTENT TOKENS (Dark Mode)
244
229
  ----------------------------------------------------------------- */
245
230
 
246
231
  /* Fill tokens */
247
- --fill-primary-strong: var(--primary-600);
248
- --fill-primary-strong-hover: oklch(from var(--primary-600) calc(l * 0.9) c h);
249
- --fill-primary-strong-disabled: oklch(from var(--primary-600) calc(l * 0.85) calc(c * 0.85) h);
232
+ --fill-primary-strong: var(--primary-500);
233
+ --fill-primary-strong-hover: oklch(from var(--primary-500) calc(l * 0.9) c h);
234
+ --fill-primary-strong-disabled: oklch(from var(--primary-500) calc(l * 0.85) calc(c * 0.85) h);
250
235
 
251
236
  /* Weak fill - adjusted for dark backgrounds */
252
- --fill-primary-weak: oklch(from var(--primary-600) calc(l * 0.45) calc(c * 0.1) h);
237
+ --fill-primary-weak: oklch(from var(--primary-500) calc(l * 0.45) calc(c * 0.1) h);
253
238
  --fill-primary-weak-hover: var(--canvas-800);
254
239
 
255
240
  /* Text tokens */
256
241
  --text-on-primary: white; /* Same as light mode */
257
242
  --text-on-primary-disabled: oklch(from white calc(l * 0.85) calc(c * 0.85) h);
258
243
  --text-primary-strong: var(--primary-100); /* Lighter for dark backgrounds */
259
- --text-primary-weak: var(--primary-600); /* Used for text variant */
244
+ --text-primary-weak: var(--primary-500); /* Used for text variant */
260
245
  --text-primary-disabled: oklch(from var(--primary-100) calc(l * 0.8) calc(c * 0.8) h);
261
246
 
262
247
  /* Stroke tokens */
@@ -265,7 +250,7 @@
265
250
  --stroke-primary-disabled: oklch(from var(--primary-500) calc(l * 0.8) calc(c * 0.8) h);
266
251
 
267
252
  /* Ring tokens */
268
- --ring-primary: var(--primary-600);
253
+ --ring-primary: var(--primary-500);
269
254
 
270
255
  /* Gradient tokens */
271
256
  --gradient-primary-start: var(--primary-500);
@@ -424,70 +409,42 @@
424
409
  --gradient-danger-foreground: white;
425
410
  --gradient-danger-disabled: oklch(from var(--red-700) calc(l * 0.85) calc(c * 0.85) h);
426
411
 
427
- /* SURFACE TOKENS (Dark Mode)
428
- ----------------------------------------------------------------- */
429
-
430
- /* Panel/container backgrounds - slightly elevated from canvas-900 base */
431
- --surface-panel: var(--canvas-800);
432
- --surface-panel-elevated: var(--canvas-800);
433
- --surface-panel-border: var(--border-color);
434
-
435
- /* Item backgrounds - lighter than panel for hover/active */
436
- --surface-item: transparent;
437
- --surface-item-hover: var(--canvas-700);
438
- --surface-item-active: var(--canvas-600);
439
-
440
- /* Item text colors */
441
- --surface-item-text: var(--text);
442
- --surface-item-text-hover: var(--text);
443
- --surface-item-text-active: var(--text);
444
- --surface-item-text-disabled: var(--gray-500);
445
-
446
- /* Panel scrollers */
447
- --surface-panel-scrollbar: var(--canvas-700);
448
- --surface-panel-scrollbar-thumb: var(--primary-400);
449
412
  }
450
413
 
451
414
  /* ===================================================================
452
- .NOT-DARK OVERRIDE
453
- }
454
-
455
- /* .not-dark override: Forces light mode tokens by re-declaring :root values.
456
- * This duplication is intentional - it ensures .not-dark always wins over .dark
457
- * regardless of DOM order, without needing complex :not() selectors.
458
- * Alternative approaches (revert-layer, :not() patterns) would be more fragile.
415
+ * .NOT-DARK OVERRIDE
416
+ * .not-dark override: Forces light mode tokens by re-declaring :root values.
417
+ * This duplication is intentional - it ensures .not-dark always wins over .dark
418
+ * regardless of DOM order, without needing complex :not() selectors.
419
+ * Alternative approaches (revert-layer, :not() patterns) would be more fragile.
459
420
  */
460
-
461
- /* ===================================================================
462
- .NOT-DARK OVERRIDE
463
- Forces light mode tokens regardless of parent .dark class
464
- =================================================================== */
465
421
  .not-dark {
466
422
  /* PRIMARY INTENT TOKENS (Force Light Mode)
467
423
  ----------------------------------------------------------------- */
468
424
 
469
- /* Fill tokens - identical to :root light mode */
470
- --fill-primary-strong: var(--primary-600);
471
- --fill-primary-strong-hover: oklch(from var(--primary-600) calc(l * 0.9) c h);
472
- --fill-primary-strong-disabled: oklch(from var(--primary-600) calc(l * 1.1) calc(c * 0.85) h);
425
+ /* Fill tokens - for solid backgrounds (filled variant) */
426
+ --fill-primary-strong: var(--primary-500);
427
+ --fill-primary-strong-hover: oklch(from var(--primary-500) calc(l * 0.9) c h);
428
+ --fill-primary-strong-disabled: oklch(from var(--primary-500) calc(l * 1.1) calc(c * 0.85) h);
473
429
 
474
- --fill-primary-weak: oklch(from var(--primary-600) calc(l * 2.15) calc(c * 0.2) h);
430
+ /* Weak fill - for subtle backgrounds (outlined hover states) */
431
+ --fill-primary-weak: oklch(from var(--primary-500) calc(l * 2.04) calc(c * 0.2) h);
475
432
  --fill-primary-weak-hover: oklch(from var(--canvas-50) calc(l * 0.995) c h);
476
433
 
477
- /* Text tokens */
478
- --text-on-primary: white;
434
+ /* Text tokens - for foreground colors */
435
+ --text-on-primary: white; /* Text on primary fill */
479
436
  --text-on-primary-disabled: oklch(from white calc(l * 0.9) calc(c * 0.85) h);
480
- --text-primary-strong: var(--primary-700);
481
- --text-primary-weak: oklch(from var(--primary-600) calc(l * 0.7) c h);
482
- --text-primary-disabled: oklch(from var(--primary-700) calc(l * 1.5) calc(c * 0.5) h);
437
+ --text-primary-strong: var(--primary-600); /* Primary-colored text (outlined, text variants) */
438
+ --text-primary-weak: oklch(from var(--primary-500) calc(l * 0.7) c h); /* Muted primary text */
439
+ --text-primary-disabled: oklch(from var(--primary-600) calc(l * 1.5) calc(c * 0.5) h);
483
440
 
484
- /* Stroke tokens */
485
- --stroke-primary: var(--primary-700);
486
- --stroke-primary-hover: oklch(from var(--primary-700) calc(l * 0.85) c h);
487
- --stroke-primary-disabled: oklch(from var(--primary-700) calc(l * 1.5) calc(c * 0.8) h);
441
+ /* Stroke tokens - for borders */
442
+ --stroke-primary: var(--primary-600);
443
+ --stroke-primary-hover: oklch(from var(--primary-600) calc(l * 0.85) c h);
444
+ --stroke-primary-disabled: oklch(from var(--primary-600) calc(l * 1.5) calc(c * 0.8) h);
488
445
 
489
- /* Ring tokens */
490
- --ring-primary: var(--primary-600);
446
+ /* Ring tokens - for focus states */
447
+ --ring-primary: var(--primary-500);
491
448
 
492
449
  /* Gradient tokens */
493
450
  --gradient-primary-start: var(--primary-500);
@@ -1,2 +1,5 @@
1
1
  @import "./colors.css";
2
+ @import "./surfaces.css";
3
+ @import "./typography.css";
4
+ @import "./borders.css";
2
5
  @import "./grid-flex.css";
@@ -26,19 +26,19 @@
26
26
  GAP SYSTEM (For Grid & Flexbox)
27
27
  ======================================== */
28
28
  --gap-0: var(--spacing-0);
29
- --gap-1: var(--spacing-1);
30
- --gap-2: var(--spacing-2);
31
- --gap-3: var(--spacing-3);
32
- --gap-4: var(--spacing-4);
33
- --gap-5: var(--spacing-5);
29
+ --gap-1: var(--spacing-4);
30
+ --gap-2: var(--spacing-8);
31
+ --gap-3: var(--spacing-12);
32
+ --gap-4: var(--spacing-16);
33
+ --gap-5: var(--spacing-20);
34
34
  --gap-6: var(--spacing-6);
35
35
  --gap-8: var(--spacing-8);
36
- --gap-10: var(--spacing-10);
37
- --gap-12: var(--spacing-12);
38
- --gap-16: var(--spacing-16);
39
- --gap-20: var(--spacing-20);
40
- --gap-24: var(--spacing-24);
41
- --gap-32: var(--spacing-32);
36
+ --gap-10: var(--spacing-40);
37
+ --gap-12: var(--spacing-48);
38
+ --gap-16: var(--spacing-64);
39
+ --gap-20: var(--spacing-80);
40
+ --gap-24: var(--spacing-96);
41
+ --gap-32: var(--spacing-128);
42
42
 
43
43
  /* ========================================
44
44
  FLEXBOX HELPERS
@@ -0,0 +1,115 @@
1
+ /**
2
+ * SURFACE FUNCTIONAL TOKENS
3
+ *
4
+ * Semantic tokens for surfaces, backgrounds, shadows, and depth.
5
+ * These tokens define the canvas on which content sits.
6
+ */
7
+
8
+ @layer infonomic-functional {
9
+ :root {
10
+ --background: var(--canvas-25);
11
+ --foreground: var(--gray-900);
12
+ --shadow: var(--shadow-md);
13
+ --loader-color: var(--fill-primary-strong);
14
+
15
+ /* SURFACE TOKENS (for panels, dropdowns, menus, lists)
16
+ ----------------------------------------------------------------- */
17
+
18
+ /* Panel/container backgrounds */
19
+ --surface-panel: var(--canvas-25);
20
+ --surface-panel-elevated: white; /* For dropdowns/popovers with shadow */
21
+ --surface-panel-border: var(--border-color);
22
+
23
+ /* Item backgrounds (default transparent, inherits panel) */
24
+ --surface-item: transparent;
25
+ --surface-item-hover: var(--canvas-50);
26
+ --surface-item-active: var(--canvas-100);
27
+
28
+ /* Item text colors */
29
+ --surface-item-text: var(--text);
30
+ --surface-item-text-hover: var(--text);
31
+ --surface-item-text-active: var(--text);
32
+ --surface-item-text-disabled: var(--gray-400);
33
+
34
+ /* Panel scrollers */
35
+ --surface-panel-scrollbar: var(--gray-50);
36
+ --surface-panel-scrollbar-thumb: var(--primary-100);
37
+ }
38
+
39
+ /* 🌙 Dark via `.dark` class or [data-theme="dark"] attribute.
40
+ * We rely on the consuming application to detect a user's
41
+ * preferred color scheme - either by header or cookie, and to set
42
+ * a root html class accordingly (for now), which unfortunately means
43
+ * relying on either a server-side render or JS to set the theme
44
+ * on initial load.
45
+ */
46
+ .dark,
47
+ [data-theme="dark"],
48
+ [data-theme="dark"] ::backdrop
49
+ {
50
+ --background: var(--canvas-900);
51
+ --foreground: var(--gray-50);
52
+ --shadow: var(--shadow-lg);
53
+ --loader-color: var(--fill-primary-strong);
54
+
55
+ /* SURFACE TOKENS (Dark Mode)
56
+ ----------------------------------------------------------------- */
57
+
58
+ /* Panel/container backgrounds - slightly elevated from canvas-900 base */
59
+ --surface-panel: var(--canvas-800);
60
+ --surface-panel-elevated: var(--canvas-800);
61
+ --surface-panel-border: var(--border-color);
62
+
63
+ /* Item backgrounds - lighter than panel for hover/active */
64
+ --surface-item: transparent;
65
+ --surface-item-hover: var(--canvas-700);
66
+ --surface-item-active: var(--canvas-600);
67
+
68
+ /* Item text colors */
69
+ --surface-item-text: var(--text);
70
+ --surface-item-text-hover: var(--text);
71
+ --surface-item-text-active: var(--text);
72
+ --surface-item-text-disabled: var(--gray-500);
73
+
74
+ /* Panel scrollers */
75
+ --surface-panel-scrollbar: var(--canvas-700);
76
+ --surface-panel-scrollbar-thumb: var(--primary-400);
77
+ }
78
+
79
+ /* ===================================================================
80
+ * .NOT-DARK OVERRIDE
81
+ * .not-dark override: Forces light mode tokens by re-declaring :root values.
82
+ * This duplication is intentional - it ensures .not-dark always wins over .dark
83
+ * regardless of DOM order, without needing complex :not() selectors.
84
+ * Alternative approaches (revert-layer, :not() patterns) would be more fragile.
85
+ */
86
+ .not-dark {
87
+ --background: var(--canvas-25);
88
+ --foreground: var(--gray-900);
89
+ --shadow: var(--shadow-md);
90
+ --loader-color: var(--fill-primary-strong);
91
+
92
+ /* SURFACE TOKENS (for panels, dropdowns, menus, lists)
93
+ ----------------------------------------------------------------- */
94
+
95
+ /* Panel/container backgrounds */
96
+ --surface-panel: var(--canvas-25);
97
+ --surface-panel-elevated: white; /* For dropdowns/popovers with shadow */
98
+ --surface-panel-border: var(--border-color);
99
+
100
+ /* Item backgrounds (default transparent, inherits panel) */
101
+ --surface-item: transparent;
102
+ --surface-item-hover: var(--canvas-50);
103
+ --surface-item-active: var(--canvas-100);
104
+
105
+ /* Item text colors */
106
+ --surface-item-text: var(--text);
107
+ --surface-item-text-hover: var(--text);
108
+ --surface-item-text-active: var(--text);
109
+ --surface-item-text-disabled: var(--gray-400);
110
+
111
+ /* Panel scrollers */
112
+ --surface-panel-scrollbar: var(--gray-50);
113
+ --surface-panel-scrollbar-thumb: var(--primary-100);
114
+ }
115
+ }
@@ -0,0 +1,44 @@
1
+ /**
2
+ * TYPOGRAPHY FUNCTIONAL TOKENS
3
+ *
4
+ * Semantic tokens for text colors and typography-related variables.
5
+ * Separate from typography.css in the typography/ directory which defines
6
+ * actual typographic styles and scales.
7
+ */
8
+
9
+ @layer infonomic-functional {
10
+ :root {
11
+ --text: var(--gray-900);
12
+ --headings: var(--primary-700);
13
+ --muted: oklch(from var(--foreground) calc(l * 2) c h);
14
+ }
15
+
16
+ /* 🌙 Dark via `.dark` class or [data-theme="dark"] attribute.
17
+ * We rely on the consuming application to detect a user's
18
+ * preferred color scheme - either by header or cookie, and to set
19
+ * a root html class accordingly (for now), which unfortunately means
20
+ * relying on either a server-side render or JS to set the theme
21
+ * on initial load.
22
+ */
23
+ .dark,
24
+ [data-theme="dark"],
25
+ [data-theme="dark"] ::backdrop
26
+ {
27
+ --text: var(--gray-50);
28
+ --headings: var(--gray-50);
29
+ --muted: oklch(from var(--foreground) calc(l * 0.75) c h);
30
+ }
31
+
32
+ /* ===================================================================
33
+ * .NOT-DARK OVERRIDE
34
+ * .not-dark override: Forces light mode tokens by re-declaring :root values.
35
+ * This duplication is intentional - it ensures .not-dark always wins over .dark
36
+ * regardless of DOM order, without needing complex :not() selectors.
37
+ * Alternative approaches (revert-layer, :not() patterns) would be more fragile.
38
+ */
39
+ .not-dark {
40
+ --text: var(--gray-900);
41
+ --headings: var(--primary-800);
42
+ --muted: oklch(from var(--foreground) calc(l * 2) c h);
43
+ }
44
+ }
@@ -32,10 +32,10 @@ select:-webkit-autofill:focus, select:autofill:focus {
32
32
  background-color: rgb(250, 217, 167) !important;
33
33
  }
34
34
 
35
- /* 🌙 Dark via `.dark` class. We rely on the
36
- * consuming application to detect a user's preferred
37
- * color scheme - either by header or cookie. and set
38
- * a root html class accordingly
35
+ /* 🌙 Dark via `.dark` class or [data-theme="dark"] attribute.
36
+ * We rely on the consuming application to detect a user's preferred
37
+ * color scheme - either by header or cookie, and set a root html
38
+ * class or data attribute accordingly.
39
39
  */
40
40
 
41
41
  .dark input:autofill,
@@ -46,7 +46,16 @@ select:-webkit-autofill:focus, select:autofill:focus {
46
46
  .dark textarea:autofill:focus,
47
47
  .dark select:autofill,
48
48
  .dark select:autofill:hover,
49
- .dark select:autofill:focus {
49
+ .dark select:autofill:focus,
50
+ [data-theme="dark"] input:autofill,
51
+ [data-theme="dark"] input:autofill:hover,
52
+ [data-theme="dark"] input:autofill:focus,
53
+ [data-theme="dark"] textarea:autofill,
54
+ [data-theme="dark"] textarea:autofill:hover,
55
+ [data-theme="dark"] textarea:autofill:focus,
56
+ [data-theme="dark"] select:autofill,
57
+ [data-theme="dark"] select:autofill:hover,
58
+ [data-theme="dark"] select:autofill:focus {
50
59
  border: 1px solid var(--theme-600) !important;
51
60
  -webkit-text-fill-color: white !important;
52
61
  -webkit-box-shadow: 0 0 0px 1000px var(--theme-600) inset !important;
@@ -0,0 +1,75 @@
1
+ /**
2
+ * HTML ELEMENT DEFAULTS
3
+ *
4
+ * Opinionated starter styles for HTML elements to provide sensible defaults
5
+ * for new installations. These live in the infonomic-theme layer and are
6
+ * easily overridden by consuming applications.
7
+ */
8
+
9
+ @layer infonomic-theme {
10
+ html {
11
+ font-size: 1rem;
12
+ color: var(--text);
13
+ }
14
+
15
+ /* Redeclared here to change the specificity and scope of --prose-body */
16
+ html .not-dark {
17
+ color: var(--text);
18
+ }
19
+
20
+ /* Default (light mode) */
21
+ ::selection {
22
+ background-color: var(--theme-600);
23
+ color: white;
24
+ }
25
+
26
+ /* Dark mode */
27
+ .dark ::selection,
28
+ [data-theme="dark"] ::selection {
29
+ background-color: var(--theme-200);
30
+ color: var(--gray-900);
31
+ }
32
+
33
+ /* Headings */
34
+ h1 {
35
+ font-size: 1.75rem;
36
+ font-weight: 600;
37
+ line-height: 1.125;
38
+ }
39
+
40
+ h2 {
41
+ font-size: 1.5rem;
42
+ font-weight: 600;
43
+ line-height: 1.125;
44
+ }
45
+
46
+ h3 {
47
+ font-size: 1.25rem;
48
+ font-weight: 600;
49
+ line-height: 1.1;
50
+ }
51
+
52
+ h4 {
53
+ font-size: 1rem;
54
+ font-weight: 600;
55
+ line-height: 1.1;
56
+ }
57
+
58
+ /* External link indicator */
59
+ .external-link::after {
60
+ content: "";
61
+ display: inline-block;
62
+ background-image: url("/external-link-light.svg");
63
+ background-repeat: no-repeat;
64
+ background-position: 20% 50%;
65
+ background-size: 65% auto;
66
+ width: 1.1rem;
67
+ height: 1.1rem;
68
+ margin-right: -5px;
69
+ }
70
+
71
+ .dark .external-link::after,
72
+ [data-theme="dark"] .external-link::after {
73
+ background-image: url("/external-link-dark.svg");
74
+ }
75
+ }
@@ -5,7 +5,8 @@
5
5
  }
6
6
 
7
7
  /* rgb(44, 47, 86) = theme secondary 900 */
8
- :root.dark {
8
+ :root.dark,
9
+ :root[data-theme="dark"] {
9
10
  --scroll-bar-thumb: var(--canvas-700);
10
11
  --scroll-bar-track: var(--canvas-900);
11
12
  }
@@ -39,7 +40,8 @@
39
40
  --scroll-bar-track: var(--scroll-bar-track);
40
41
  }
41
42
 
42
- .dark .component--scroller {
43
+ .dark .component--scroller,
44
+ [data-theme="dark"] .component--scroller {
43
45
  --scroll-bar-thumb: var(--scroll-bar-thumb);
44
46
  --scroll-bar-track: var(--scroll-bar-track);
45
47
  }