@webority/theme 0.99.0 → 0.100.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 (75) hide show
  1. package/README.md +9 -9
  2. package/dist/published-theme.json +8 -31
  3. package/dist/purge-safelist.json +1 -0
  4. package/dist/webority-theme.css +1 -1
  5. package/index.scss +4 -3
  6. package/package.json +6 -3
  7. package/scss/_bootstrap.generated.scss +18 -0
  8. package/scss/_components.scss +38 -38
  9. package/scss/_marketing.scss +8 -8
  10. package/scss/_tokens.generated.scss +831 -0
  11. package/scss/_tokens.scss +4 -638
  12. package/scss/_variables.scss +7 -12
  13. package/scss/_wui-components.scss +1 -1
  14. package/scss/_wui-residual.scss +8 -0
  15. package/scss/wui/_avatar-picker.scss +2 -2
  16. package/scss/wui/_calendar.scss +6 -6
  17. package/scss/wui/_card.scss +1 -1
  18. package/scss/wui/_carousel.scss +2 -2
  19. package/scss/wui/_chart-card.scss +2 -2
  20. package/scss/wui/_chart.scss +8 -8
  21. package/scss/wui/_chat.scss +2 -2
  22. package/scss/wui/_choice.scss +78 -78
  23. package/scss/wui/_code-block.scss +2 -2
  24. package/scss/wui/_command-palette.scss +9 -9
  25. package/scss/wui/_comment-thread.scss +5 -5
  26. package/scss/wui/_consent-banner.scss +2 -2
  27. package/scss/wui/_controls.scss +52 -52
  28. package/scss/wui/_data.scss +38 -38
  29. package/scss/wui/_disclosure.scss +6 -6
  30. package/scss/wui/_display.scss +51 -51
  31. package/scss/wui/_dock.scss +4 -4
  32. package/scss/wui/_drawer.scss +3 -3
  33. package/scss/wui/_file-viewer.scss +2 -2
  34. package/scss/wui/_filter-popover.scss +1 -1
  35. package/scss/wui/_floating.scss +1 -1
  36. package/scss/wui/_flow.scss +60 -60
  37. package/scss/wui/_groups.scss +7 -7
  38. package/scss/wui/_hover-card.scss +1 -1
  39. package/scss/wui/_image-crop.scss +3 -3
  40. package/scss/wui/_interaction.scss +3 -3
  41. package/scss/wui/_kanban.scss +4 -4
  42. package/scss/wui/_lightbox.scss +2 -2
  43. package/scss/wui/_media.scss +28 -28
  44. package/scss/wui/_mention-input.scss +4 -4
  45. package/scss/wui/_menu-motion.scss +1 -1
  46. package/scss/wui/_modal-remote.scss +2 -2
  47. package/scss/wui/_navigation-menu.scss +4 -4
  48. package/scss/wui/_navigation.scss +25 -25
  49. package/scss/wui/_notification-center.scss +4 -4
  50. package/scss/wui/_onboarding-checklist.scss +2 -2
  51. package/scss/wui/_overlays.scss +21 -21
  52. package/scss/wui/_pending.scss +1 -1
  53. package/scss/wui/_rich-text.scss +7 -7
  54. package/scss/wui/_rolling-number.scss +1 -1
  55. package/scss/wui/_score-scale.scss +1 -1
  56. package/scss/wui/_sections.scss +8 -8
  57. package/scss/wui/_shell-parts.scss +15 -15
  58. package/scss/wui/_shell.scss +20 -20
  59. package/scss/wui/_shortcuts.scss +1 -1
  60. package/scss/wui/_sortable.scss +2 -2
  61. package/scss/wui/_split-view.scss +4 -4
  62. package/scss/wui/_theme-toggle.scss +1 -1
  63. package/scss/wui/_tone-pill.scss +2 -2
  64. package/scss/wui/_toolbar.scss +2 -2
  65. package/scss/wui/_tree.scss +3 -3
  66. package/scss/wui/_typography.scss +6 -6
  67. package/scss/wui/_utilities.scss +27 -19
  68. package/scss/wui/_whats-new.scss +4 -4
  69. package/scss/wui/_workspace.scss +16 -16
  70. package/scss/wui/tour/_advance.scss +1 -1
  71. package/scss/wui/tour/_base.scss +1 -1
  72. package/scss/wui/tour/_end.scss +1 -1
  73. package/scss/wui/tour/_motion.scss +1 -1
  74. package/token-meanings.json +56 -64
  75. package/scss/_wui-aliases.scss +0 -495
@@ -1,495 +0,0 @@
1
- // Portal component token aliases.
2
- //
3
- // The extracted component CSS (_wui-components.scss) references --color-* /
4
- // --radius-* / --shadow-* names. Those are aliases onto the canonical --wui-*
5
- // design tokens, so the component layer is self-contained: a consumer that
6
- // imports the theme gets the components fully styled, with no app-local token
7
- // layer required. Alias only — never declare a brand hex here.
8
-
9
- :root {
10
- // Surfaces
11
- /// meaning: Page background behind the content area.
12
- --color-bg: var(--wui-bg-page);
13
- /// meaning: Subtle raised background for side panels and bands.
14
- --color-bg-subtle: var(--wui-bg-elevated);
15
- /// meaning: Muted background for grouped areas and quiet controls.
16
- --color-bg-muted: var(--wui-bg-muted);
17
- /// meaning: Resting fill of input-like controls such as fields and selects.
18
- --color-field-bg: var(--wui-field-bg);
19
- /// meaning: Card and panel surface.
20
- --color-surface: var(--wui-bg-light);
21
-
22
- // Borders
23
- /// meaning: Hairline border of cards, tables and dividers.
24
- --color-border: var(--wui-border-light);
25
- /// meaning: Softest border for inner dividers and list edges.
26
- --color-border-light: var(--wui-border-soft);
27
- /// meaning: Stronger border for emphasised separators.
28
- --color-border-strong: var(--wui-border-strong);
29
- // The resting and hover border of an input-like control.
30
- // Decorative card and table borders stay on --color-border.
31
- /// meaning: Resting border of an input-like control such as a field or select.
32
- --color-field-border: var(--wui-field-border);
33
- /// meaning: Hover border of an input-like control.
34
- --color-field-border-hover: var(--wui-field-border-hover);
35
- /// meaning: Unfilled track of a progress bar.
36
- --color-progress-track: var(--wui-progress-track);
37
- // Label text inside a progress bar fill.
38
- /// meaning: Label text inside a progress bar fill.
39
- --color-progress-label: var(--wui-bg-light);
40
- // Icon ink on a solid status fill (the filled timeline dots): white in both modes, by design
41
- // choice. White on the bright success and warning fills sits under the 3:1 icon floor, so the
42
- // contrast gate does not measure this pair.
43
- /// meaning: Icon ink on a solid status fill, such as a filled timeline dot.
44
- --color-on-status-fill: #FFFFFF;
45
- // Ink on a DEEP status fill (the -text tokens, used as a fill the way primary is): white in
46
- // light mode, where those shades measure 5.5 to 6.2:1; near-black in dark mode, where -text is
47
- // the bright fill.
48
- /// meaning: Ink on a deep status fill used as a surface, such as a status badge.
49
- --color-on-status-strong: #FFFFFF;
50
-
51
- // Text ramp
52
- /// meaning: Main heading and body ink.
53
- --color-text: var(--wui-text-heading);
54
- // Body copy on a tinted surface (alert bodies): a step softer than the heading ink.
55
- /// meaning: Body copy on a tinted surface such as an alert body.
56
- --color-text-body: var(--wui-text-1);
57
- // A dark-ink glyph such as Bootstrap's .btn-close needs no filter on a light surface.
58
- /// meaning: Filter applied to a dark-ink close glyph such as the alert close button.
59
- --color-close-filter: none;
60
- // The border of a focused / open / active control (input, select, OTP slot, dropzone).
61
- // The soft primary tint, matching the soft resting border.
62
- /// meaning: Border of a focused, open or active control such as an input or select.
63
- --color-focus-border: var(--wui-primary-30);
64
- // The keyboard focus ring every control draws on :focus-visible: an outline of this colour,
65
- // width and offset. The primary ink clears 4.5:1 on every light surface and the dark primary
66
- // on every dark one, so the ring keeps 3:1 whatever the brand. A coloured surface (a scrim, a
67
- // brand hero) resets --color-focus-ring for its subtree. Inside a scroller that would clip an
68
- // outer ring, the ring is drawn inset with --wui-focus-ring-inset.
69
- /// meaning: Colour of the keyboard focus ring drawn on focus-visible controls.
70
- --color-focus-ring: var(--color-primary-ink);
71
- /// meaning: Width of the keyboard focus ring.
72
- --wui-focus-ring-width: 2px;
73
- /// meaning: Gap between a control and its keyboard focus ring.
74
- --wui-focus-ring-offset: 2px;
75
- /// meaning: Offset that draws the focus ring inside a scrolling container.
76
- --wui-focus-ring-inset: calc(-1 * var(--wui-focus-ring-width));
77
- // Pressed: a translucent wash of the control's own ink laid over whatever fill it has, so it
78
- // reads one step deeper than hover on any surface and in either theme, with no motion.
79
- /// meaning: Translucent wash laid over a control while it is pressed.
80
- --color-pressed-overlay: color-mix(in srgb, currentColor 12%, transparent);
81
- /// meaning: Scale a control shrinks to while it is pressed.
82
- --wui-press-scale: 0.96;
83
- /// meaning: Duration of the pressed feedback on a control.
84
- --wui-press-duration: 80ms;
85
- // Disabled: one opacity for every control that dims as a whole (a checkbox, a segmented option, a
86
- // chip, a tab, an icon button). A text field does not dim; it takes the deeper disabled fill.
87
- /// meaning: Opacity of a control that dims as a whole when disabled.
88
- --wui-disabled-opacity: 0.5;
89
- // The raised thumb that marks the selected option of a segmented control: white in light mode.
90
- /// meaning: Raised thumb that marks the selected option of a segmented control.
91
- --color-thumb: var(--wui-bg-light);
92
- /// meaning: Secondary text for descriptions and muted copy.
93
- --color-text-muted: var(--wui-text-2);
94
- /// meaning: Tertiary text for hints, captions, timestamps and placeholders.
95
- --color-text-subtle: var(--wui-text-3);
96
-
97
- // Bootstrap colour vars bridged onto app tokens so un-tokenised BS text
98
- // flips with data-theme.
99
- --bs-body-color: var(--color-text);
100
- --bs-emphasis-color: var(--color-text);
101
- --bs-secondary-color: var(--color-text-muted);
102
- --bs-tertiary-color: var(--color-text-subtle);
103
- --bs-body-bg: var(--color-bg);
104
- --bs-border-color: var(--color-border);
105
-
106
- // Brand
107
- /// meaning: Primary fill for buttons, selected states and borders.
108
- --color-primary: var(--wui-primary);
109
- /// meaning: Primary fill while a control is hovered or pressed.
110
- --color-primary-hover: var(--wui-primary-pressed);
111
- /// meaning: Soft primary tint behind selected and highlighted rows.
112
- --color-primary-soft: var(--wui-primary-10);
113
- // Text/icon colour for content sitting ON a solid --color-primary fill — see
114
- // --wui-primary-text for why this is a different axis from the -text tokens below.
115
- /// meaning: Text and icon colour on a solid primary fill.
116
- --color-primary-text: var(--wui-primary-text);
117
- // Label on the pressed primary fill (--color-primary-hover); the hover and press states read it.
118
- /// meaning: Label on the hovered or pressed primary fill.
119
- --color-primary-hover-text: var(--wui-primary-text);
120
- // The primary as TEXT or a small glyph on a light surface: AA-safe whatever the brand (see
121
- // --wui-primary-ink). --color-primary stays the fill, border and focus colour.
122
- /// meaning: Primary as text and small glyphs on light surfaces, passing AA contrast.
123
- --color-primary-ink: var(--wui-primary-ink);
124
- // Ink on the primary ink used as a fill (the active step badge): the ink clears 4.5:1 against
125
- // white by construction, so white in light mode; near-black on the lifted dark primary.
126
- /// meaning: Ink on the primary ink used as a solid fill, such as the active step badge.
127
- --color-on-primary-ink: #FFFFFF;
128
-
129
- // Semantic status ramps
130
- /// meaning: Info ink for icons and active states.
131
- --color-info-active: var(--wui-info-active);
132
- /// meaning: Vivid info fill for badges and dots.
133
- --color-info: var(--wui-info);
134
- /// meaning: Info border tone and the strongest soft info fill.
135
- --color-info-50: var(--wui-info-50);
136
- /// meaning: Info tint for soft fills and borders of alerts and badges.
137
- --color-info-30: var(--wui-info-30);
138
- /// meaning: Info tint behind info alerts and badges.
139
- --color-info-20: var(--wui-info-20);
140
- /// meaning: Soft background of info alerts and badges.
141
- --color-info-10: var(--wui-info-10);
142
- /// meaning: Faintest info wash for hover and soft backgrounds.
143
- --color-info-5: var(--wui-info-5);
144
- // No dedicated --wui-info-strong; active is the deepest info fill.
145
- /// meaning: Deepest info fill, used where a strong info fill is needed.
146
- --color-info-strong: var(--wui-info-active);
147
- /// meaning: Soft info background for alerts.
148
- --color-info-soft: var(--color-info-10);
149
- // Use this — never --color-info — when the colour IS the text.
150
- /// meaning: Info colour as text on light surfaces.
151
- --color-info-text: var(--wui-info-text);
152
- /// meaning: Info text on a soft info tint, such as an alert heading.
153
- --color-info-text-on-soft: var(--wui-info-text);
154
-
155
- /// meaning: Success ink for icons and active states.
156
- --color-success-active: var(--wui-success-active);
157
- /// meaning: Vivid success fill for badges and dots.
158
- --color-success: var(--wui-success);
159
- /// meaning: Success border tone and the strongest soft success fill.
160
- --color-success-50: var(--wui-success-50);
161
- /// meaning: Success tint for soft fills and borders of alerts and badges.
162
- --color-success-30: var(--wui-success-30);
163
- /// meaning: Success tint behind success alerts and badges.
164
- --color-success-20: var(--wui-success-20);
165
- /// meaning: Soft background of success alerts and badges.
166
- --color-success-10: var(--wui-success-10);
167
- /// meaning: Faintest success wash for hover and soft backgrounds.
168
- --color-success-5: var(--wui-success-5);
169
- /// meaning: Deep success fill behind white text, such as progress labels.
170
- --color-success-strong: var(--wui-success-strong);
171
- /// meaning: Soft success background for alerts.
172
- --color-success-soft: var(--color-success-10);
173
- // Use this — never --color-success — when the colour IS the text.
174
- /// meaning: Success colour as text on light surfaces.
175
- --color-success-text: var(--wui-success-text);
176
- /// meaning: Success text on a soft success tint, such as an alert heading.
177
- --color-success-text-on-soft: var(--wui-success-text);
178
-
179
- /// meaning: Warning ink for icons and active states.
180
- --color-warning-active: var(--wui-warning-active);
181
- /// meaning: Vivid warning fill for badges and dots.
182
- --color-warning: var(--wui-warning);
183
- /// meaning: Warning border tone and the strongest soft warning fill.
184
- --color-warning-50: var(--wui-warning-50);
185
- /// meaning: Warning tint for soft fills and borders of alerts and badges.
186
- --color-warning-30: var(--wui-warning-30);
187
- /// meaning: Warning tint behind warning alerts and badges.
188
- --color-warning-20: var(--wui-warning-20);
189
- /// meaning: Soft background of warning alerts and badges.
190
- --color-warning-10: var(--wui-warning-10);
191
- /// meaning: Faintest warning wash for hover and soft backgrounds.
192
- --color-warning-5: var(--wui-warning-5);
193
- // No dedicated --wui-warning-strong; active is the deepest warning fill.
194
- /// meaning: Deepest warning fill, used where a strong warning fill is needed.
195
- --color-warning-strong: var(--wui-warning-active);
196
- /// meaning: Soft warning background for alerts.
197
- --color-warning-soft: var(--color-warning-10);
198
- // Use this — never --color-warning — when the colour IS the text.
199
- /// meaning: Warning colour as text on light surfaces.
200
- --color-warning-text: var(--wui-warning-text);
201
- /// meaning: Warning text on a soft warning tint, such as an alert heading.
202
- --color-warning-text-on-soft: var(--wui-warning-text);
203
-
204
- /// meaning: Danger ink for icons and active states.
205
- --color-danger-active: var(--wui-danger-active);
206
- /// meaning: Vivid danger fill for badges, dots and danger buttons.
207
- --color-danger: var(--wui-danger);
208
- /// meaning: Danger border tone and the strongest soft danger fill.
209
- --color-danger-50: var(--wui-danger-50);
210
- /// meaning: Danger tint for soft fills and borders of alerts and badges.
211
- --color-danger-30: var(--wui-danger-30);
212
- /// meaning: Danger tint behind danger alerts and badges.
213
- --color-danger-20: var(--wui-danger-20);
214
- /// meaning: Soft background of danger alerts and badges.
215
- --color-danger-10: var(--wui-danger-10);
216
- /// meaning: Faintest danger wash for hover and soft backgrounds.
217
- --color-danger-5: var(--wui-danger-5);
218
- /// meaning: Deep danger fill behind white text, such as the danger button.
219
- --color-danger-strong: var(--wui-danger-strong);
220
- /// meaning: Soft danger background for alerts.
221
- --color-danger-soft: var(--color-danger-10);
222
- // Use this — never --color-danger — when the colour IS the text.
223
- /// meaning: Danger colour as text on light surfaces, such as validation messages.
224
- --color-danger-text: var(--wui-danger-text);
225
- /// meaning: Danger text on a soft danger tint, such as an alert heading.
226
- --color-danger-text-on-soft: var(--wui-danger-text);
227
-
228
- // Accent → warning ramp
229
- /// meaning: Accent colour, aliased to the warning ramp.
230
- --color-accent: var(--color-warning);
231
- /// meaning: Soft accent background, aliased to the warning soft tint.
232
- --color-accent-soft: var(--color-warning-soft);
233
-
234
- // Scrim — one dim ink, two strengths: scrim for page-level backdrops
235
- // (drawer, modal, shell), scrim-strong for media overlays carrying white
236
- // ink (logo uploader, file previews).
237
- /// meaning: Dim behind page-level backdrops such as drawers, modals and the shell.
238
- --color-scrim: color-mix(in srgb, var(--wui-text-heading) 45%, transparent);
239
- /// meaning: Stronger dim behind media overlays that carry white ink.
240
- --color-scrim-strong: color-mix(in srgb, var(--wui-text-heading) 62%, transparent);
241
- /// meaning: Ink on a scrim, such as the text of an overlay.
242
- --color-on-scrim: var(--wui-bg-light);
243
-
244
- // Elevation — in-page flat; only floating overlays lift (matches zeroed BS
245
- // $box-shadow* utilities and --wui-shadow-card* none).
246
- --shadow-sm: none;
247
- --shadow-md: none;
248
- --shadow-lg: none;
249
- --shadow-overlay: var(--wui-shadow-overlay);
250
- --shadow-overlay-lg: var(--wui-shadow-overlay-lg);
251
-
252
- // Corner radii
253
- --radius-sm: var(--wui-radius-sm);
254
- --radius: var(--wui-radius-md);
255
- --radius-lg: var(--wui-radius-lg);
256
- --radius-xl: var(--wui-radius-xl);
257
- }
258
-
259
- // Dark mode tokens — shared by manual toggle ([data-theme="dark"], [data-bs-theme="dark"])
260
- // and automatic detection (@media (prefers-color-scheme: dark) when [data-theme="auto"]).
261
- // Extracted as a mixin to avoid duplication and ensure byte-identical output.
262
- @mixin wui-dark-theme {
263
- // Token-level remap so every consumer of the shadow tokens flips in ALL dark
264
- // paths (manual attributes and the auto media query) without per-component overrides.
265
- --wui-shadow-thumb: var(--wui-dark-shadow-thumb);
266
- --wui-shadow-thumb-hover: var(--wui-dark-shadow-thumb-hover);
267
- --color-bg: var(--wui-dark-bg-page);
268
- --color-bg-subtle: var(--wui-dark-bg-elevated);
269
- --color-bg-muted: var(--wui-dark-bg-muted);
270
- // Dark keeps the field on the muted fill (a light #F9FBFC would blow out the dark UI); the
271
- // light-mode field-bg override lives on --wui-field-bg.
272
- --color-field-bg: var(--wui-dark-bg-muted);
273
- --color-surface: var(--wui-dark-bg-surface);
274
- // A raised thumb is lighter than the muted track it sits on.
275
- --color-thumb: color-mix(in srgb, var(--wui-dark-text) 12%, var(--wui-dark-bg-muted));
276
-
277
- --color-border: var(--wui-dark-border);
278
- --color-border-light: color-mix(in srgb, var(--wui-dark-border) 50%, transparent);
279
- --color-border-strong: var(--wui-dark-border-strong);
280
- --color-field-border: var(--wui-dark-field-border);
281
- --color-field-border-hover: var(--wui-dark-field-border-hover);
282
- --color-progress-track: var(--wui-dark-progress-track);
283
- // Same near-black as --color-primary-text below: 4.97:1 or better on every bright fill.
284
- --color-progress-label: #0F0F0F;
285
-
286
- --color-text: var(--wui-dark-text);
287
- --color-text-muted: var(--wui-dark-text-muted);
288
- --color-text-subtle: var(--wui-dark-text-subtle);
289
- --color-text-body: var(--wui-dark-text);
290
- // Bootstrap's .btn-close glyph is ink-dark; on a dark surface it needs the white filter.
291
- --color-close-filter: invert(1) grayscale(100%) brightness(200%);
292
- // The light pastel focus border glows against a dark field; dark mode uses the dark theme's
293
- // own primary (the button fill), which still clears 3:1 against every dark surface.
294
- --color-focus-border: var(--wui-dark-primary);
295
- // Numbered tints follow dark mode: the dark primary mixed into the dark surface, strongest at 50.
296
- --wui-primary-5: color-mix(in srgb, var(--wui-dark-primary) 10%, var(--wui-dark-bg-surface));
297
- --wui-primary-10: color-mix(in srgb, var(--wui-dark-primary) 16%, var(--wui-dark-bg-surface));
298
- --wui-primary-15: color-mix(in srgb, var(--wui-dark-primary) 21%, var(--wui-dark-bg-surface));
299
- --wui-primary-20: color-mix(in srgb, var(--wui-dark-primary) 26%, var(--wui-dark-bg-surface));
300
- --wui-primary-30: color-mix(in srgb, var(--wui-dark-primary) 40%, var(--wui-dark-bg-surface));
301
- --wui-primary-50: color-mix(in srgb, var(--wui-dark-primary) 62%, var(--wui-dark-bg-surface));
302
- // Soft surfaces and the faintest danger tint follow dark mode as the primary tints do.
303
- --wui-surface-mute: var(--wui-dark-bg-muted);
304
- --wui-surface-soft: color-mix(in srgb, var(--wui-dark-primary) 10%, var(--wui-dark-bg-surface));
305
- --wui-surface-violet-soft: color-mix(in srgb, var(--wui-dark-primary) 6%, var(--wui-dark-bg-surface));
306
- --wui-danger-5: color-mix(in srgb, var(--wui-danger) 10%, var(--wui-dark-bg-surface));
307
-
308
- // Re-bridge the Bootstrap colour vars onto the (now dark) app tokens so the
309
- // named-var text/body/border utilities — .text-body-secondary, .text-muted,
310
- // .text-body-emphasis, .border, backgrounds — flip with the theme. Declared
311
- // here (not only in :root) so the dark theming is explicit and cannot be lost
312
- // to a later-loading consumer rule that scopes --bs-* under [data-theme].
313
- --bs-body-color: var(--color-text);
314
- --bs-emphasis-color: var(--color-text);
315
- --bs-secondary-color: var(--color-text-muted);
316
- --bs-tertiary-color: var(--color-text-subtle);
317
- --bs-body-bg: var(--color-bg);
318
- --bs-border-color: var(--color-border);
319
- --bs-secondary-bg: var(--wui-dark-bg-surface);
320
- --bs-tertiary-bg: var(--wui-dark-bg-muted);
321
- // Bootstrap's .bg-* / .text-secondary / .bg-body-tertiary utilities read the --bs-*-RGB
322
- // triplets (for -opacity support), NOT the plain vars above — without these overrides they
323
- // keep their compiled LIGHT triplet in dark mode (a white .bg-body on a dark portal). The
324
- // triplets mirror the dark hexes in _tokens.scss (Bootstrap's own --bs-x + --bs-x-rgb pattern).
325
- --bs-body-bg-rgb: 15, 17, 23; // --wui-dark-bg-page #0f1117
326
- --bs-body-color-rgb: 230, 232, 238; // --wui-dark-text #e6e8ee
327
- --bs-emphasis-color-rgb: 230, 232, 238; // --wui-dark-text #e6e8ee
328
- --bs-secondary-color-rgb: 180, 185, 198; // --wui-dark-text-muted #b4b9c6
329
- --bs-tertiary-color-rgb: 138, 144, 160; // --wui-dark-text-subtle #8a90a0
330
- --bs-secondary-bg-rgb: 24, 27, 35; // --wui-dark-bg-surface #181b23
331
- --bs-tertiary-bg-rgb: 35, 39, 51; // --wui-dark-bg-muted #232733
332
- --bs-border-color-rgb: 42, 47, 58; // --wui-dark-border #2a2f3a
333
-
334
- --color-primary: var(--wui-dark-primary);
335
- --color-primary-hover: var(--wui-dark-primary-hover);
336
- --color-primary-soft: color-mix(in srgb, var(--wui-primary) 20%, transparent);
337
- // White fails on the lifted dark primary; the derivation in _variables.scss keeps this near-black
338
- // at 4.5:1 or better on it.
339
- --color-primary-text: #0F0F0F;
340
- // White fails on the lifted dark hover fill; near-black keeps the pressed label legible on it.
341
- --color-primary-hover-text: #0F0F0F;
342
- // The dark primary is already lifted to clear 4.5:1 on every dark surface and tint.
343
- --color-primary-ink: var(--wui-dark-primary);
344
- --color-on-primary-ink: #0F0F0F;
345
- --color-on-status-strong: #0F0F0F;
346
-
347
- // On a dark surface the darkened `-text` values would sink into the background, so dark
348
- // mode builds text from the fill instead, lifted with 25% white: the info and danger fills
349
- // alone reach only 3.1:1 and 3.4:1 on the muted fill, and the lift clears 4.5:1 on every
350
- // dark surface for all four tones.
351
- --color-success-text: color-mix(in srgb, var(--wui-success) 75%, white);
352
- --color-danger-text: color-mix(in srgb, var(--wui-danger) 75%, white);
353
- --color-warning-text: color-mix(in srgb, var(--wui-warning) 75%, white);
354
- --color-info-text: color-mix(in srgb, var(--wui-info) 75%, white);
355
-
356
- // Text ON a soft tint (an alert heading). The bright tone alone falls under WCAG AA on its own
357
- // 18% tint over the dark page (info and danger reach only ~3.8:1), so it is lifted with 30%
358
- // white: every tone then clears 4.5:1 on the dark page, surface and muted fill.
359
- --color-success-text-on-soft: color-mix(in srgb, var(--wui-success) 65%, white);
360
- --color-danger-text-on-soft: color-mix(in srgb, var(--wui-danger) 65%, white);
361
- --color-warning-text-on-soft: color-mix(in srgb, var(--wui-warning) 65%, white);
362
- --color-info-text-on-soft: color-mix(in srgb, var(--wui-info) 65%, white);
363
-
364
- // Light mode maps -strong to deep AA fills; on dark surfaces those sink into the page.
365
- // Dark mode uses the lifted -text tone, since -strong is a fill that carries near-black text
366
- // (progress label, bell count): the bare danger and info fills reach only 4.4:1 and 4.0:1
367
- // under that ink, the lifted ones 5.7:1 or better.
368
- --color-success-strong: var(--color-success-text);
369
- --color-danger-strong: var(--color-danger-text);
370
- --color-info-strong: var(--color-info-text);
371
- --color-warning-strong: var(--color-warning-text);
372
-
373
- --color-success-soft: color-mix(in srgb, var(--wui-success) 18%, transparent);
374
- --color-success-5: color-mix(in srgb, var(--wui-success) 8%, transparent);
375
- --color-success-10: color-mix(in srgb, var(--wui-success) 12%, transparent);
376
- --color-warning-soft: color-mix(in srgb, var(--wui-warning) 18%, transparent);
377
- --color-warning-5: color-mix(in srgb, var(--wui-warning) 8%, transparent);
378
- --color-warning-10: color-mix(in srgb, var(--wui-warning) 12%, transparent);
379
- --color-danger-soft: color-mix(in srgb, var(--wui-danger) 18%, transparent);
380
- --color-danger-5: color-mix(in srgb, var(--wui-danger) 8%, transparent);
381
- --color-danger-10: color-mix(in srgb, var(--wui-danger) 12%, transparent);
382
- --color-info-soft: color-mix(in srgb, var(--wui-info) 18%, transparent);
383
- --color-info-5: color-mix(in srgb, var(--wui-info) 8%, transparent);
384
- --color-info-10: color-mix(in srgb, var(--wui-info) 12%, transparent);
385
- // The -50 border tone: the light hex would glow on a dark page, so it becomes a translucent
386
- // mix of the vivid tone that reads as a border on the dark tint.
387
- --color-success-50: color-mix(in srgb, var(--wui-success) 45%, transparent);
388
- --color-warning-50: color-mix(in srgb, var(--wui-warning) 45%, transparent);
389
- --color-danger-50: color-mix(in srgb, var(--wui-danger) 45%, transparent);
390
- --color-info-50: color-mix(in srgb, var(--wui-info) 45%, transparent);
391
- --color-accent-soft: var(--color-warning-soft);
392
-
393
- --color-scrim: color-mix(in srgb, black 45%, transparent);
394
- --color-scrim-strong: color-mix(in srgb, black 62%, transparent);
395
- --color-on-scrim: var(--wui-bg-light);
396
-
397
- // Chart colours: the dark set, so every chart flips with the page.
398
- --wui-chart-1: var(--wui-dark-primary);
399
- --wui-chart-2: var(--wui-dark-chart-2);
400
- --wui-chart-3: var(--wui-dark-chart-3);
401
- --wui-chart-4: var(--wui-dark-chart-4);
402
- --wui-chart-5: var(--wui-dark-chart-5);
403
- --wui-chart-6: var(--wui-dark-chart-6);
404
- --wui-chart-7: var(--wui-dark-chart-7);
405
- --wui-chart-8: var(--wui-dark-chart-8);
406
- --wui-chart-seq-0: var(--wui-dark-chart-seq-0);
407
- --wui-chart-seq-1: var(--wui-dark-chart-seq-1);
408
- --wui-chart-seq-2: var(--wui-dark-chart-seq-2);
409
- --wui-chart-seq-3: var(--wui-dark-chart-seq-3);
410
- --wui-chart-seq-4: var(--wui-dark-chart-seq-4);
411
- --wui-chart-seq-5: var(--wui-dark-chart-seq-5);
412
- --wui-chart-seq-6: var(--wui-dark-chart-seq-6);
413
- --wui-chart-diverging-low: var(--wui-dark-chart-diverging-low);
414
- --wui-chart-diverging-mid: var(--wui-dark-chart-diverging-mid);
415
- --wui-chart-diverging-high: var(--wui-dark-chart-diverging-high);
416
- --wui-chart-neutral: var(--wui-dark-chart-neutral);
417
- }
418
-
419
- // Manual dark mode — set data-theme="dark" and/or data-bs-theme="dark" on <html>
420
- // to flip both wui and Bootstrap native components together.
421
- :root[data-theme="dark"],
422
- :root[data-bs-theme="dark"] {
423
- @include wui-dark-theme;
424
- color-scheme: dark;
425
- }
426
-
427
- // A dark section on a light page, such as a dark band: the same attribute on any element. The meaning
428
- // names are declared again here, so they resolve inside the section rather than once at the root.
429
- // Kept apart from the root rule above because the theme exporters read dark mode by that exact selector.
430
- [data-theme="dark"]:not(:root),
431
- [data-bs-theme="dark"]:not(:root) {
432
- @include wui-dark-theme;
433
- color-scheme: dark;
434
- color: var(--color-text);
435
- }
436
-
437
- // Every name wui-dark-theme sets; scripts/check-theme-modes.mjs keeps the two equal.
438
- $wui-dark-layer-names: (
439
- wui-shadow-thumb, wui-shadow-thumb-hover,
440
- color-bg, color-bg-subtle, color-bg-muted, color-field-bg, color-surface, color-thumb,
441
- color-border, color-border-light, color-border-strong, color-field-border, color-field-border-hover,
442
- color-progress-track, color-progress-label,
443
- color-text, color-text-muted, color-text-subtle, color-text-body, color-close-filter, color-focus-border,
444
- wui-primary-5, wui-primary-10, wui-primary-15, wui-primary-20, wui-primary-30, wui-primary-50,
445
- wui-surface-mute, wui-surface-soft, wui-surface-violet-soft, wui-danger-5,
446
- bs-body-color, bs-emphasis-color, bs-secondary-color, bs-tertiary-color, bs-body-bg, bs-border-color,
447
- bs-secondary-bg, bs-tertiary-bg,
448
- bs-body-bg-rgb, bs-body-color-rgb, bs-emphasis-color-rgb, bs-secondary-color-rgb, bs-tertiary-color-rgb,
449
- bs-secondary-bg-rgb, bs-tertiary-bg-rgb, bs-border-color-rgb,
450
- color-primary, color-primary-hover, color-primary-soft, color-primary-text, color-primary-hover-text,
451
- color-primary-ink, color-on-primary-ink, color-on-status-strong,
452
- color-success-text, color-danger-text, color-warning-text, color-info-text,
453
- color-success-text-on-soft, color-danger-text-on-soft, color-warning-text-on-soft, color-info-text-on-soft,
454
- color-success-strong, color-danger-strong, color-info-strong, color-warning-strong,
455
- color-success-soft, color-success-5, color-success-10,
456
- color-warning-soft, color-warning-5, color-warning-10,
457
- color-danger-soft, color-danger-5, color-danger-10,
458
- color-info-soft, color-info-5, color-info-10,
459
- color-success-50, color-warning-50, color-danger-50, color-info-50,
460
- color-accent-soft, color-scrim, color-scrim-strong, color-on-scrim,
461
- wui-chart-1, wui-chart-2, wui-chart-3, wui-chart-4, wui-chart-5, wui-chart-6, wui-chart-7, wui-chart-8,
462
- wui-chart-seq-0, wui-chart-seq-1, wui-chart-seq-2, wui-chart-seq-3, wui-chart-seq-4, wui-chart-seq-5,
463
- wui-chart-seq-6, wui-chart-diverging-low, wui-chart-diverging-mid, wui-chart-diverging-high, wui-chart-neutral
464
- );
465
-
466
- // A light box inside a dark section, such as a white result table in a dark band: the same attribute set
467
- // to light gives it the page's light colour layer back. The page root keeps a copy of each name the dark
468
- // layer sets, and a var() resolves where it is declared, so each copy holds the root's light value with
469
- // the brand's own overrides. The copies sit on html rather than :root because the theme exporters read
470
- // every :root name as a token. A dark page has no light values on its root to copy, so only a light page
471
- // gets light boxes this way.
472
- html {
473
- @each $name in $wui-dark-layer-names {
474
- --wui-light-#{$name}: var(--#{$name});
475
- }
476
- }
477
-
478
- [data-theme="dark"]:not(:root) [data-theme="light"],
479
- [data-theme="dark"]:not(:root) [data-bs-theme="light"],
480
- [data-bs-theme="dark"]:not(:root) [data-theme="light"],
481
- [data-bs-theme="dark"]:not(:root) [data-bs-theme="light"] {
482
- @each $name in $wui-dark-layer-names {
483
- --#{$name}: var(--wui-light-#{$name});
484
- }
485
- color-scheme: light;
486
- color: var(--color-text);
487
- }
488
-
489
- // Automatic dark mode — when data-theme="auto", detect system preference and apply dark tokens.
490
- :root[data-theme="auto"] {
491
- @media (prefers-color-scheme: dark) {
492
- @include wui-dark-theme;
493
- color-scheme: dark;
494
- }
495
- }