@nexub/themes 2.9.0 → 3.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.
package/src/base.css CHANGED
@@ -1,679 +1,16 @@
1
1
  /* @nexub/themes — base.css
2
- Global resets, focus ring, body, scrollbar, reduced-motion.
2
+ Global resets, focus ring, body, scrollbar, reduced-motion (core.css), plus
3
+ the Nexub fonts and the ambient page backdrop.
3
4
  Import this once at the root of your app before light.css or dark.css. */
4
5
 
5
- /* Plus Jakarta Sans — the Nexub DS typeface. Self-hosted (OFL-1.1, from
6
- Fontsource); variable weights 200–800, normal + italic. Subsets load on
7
- demand via unicode-range, so only the glyphs a page uses are fetched. Every
8
- file is big enough that bundlers emit it rather than inline a data: URL,
9
- so `font-src 'self'` works (see scripts/build-fonts.mjs). */
6
+ /* Plus Jakarta Sans and Inter — the Nexub DS typefaces. Self-hosted (OFL-1.1,
7
+ from Fontsource); variable weights, normal + italic. Subsets load on demand
8
+ via unicode-range, so only the glyphs a page uses are fetched. Every file is
9
+ big enough that bundlers emit it rather than inline a data: URL, so
10
+ `font-src 'self'` works (see scripts/build-fonts.mjs). */
10
11
  @import './fonts.css';
11
- @import '@nexub/tokens/css';
12
- @import '@nexub/tokens/css/roles';
13
-
14
- /* ─── Semantic shorthand aliases ───────────────────────────────────────────
15
- Components reference these shorter names. They proxy the full token names
16
- so you only need to update one place if the palette shifts. */
17
- :root {
18
- /* success */
19
- --color-success-500: var(--color-semantic-success-default);
20
- --color-success-600: var(--color-semantic-success-strong);
21
- --color-success-bg: var(--color-semantic-success-bg);
22
- --color-success-border: var(--color-semantic-success-border);
23
-
24
- /* error / danger */
25
- --color-error-500: var(--color-semantic-error-default);
26
- --color-error-600: var(--color-semantic-error-strong);
27
- --color-error-bg: var(--color-semantic-error-bg);
28
- --color-error-border: var(--color-semantic-error-border);
29
- --color-danger-500: var(--color-semantic-error-default);
30
- --color-danger-600: var(--color-semantic-error-strong);
31
- --color-danger-bg: var(--color-semantic-error-bg);
32
- --color-danger-border: var(--color-semantic-error-border);
33
-
34
- /* warning */
35
- --color-warning-500: var(--color-semantic-warning-default);
36
- --color-warning-600: var(--color-semantic-warning-strong);
37
- --color-warning-bg: var(--color-semantic-warning-bg);
38
- --color-warning-border: var(--color-semantic-warning-border);
39
-
40
- /* info */
41
- --color-info-500: var(--color-semantic-info-default);
42
- --color-info-600: var(--color-semantic-info-strong);
43
- --color-info-bg: var(--color-semantic-info-bg);
44
- --color-info-border: var(--color-semantic-info-border);
45
-
46
- /* Focus ring follows the theme's ring tokens (the tokens default is a fixed
47
- white/blue pair, wrong in dark mode and brand themes). */
48
- --shadow-focus: 0 0 0 2px var(--color-ring-offset), 0 0 0 4px var(--color-ring-default);
49
-
50
- /* Form-control boundaries (WCAG 1.4.11 needs >= 3:1 against the page).
51
- Separate from --color-border-default, which cards/dividers keep light. */
52
- --color-border-input: var(--color-outline);
53
-
54
- /* placeholder text (PKG-B01) */
55
- --color-text-placeholder: var(--color-text-muted);
56
-
57
- /* tone text aliases — used by Heading tone prop + HelperText (PKG-H01) */
58
- /* -strong passes WCAG AA as text in both light (dark shade) and dark (light shade). */
59
- --color-text-info: var(--color-semantic-info-strong);
60
- --color-text-success: var(--color-semantic-success-strong);
61
- --color-text-warning: var(--color-semantic-warning-strong);
62
- --color-text-danger: var(--color-semantic-error-strong);
63
-
64
- /* Solid fills under white text. Fixed palette tones (they do NOT flip in dark
65
- mode): tone 40 vs white is >= 4.5:1 by HCT construction; hover = tone 30.
66
- Brand themes override accent. Phase 2 moves components to on-* roles. */
67
- --color-fill-primary: var(--color-palette-primary-40);
68
- --color-fill-primary-hover: var(--color-palette-primary-30);
69
- --color-fill-info: var(--color-palette-info-40);
70
- --color-fill-info-hover: var(--color-palette-info-30);
71
- --color-fill-success: var(--color-palette-success-40);
72
- --color-fill-success-hover: var(--color-palette-success-30);
73
- --color-fill-warning: var(--color-palette-warning-40);
74
- --color-fill-warning-hover: var(--color-palette-warning-30);
75
- --color-fill-danger: var(--color-palette-error-40);
76
- --color-fill-danger-hover: var(--color-palette-error-30);
77
- --color-fill-leap: var(--color-palette-leap-40);
78
- --color-fill-leap-hover: var(--color-palette-leap-30);
79
- --color-fill-bookub: var(--color-palette-bookub-40);
80
- --color-fill-bookub-hover: var(--color-palette-bookub-30);
81
- --color-fill-payub: var(--color-palette-payub-40);
82
- --color-fill-payub-hover: var(--color-palette-payub-30);
83
- --color-fill-founderub: var(--color-palette-founderub-40);
84
- --color-fill-founderub-hover: var(--color-palette-founderub-30);
85
- --color-fill-accent: var(--color-fill-primary);
86
- --color-fill-accent-hover: var(--color-fill-primary-hover);
87
-
88
- /* scrim behind modal surfaces (Dialog, AlertDialog, Sheet/Drawer, CommandPalette) */
89
- --color-overlay: rgb(0 0 0 / 0.5);
90
-
91
- /* accent fallback — used without any brand theme applied (PKG-B03) */
92
- --color-accent-500: var(--color-brand-primary-500);
93
- --color-accent-600: var(--color-brand-primary-600);
94
-
95
- /* brand tone shorthands — aliased from full token names (PKG-B02) */
96
- --color-leap-50: var(--color-accent-leap-50);
97
- --color-leap-100: var(--color-accent-leap-100);
98
- --color-leap-500: var(--color-accent-leap-500);
99
- --color-leap-600: var(--color-accent-leap-600);
100
- --color-leap-700: var(--color-accent-leap-700);
101
- --color-leap-bg: rgba(99, 102, 241, 0.10);
102
- --color-leap-border: rgba(99, 102, 241, 0.25);
103
-
104
- --color-bookub-50: var(--color-accent-bookub-50);
105
- --color-bookub-100: var(--color-accent-bookub-100);
106
- --color-bookub-500: var(--color-accent-bookub-500);
107
- --color-bookub-600: var(--color-accent-bookub-600);
108
- --color-bookub-700: var(--color-accent-bookub-700);
109
- --color-bookub-bg: rgba(16, 185, 129, 0.10);
110
- --color-bookub-border: rgba(16, 185, 129, 0.25);
111
-
112
- --color-payub-50: var(--color-accent-payub-50);
113
- --color-payub-100: var(--color-accent-payub-100);
114
- --color-payub-500: var(--color-accent-payub-500);
115
- --color-payub-600: var(--color-accent-payub-600);
116
- --color-payub-700: var(--color-accent-payub-700);
117
- --color-payub-bg: rgba(139, 92, 246, 0.10);
118
- --color-payub-border: rgba(139, 92, 246, 0.25);
119
-
120
- --color-founderub-50: var(--color-accent-founderub-50);
121
- --color-founderub-100: var(--color-accent-founderub-100);
122
- --color-founderub-500: var(--color-accent-founderub-500);
123
- --color-founderub-600: var(--color-accent-founderub-600);
124
- --color-founderub-700: var(--color-accent-founderub-700);
125
- --color-founderub-bg: rgba(245, 158, 11, 0.10);
126
- --color-founderub-border: rgba(245, 158, 11, 0.25);
127
- }
128
-
129
- *, *::before, *::after {
130
- box-sizing: border-box;
131
- border-color: var(--color-border-default);
132
- }
133
-
134
- html {
135
- font-family: var(--font-family-sans);
136
- font-size: 16px;
137
- line-height: 1.6;
138
- color: var(--color-text-primary);
139
- background-color: var(--color-bg-default);
140
- scroll-behavior: smooth;
141
- -webkit-font-smoothing: antialiased;
142
- -moz-osx-font-smoothing: grayscale;
143
- text-size-adjust: 100%;
144
- /* never fake bold/italic; Inter's optical sizes follow font-size */
145
- font-synthesis: none;
146
- font-optical-sizing: auto;
147
- }
148
-
149
- /* Form controls don't inherit fonts by default — without this, apps that
150
- don't use Tailwind's preflight would render buttons/inputs in the system UI
151
- font instead of Inter. */
152
- button, input, select, textarea, optgroup {
153
- font-family: inherit;
154
- }
155
-
156
- /* Pointer cursor on buttons. Tailwind v3's preflight set it; v4's doesn't, so
157
- this keeps Nexub buttons the same on both. Zero specificity (:where), so any
158
- cursor-* utility and v3's preflight still win. */
159
- :where(button:not(:disabled), [role='button']:not(:disabled)) {
160
- cursor: pointer;
161
- }
12
+ @import './core.css';
162
13
 
163
14
  body {
164
- min-height: 100vh;
165
- margin: 0;
166
15
  background: var(--gradient-hero-ambient);
167
16
  }
168
-
169
- /* Focus ring: one ring for everything. The outline follows border-radius, so
170
- it hugs capsules and fields. Contrast >= 3:1 on every surface (ring = primary). */
171
- :focus-visible {
172
- outline: 3px solid var(--color-ring-default);
173
- outline-offset: 2px;
174
- }
175
-
176
- @media (forced-colors: active) {
177
- :focus-visible { outline-color: Highlight; }
178
- }
179
-
180
- /* Headings: brand display face, balanced wrapping */
181
- h1, h2, h3, h4, h5, h6 {
182
- margin: 0;
183
- font-family: var(--font-family-display);
184
- font-weight: var(--font-weight-bold);
185
- line-height: 1.2;
186
- color: var(--color-text-primary);
187
- text-wrap: balance;
188
- }
189
-
190
- /* Paragraphs / lists */
191
- p, ul, ol {
192
- margin: 0;
193
- }
194
-
195
- p {
196
- text-wrap: pretty;
197
- }
198
-
199
- /* Links */
200
- a {
201
- color: var(--color-text-link);
202
- text-decoration: underline;
203
- text-underline-offset: 0.3em;
204
- }
205
-
206
- a:hover {
207
- opacity: 0.8;
208
- }
209
-
210
- /* Images */
211
- img, video, svg {
212
- display: block;
213
- max-width: 100%;
214
- }
215
-
216
- /* Code */
217
- code, kbd, pre, samp {
218
- font-family: var(--font-family-mono);
219
- font-size: 0.875em;
220
- }
221
-
222
- /* Selection */
223
- ::selection {
224
- background-color: color-mix(in srgb, var(--color-primary) 20%, transparent);
225
- color: var(--color-text-primary);
226
- }
227
-
228
- /* Scrollbar (webkit) */
229
- ::-webkit-scrollbar {
230
- width: 8px;
231
- height: 8px;
232
- }
233
-
234
- ::-webkit-scrollbar-track {
235
- background: var(--color-bg-subtle);
236
- }
237
-
238
- ::-webkit-scrollbar-thumb {
239
- background: var(--color-border-strong);
240
- border-radius: var(--radius-full);
241
- }
242
-
243
- ::-webkit-scrollbar-thumb:hover {
244
- background: var(--color-text-muted);
245
- }
246
-
247
- /* Reduced motion */
248
- /* Reduced motion: everything is instant, except the designed fallbacks
249
- (nx-motion, nx-reveal), which keep their crossfade with no travel. */
250
- @media (prefers-reduced-motion: reduce) {
251
- *:not(.nx-motion, .nx-reveal), *::before, *::after {
252
- animation-duration: 0.01ms !important;
253
- animation-iteration-count: 1 !important;
254
- transition-duration: 0.01ms !important;
255
- scroll-behavior: auto !important;
256
- }
257
- }
258
-
259
- /* ─── State layer (Calm Depth §4.2) ──────────────────────────────────────────
260
- An overlay of the element's own text color (its on-* role) at the
261
- --state-* opacity, so hover/focus/press read correctly on any fill, theme,
262
- brand or glass. The ::before paints above the background, below content. */
263
- .nx-state-layer { position: relative; isolation: isolate; }
264
- .nx-state-layer::before {
265
- content: '';
266
- position: absolute;
267
- inset: 0;
268
- z-index: -1;
269
- border-radius: inherit;
270
- background: currentColor;
271
- opacity: 0;
272
- pointer-events: none;
273
- transition: opacity var(--motion-spring-effects-fast-duration) var(--motion-spring-effects-fast-easing);
274
- }
275
- .nx-state-layer:hover::before { opacity: var(--state-hover); }
276
- .nx-state-layer:focus-visible::before { opacity: var(--state-focus); }
277
- .nx-state-layer:active::before { opacity: var(--state-pressed); }
278
- .nx-state-layer:is(:disabled, [aria-disabled='true'], [data-disabled])::before { opacity: 0; }
279
-
280
- /* Press feedback: a fast spatial spring, no ripple. */
281
- .nx-press {
282
- transition: transform var(--motion-spring-spatial-fast-duration) var(--motion-spring-spatial-fast-easing);
283
- }
284
- .nx-press:active:not(:disabled, [aria-disabled='true'], [data-disabled]) { transform: scale(0.97); }
285
-
286
- /* ─── Enter / exit (overlays, menus, tooltips, toasts) ───────────────────────
287
- Opacity rides the effects spring; position and scale ride the spatial
288
- spring, so a little overshoot reads as physical without flashing.
289
- Keyframes, not transitions: Radix keeps closing content mounted until its
290
- exit animation ends. Standalone translate/scale compose with the
291
- component's own transform (e.g. a centred dialog's -50% offsets).
292
- Modifiers set where the layer comes from: --nx-x, --nx-y, --nx-scale. */
293
- @keyframes nx-fade-in { from { opacity: 0; } }
294
- @keyframes nx-fade-out { to { opacity: 0; } }
295
- @keyframes nx-move-in { from { translate: var(--nx-x, 0) var(--nx-y, 0); scale: var(--nx-scale, 1); } }
296
- @keyframes nx-move-out { to { translate: var(--nx-x, 0) var(--nx-y, 0); scale: var(--nx-scale, 1); } }
297
-
298
- .nx-motion:is([data-state='open'], [data-state='delayed-open'], [data-state='instant-open'], [data-motion^='from-']) {
299
- animation:
300
- nx-fade-in var(--motion-spring-effects-default-duration) var(--motion-spring-effects-default-easing),
301
- nx-move-in var(--motion-spring-spatial-default-duration) var(--motion-spring-spatial-default-easing);
302
- }
303
- /* Exit is quicker than enter and never overshoots. */
304
- .nx-motion:is([data-state='closed'], [data-motion^='to-']) {
305
- animation:
306
- nx-fade-out var(--motion-spring-effects-fast-duration) var(--motion-spring-effects-fast-easing) forwards,
307
- nx-move-out var(--motion-spring-effects-fast-duration) var(--motion-spring-effects-fast-easing) forwards;
308
- }
309
-
310
- /* Floating layers grow from their trigger: a small scale plus a 4px nudge
311
- away from the side they open on (Radix sets data-side). Components set
312
- transform-origin to Radix's --radix-*-transform-origin. */
313
- .nx-pop { --nx-scale: 0.96; }
314
- .nx-pop[data-side='bottom'] { --nx-y: -4px; }
315
- .nx-pop[data-side='top'] { --nx-y: 4px; }
316
- .nx-pop[data-side='left'] { --nx-x: 4px; }
317
- .nx-pop[data-side='right'] { --nx-x: -4px; }
318
- /* Modal dialogs rise slightly as they scale in. */
319
- .nx-dialog { --nx-scale: 0.96; --nx-y: 8px; }
320
- /* NavigationMenu content slides in from the item's direction. */
321
- .nx-motion:is([data-motion='from-start'], [data-motion='to-start']) { --nx-x: -24px; }
322
- .nx-motion:is([data-motion='from-end'], [data-motion='to-end']) { --nx-x: 24px; }
323
-
324
- /* Reduced motion: a designed fallback, not a cut. Keep the crossfade, drop
325
- the travel and scale. */
326
- @media (prefers-reduced-motion: reduce) {
327
- .nx-motion { --nx-x: 0px !important; --nx-y: 0px !important; --nx-scale: 1 !important; }
328
- }
329
-
330
- /* Stagger: children of .nx-stagger rise in one after another (40ms apart, up
331
- to the 12th; later ones arrive with the 12th). Set --nx-stagger to change
332
- the step. Re-key the parent to replay. */
333
- .nx-stagger > * {
334
- --nx-y: 8px;
335
- animation:
336
- nx-fade-in var(--motion-spring-effects-default-duration) var(--motion-spring-effects-default-easing) both,
337
- nx-move-in var(--motion-spring-spatial-default-duration) var(--motion-spring-spatial-default-easing) both;
338
- animation-delay: calc(var(--nx-i, 0) * var(--nx-stagger, 40ms));
339
- }
340
- .nx-stagger > :nth-child(2) { --nx-i: 1; }
341
- .nx-stagger > :nth-child(3) { --nx-i: 2; }
342
- .nx-stagger > :nth-child(4) { --nx-i: 3; }
343
- .nx-stagger > :nth-child(5) { --nx-i: 4; }
344
- .nx-stagger > :nth-child(6) { --nx-i: 5; }
345
- .nx-stagger > :nth-child(7) { --nx-i: 6; }
346
- .nx-stagger > :nth-child(8) { --nx-i: 7; }
347
- .nx-stagger > :nth-child(9) { --nx-i: 8; }
348
- .nx-stagger > :nth-child(10) { --nx-i: 9; }
349
- .nx-stagger > :nth-child(11) { --nx-i: 10; }
350
- .nx-stagger > :nth-child(n + 12) { --nx-i: 11; }
351
-
352
- /* ListTransition items: grow in from zero height and fade in; exit collapses
353
- and fades (quicker, no overshoot). Rows animate via grid-template-rows so
354
- the item needs no measured height. */
355
- .nx-list-item { display: grid; grid-template-rows: 1fr; }
356
- .nx-list-item-inner { min-height: 0; overflow: hidden; }
357
- @keyframes nx-rows-in { from { grid-template-rows: 0fr; } }
358
- @keyframes nx-rows-out { to { grid-template-rows: 0fr; } }
359
- .nx-list-item[data-state='enter'] {
360
- animation:
361
- nx-rows-in var(--motion-spring-spatial-default-duration) var(--motion-spring-spatial-default-easing),
362
- nx-fade-in var(--motion-spring-effects-default-duration) var(--motion-spring-effects-default-easing);
363
- }
364
- .nx-list-item[data-state='exit'] {
365
- pointer-events: none;
366
- animation:
367
- nx-rows-out var(--motion-spring-effects-default-duration) var(--motion-spring-effects-default-easing) forwards,
368
- nx-fade-out var(--motion-spring-effects-fast-duration) var(--motion-spring-effects-fast-easing) forwards;
369
- }
370
-
371
- /* SkeletonSwap: skeleton and content share one grid cell and crossfade. */
372
- .nx-swap { display: grid; }
373
- .nx-swap > * { grid-area: 1 / 1; min-width: 0; }
374
- .nx-swap-in { animation: nx-fade-in var(--motion-spring-effects-default-duration) var(--motion-spring-effects-default-easing) both; }
375
- .nx-swap-out {
376
- pointer-events: none;
377
- animation: nx-fade-out var(--motion-spring-effects-default-duration) var(--motion-spring-effects-default-easing) forwards;
378
- }
379
-
380
- @media (prefers-reduced-motion: reduce) {
381
- .nx-stagger > * { --nx-y: 0px; animation-delay: 0s; }
382
- .nx-list-item[data-state='enter'] { animation: nx-fade-in var(--motion-spring-effects-default-duration) var(--motion-spring-effects-default-easing); }
383
- .nx-list-item[data-state='exit'] { animation: nx-fade-out var(--motion-spring-effects-fast-duration) var(--motion-spring-effects-fast-easing) forwards; }
384
- }
385
-
386
- /* ─── Cards: lift, press, sheen ──────────────────────────────────────────────
387
- Lift: hover raises 2px on the spatial spring with elevation 1 → 2; leaving
388
- settles faster on the effects spring (a transition uses the *destination*
389
- state's timing). Press sinks to 0.99. Hover only where a real pointer
390
- hovers, so touch never gets a stuck lift. */
391
- .nx-lift {
392
- transition:
393
- translate var(--motion-spring-effects-fast-duration) var(--motion-spring-effects-fast-easing),
394
- scale var(--motion-spring-effects-fast-duration) var(--motion-spring-effects-fast-easing),
395
- box-shadow var(--motion-spring-effects-fast-duration) var(--motion-spring-effects-fast-easing);
396
- }
397
- @media (hover: hover) {
398
- .nx-lift:hover {
399
- translate: 0 -2px;
400
- transition:
401
- translate var(--motion-spring-spatial-default-duration) var(--motion-spring-spatial-default-easing),
402
- scale var(--motion-spring-spatial-fast-duration) var(--motion-spring-spatial-fast-easing),
403
- box-shadow var(--motion-spring-effects-default-duration) var(--motion-spring-effects-default-easing);
404
- }
405
- /* Glass keeps its own shadow (it carries the specular edge). */
406
- .nx-lift:not([data-material='glass']):hover { box-shadow: var(--elevation-2); }
407
- }
408
- .nx-lift:active { translate: 0 0; scale: 0.99; }
409
- @media (prefers-reduced-motion: reduce) {
410
- .nx-lift:hover, .nx-lift:active { translate: none; scale: none; }
411
- }
412
-
413
- /* Sheen (opt-in): a soft light that follows the pointer across the surface,
414
- plus a brighter rim where the pointer is nearest the edge. JS sets
415
- --nx-mx/--nx-my through the CSSOM (CSP-safe); --nx-sheen fades it in.
416
- Primary-tinted on light surfaces, white on dark and on glass. Off for touch
417
- (no hover), reduced motion and reduced transparency. */
418
- @property --nx-sheen { syntax: '<number>'; inherits: true; initial-value: 0; }
419
- .nx-sheen {
420
- position: relative;
421
- --nx-sheen-tint: light-dark(var(--color-primary), #fff);
422
- background-image: radial-gradient(
423
- 28rem circle at var(--nx-mx, 50%) var(--nx-my, 0%),
424
- color-mix(in srgb, var(--nx-sheen-tint) calc(var(--nx-sheen) * 9%), transparent),
425
- transparent 70%
426
- );
427
- transition: --nx-sheen var(--motion-spring-effects-fast-duration) var(--motion-spring-effects-fast-easing);
428
- }
429
- .nx-sheen::after {
430
- content: '';
431
- position: absolute;
432
- inset: -1px;
433
- padding: 1px;
434
- border-radius: inherit;
435
- pointer-events: none;
436
- background: radial-gradient(
437
- 14rem circle at var(--nx-mx, 50%) var(--nx-my, 0%),
438
- color-mix(in srgb, var(--nx-sheen-tint) calc(var(--nx-sheen) * 70%), transparent),
439
- transparent 70%
440
- );
441
- -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
442
- -webkit-mask-composite: xor;
443
- mask-composite: exclude;
444
- }
445
- [data-material='glass'].nx-sheen { --nx-sheen-tint: #fff; }
446
- /* On a sheen surface the light is the hover feedback; the grey state layer
447
- would wash it out. Press still darkens. */
448
- .nx-sheen.nx-state-layer:hover:not(:active)::before { opacity: 0; }
449
- @media (hover: hover) and (prefers-reduced-motion: no-preference) {
450
- .nx-sheen:hover {
451
- --nx-sheen: 1;
452
- transition: --nx-sheen var(--motion-spring-effects-default-duration) var(--motion-spring-effects-default-easing);
453
- }
454
- }
455
- @media (prefers-reduced-transparency: reduce) {
456
- .nx-sheen { background-image: none; }
457
- .nx-sheen::after { display: none; }
458
- }
459
-
460
- /* ─── AI: thinking indicator ─────────────────────────────────────────────────
461
- nx-morph: a small shape that breathes between a circle and a soft squircle
462
- on the expressive spring. nx-shimmer: a decorative light sweep across label
463
- text (the text stays in the DOM). Reduced motion: both static. */
464
- @keyframes nx-morph {
465
- from { border-radius: 50%; rotate: 0deg; }
466
- to { border-radius: 38% 62% 38% 62% / 62% 38% 62% 38%; rotate: 90deg; }
467
- }
468
- @keyframes nx-shimmer {
469
- from { background-position: 100% 0; }
470
- to { background-position: -100% 0; }
471
- }
472
- @media (prefers-reduced-motion: no-preference) {
473
- .nx-morph {
474
- animation: nx-morph calc(var(--motion-spring-expressive-slow-duration) * 2)
475
- var(--motion-spring-expressive-slow-easing) infinite alternate;
476
- }
477
- .nx-shimmer {
478
- background-image: linear-gradient(90deg,
479
- currentColor 0%, currentColor 40%, var(--color-on-surface) 50%, currentColor 60%, currentColor 100%);
480
- background-size: 200% 100%;
481
- -webkit-background-clip: text;
482
- background-clip: text;
483
- -webkit-text-fill-color: transparent;
484
- /* A steady sweep: linear, not a spring (a spring would pulse each loop). */
485
- animation: nx-shimmer 2s linear infinite;
486
- }
487
- }
488
- @media (forced-colors: active) {
489
- .nx-shimmer { background: none; -webkit-text-fill-color: currentColor; }
490
- }
491
-
492
- /* Streaming caret: a steady blink while text is arriving. */
493
- @keyframes nx-caret { 0%, 100% { opacity: 1; } 50% { opacity: 0; } }
494
- .nx-caret { animation: nx-caret 1s steps(1, end) infinite; }
495
- @media (prefers-reduced-motion: reduce) {
496
- .nx-caret { animation: none; }
497
- }
498
-
499
- /* ─── Touch targets ─────────────────────────────────────────────────────────
500
- Small controls keep their visual size but get an invisible 44×44 hit area
501
- on touch screens (Apple HIG, WCAG 2.5.5). Uses ::after; the state layer
502
- uses ::before. */
503
- @media (pointer: coarse) {
504
- .nx-hit { position: relative; }
505
- .nx-hit::after {
506
- content: '';
507
- position: absolute;
508
- left: 50%;
509
- top: 50%;
510
- width: max(100%, 44px);
511
- height: max(100%, 44px);
512
- translate: -50% -50%;
513
- }
514
- }
515
-
516
- /* ─── Micro-moments ──────────────────────────────────────────────────────────
517
- Reveal: content replacing a skeleton crossfades in (no travel). */
518
- .nx-reveal {
519
- animation: nx-fade-in var(--motion-spring-effects-default-duration) var(--motion-spring-effects-default-easing);
520
- }
521
- /* Check draw: a checkmark path (pathLength="1") draws itself in. */
522
- @keyframes nx-draw { from { stroke-dashoffset: 1; } }
523
- .nx-check-draw {
524
- stroke-dasharray: 1;
525
- animation: nx-draw var(--motion-spring-effects-default-duration) var(--motion-spring-effects-default-easing);
526
- }
527
- @media (prefers-reduced-motion: reduce) {
528
- .nx-check-draw { animation: none; }
529
- }
530
- /* Shake: a short horizontal "no" on the spatial-fast spring (async Button error). */
531
- @keyframes nx-shake {
532
- 0%, 100% { translate: 0; }
533
- 20% { translate: -4px; }
534
- 40% { translate: 4px; }
535
- 60% { translate: -3px; }
536
- 80% { translate: 2px; }
537
- }
538
- .nx-shake {
539
- animation: nx-shake var(--motion-spring-spatial-fast-duration) var(--motion-spring-spatial-fast-easing);
540
- }
541
- @media (prefers-reduced-motion: reduce) {
542
- .nx-shake { animation: none; }
543
- }
544
-
545
- /* ─── Density ────────────────────────────────────────────────────────────────
546
- Compact shifts every control one step down the ladder (md 40 → 32). */
547
- [data-density='compact'] {
548
- --size-control-xs: 20px;
549
- --size-control-sm: 24px;
550
- --size-control-md: 32px;
551
- --size-control-lg: 40px;
552
- --size-control-xl: 48px;
553
- }
554
-
555
- /* Logo-scroll marquee keyframe (used by LogoWall) */
556
- @keyframes logo-scroll {
557
- from { transform: translateX(0); }
558
- to { transform: translateX(-50%); }
559
- }
560
-
561
- /* ─── App header (@nexub/patterns AppHeader) ─────────────────────────────────
562
- One height for the fixed top header everywhere. Offset layouts with
563
- var(--app-header-height); AppHeader's own spacer already does in flow. */
564
- :root { --app-header-height: 64px; }
565
- /* condense: scroll-driven, no JS. The page spacer stays 64px; only the bar
566
- tightens. Glass keeps its own shadow. */
567
- @keyframes nx-condense { to { height: 52px; } }
568
- @keyframes nx-condense-lift { to { height: 52px; box-shadow: var(--elevation-1); } }
569
- @supports (animation-timeline: scroll()) {
570
- [data-condense] {
571
- animation: nx-condense-lift linear both;
572
- animation-timeline: scroll(root);
573
- animation-range: 0 64px;
574
- }
575
- [data-condense][data-material='glass'] { animation-name: nx-condense; }
576
- }
577
-
578
- /* ─── Scroll lock (Sheet scrollLock="class") ─────────────────────────────────
579
- A CSP-safe page scroll lock: @nexub/react toggles these classes on <html>
580
- instead of injecting a <style> tag. The gutter class keeps the scrollbar's
581
- space so the page doesn't shift sideways. */
582
- html.nexub-scroll-lock { overflow: hidden; }
583
- html.nexub-scroll-lock.nexub-scroll-gutter { scrollbar-gutter: stable; }
584
-
585
- /* ─── Nexub mark gradient stops (<NexubMark variant="color">, <Logo>) ───────
586
- Classes instead of style= attributes, which a strict CSP blocks in
587
- server-rendered HTML. */
588
- /* nexub-mark-stops:start — generated by packages/brand/scripts/build-assets.mjs */
589
- .nxm-s-1{stop-color:var(--color-brand-mark-1)}
590
- .nxm-s-2{stop-color:var(--color-brand-mark-2)}
591
- .nxm-s-3{stop-color:var(--color-brand-mark-3)}
592
- .nxm-s-4{stop-color:var(--color-brand-mark-4)}
593
- .nxm-s-5{stop-color:var(--color-brand-mark-5)}
594
- .nxm-s-6{stop-color:var(--color-brand-mark-6)}
595
- .nxm-s-7{stop-color:var(--color-brand-mark-7)}
596
- .nxm-s-8{stop-color:var(--color-brand-mark-8)}
597
- .nxm-s-9{stop-color:var(--color-brand-mark-9)}
598
- .nxm-s-10{stop-color:var(--color-brand-mark-10)}
599
- .nxm-s-11{stop-color:var(--color-brand-mark-11)}
600
- .nxm-s-12{stop-color:var(--color-brand-mark-12)}
601
- .nxm-s-13{stop-color:var(--color-brand-mark-13)}
602
- .nxm-s-14{stop-color:var(--color-brand-mark-14)}
603
- .nxm-s-15{stop-color:var(--color-brand-mark-15)}
604
- .nxm-s-16{stop-color:var(--color-brand-mark-16)}
605
- .nxm-s-17{stop-color:var(--color-brand-mark-17)}
606
- .nxm-s-18{stop-color:var(--color-brand-mark-18)}
607
- .nxm-s-19{stop-color:var(--color-brand-mark-19)}
608
- .nxm-s-20{stop-color:var(--color-brand-mark-20)}
609
- .nxm-s-21{stop-color:var(--color-brand-mark-21)}
610
- .nxm-s-22{stop-color:var(--color-brand-mark-22)}
611
- .nxm-s-23{stop-color:var(--color-brand-mark-23)}
612
- .nxm-s-24{stop-color:var(--color-brand-mark-24)}
613
- .nxm-s-25{stop-color:var(--color-brand-mark-25)}
614
- .nxm-s-26{stop-color:var(--color-brand-mark-26)}
615
- .nxm-s-27{stop-color:var(--color-brand-mark-27)}
616
- .nxm-s-28{stop-color:var(--color-brand-mark-28)}
617
- .nxm-s-29{stop-color:var(--color-brand-mark-29)}
618
- .nxm-s-30{stop-color:var(--color-brand-mark-30)}
619
- .nxm-s-31{stop-color:var(--color-brand-mark-31)}
620
- .nxm-s-32{stop-color:var(--color-brand-mark-32)}
621
- .nxm-s-33{stop-color:var(--color-brand-mark-33)}
622
- .nxm-s-34{stop-color:var(--color-brand-mark-34)}
623
- .nxm-s-35{stop-color:var(--color-brand-mark-35)}
624
- .nxm-s-36{stop-color:var(--color-brand-mark-36)}
625
- .nxm-s-37{stop-color:var(--color-brand-mark-37)}
626
- .nxm-s-38{stop-color:var(--color-brand-mark-38)}
627
- .nxm-s-39{stop-color:var(--color-brand-mark-39)}
628
- .nxm-s-40{stop-color:var(--color-brand-mark-40)}
629
- .nxm-s-41{stop-color:var(--color-brand-mark-41)}
630
- .nxm-s-42{stop-color:var(--color-brand-mark-42)}
631
- .nxm-s-43{stop-color:var(--color-brand-mark-43)}
632
- .nxm-s-44{stop-color:var(--color-brand-mark-44)}
633
- .nxm-s-45{stop-color:var(--color-brand-mark-45)}
634
- .nxm-s-46{stop-color:var(--color-brand-mark-46)}
635
- .nxm-s-47{stop-color:var(--color-brand-mark-47)}
636
- .nxm-o-0{stop-opacity:0}
637
- /* nexub-mark-stops:end */
638
-
639
- /* ─── Radix ScrollArea / Select viewports ────────────────────────────────────
640
- Radix renders these rules in a <style> tag, which a strict CSP blocks. The
641
- same rules here keep the native scrollbar hidden either way. */
642
- [data-radix-scroll-area-viewport],[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch}
643
- [data-radix-scroll-area-viewport]::-webkit-scrollbar,[data-radix-select-viewport]::-webkit-scrollbar{display:none}
644
-
645
- /* ─── Drawer / Sheet (vaul 1.1.2) ─────────────────────────────────────────────
646
- vaul's own styles. vaul normally injects these in a <style> tag when
647
- @nexub/react loads, which strict CSP pages block; @nexub/react strips that
648
- and ships them here instead. Verbatim copy: the @nexub/react build fails if
649
- it no longer matches vaul. One rule is left out: vaul's invalid
650
- `[data-vaul-handle-hitarea]:{…}` media rule, which browsers ignore and strict
651
- CSS parsers (lightningcss, Turbopack) reject. */
652
- [data-vaul-drawer]{touch-action:none;will-change:transform;transition:transform .5s cubic-bezier(.32, .72, 0, 1);animation-duration:.5s;animation-timing-function:cubic-bezier(0.32,0.72,0,1)}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=bottom][data-state=open]{animation-name:slideFromBottom}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=bottom][data-state=closed]{animation-name:slideToBottom}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=top][data-state=open]{animation-name:slideFromTop}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=top][data-state=closed]{animation-name:slideToTop}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=left][data-state=open]{animation-name:slideFromLeft}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=left][data-state=closed]{animation-name:slideToLeft}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=right][data-state=open]{animation-name:slideFromRight}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=right][data-state=closed]{animation-name:slideToRight}[data-vaul-drawer][data-vaul-snap-points=true][data-vaul-drawer-direction=bottom]{transform:translate3d(0,var(--initial-transform,100%),0)}[data-vaul-drawer][data-vaul-snap-points=true][data-vaul-drawer-direction=top]{transform:translate3d(0,calc(var(--initial-transform,100%) * -1),0)}[data-vaul-drawer][data-vaul-snap-points=true][data-vaul-drawer-direction=left]{transform:translate3d(calc(var(--initial-transform,100%) * -1),0,0)}[data-vaul-drawer][data-vaul-snap-points=true][data-vaul-drawer-direction=right]{transform:translate3d(var(--initial-transform,100%),0,0)}[data-vaul-drawer][data-vaul-delayed-snap-points=true][data-vaul-drawer-direction=top]{transform:translate3d(0,var(--snap-point-height,0),0)}[data-vaul-drawer][data-vaul-delayed-snap-points=true][data-vaul-drawer-direction=bottom]{transform:translate3d(0,var(--snap-point-height,0),0)}[data-vaul-drawer][data-vaul-delayed-snap-points=true][data-vaul-drawer-direction=left]{transform:translate3d(var(--snap-point-height,0),0,0)}[data-vaul-drawer][data-vaul-delayed-snap-points=true][data-vaul-drawer-direction=right]{transform:translate3d(var(--snap-point-height,0),0,0)}[data-vaul-overlay][data-vaul-snap-points=false]{animation-duration:.5s;animation-timing-function:cubic-bezier(0.32,0.72,0,1)}[data-vaul-overlay][data-vaul-snap-points=false][data-state=open]{animation-name:fadeIn}[data-vaul-overlay][data-state=closed]{animation-name:fadeOut}[data-vaul-animate=false]{animation:none!important}[data-vaul-overlay][data-vaul-snap-points=true]{opacity:0;transition:opacity .5s cubic-bezier(.32, .72, 0, 1)}[data-vaul-overlay][data-vaul-snap-points=true]{opacity:1}[data-vaul-drawer]:not([data-vaul-custom-container=true])::after{content:'';position:absolute;background:inherit;background-color:inherit}[data-vaul-drawer][data-vaul-drawer-direction=top]::after{top:initial;bottom:100%;left:0;right:0;height:200%}[data-vaul-drawer][data-vaul-drawer-direction=bottom]::after{top:100%;bottom:initial;left:0;right:0;height:200%}[data-vaul-drawer][data-vaul-drawer-direction=left]::after{left:initial;right:100%;top:0;bottom:0;width:200%}[data-vaul-drawer][data-vaul-drawer-direction=right]::after{left:100%;right:initial;top:0;bottom:0;width:200%}[data-vaul-overlay][data-vaul-snap-points=true]:not([data-vaul-snap-points-overlay=true]):not(
653
- [data-state=closed]
654
- ){opacity:0}[data-vaul-overlay][data-vaul-snap-points-overlay=true]{opacity:1}[data-vaul-handle]{display:block;position:relative;opacity:.7;background:#e2e2e4;margin-left:auto;margin-right:auto;height:5px;width:32px;border-radius:1rem;touch-action:pan-y}[data-vaul-handle]:active,[data-vaul-handle]:hover{opacity:1}[data-vaul-handle-hitarea]{position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);width:max(100%,2.75rem);height:max(100%,2.75rem);touch-action:inherit}@media (hover:hover) and (pointer:fine){[data-vaul-drawer]{user-select:none}}@keyframes fadeIn{from{opacity:0}to{opacity:1}}@keyframes fadeOut{to{opacity:0}}@keyframes slideFromBottom{from{transform:translate3d(0,var(--initial-transform,100%),0)}to{transform:translate3d(0,0,0)}}@keyframes slideToBottom{to{transform:translate3d(0,var(--initial-transform,100%),0)}}@keyframes slideFromTop{from{transform:translate3d(0,calc(var(--initial-transform,100%) * -1),0)}to{transform:translate3d(0,0,0)}}@keyframes slideToTop{to{transform:translate3d(0,calc(var(--initial-transform,100%) * -1),0)}}@keyframes slideFromLeft{from{transform:translate3d(calc(var(--initial-transform,100%) * -1),0,0)}to{transform:translate3d(0,0,0)}}@keyframes slideToLeft{to{transform:translate3d(calc(var(--initial-transform,100%) * -1),0,0)}}@keyframes slideFromRight{from{transform:translate3d(var(--initial-transform,100%),0,0)}to{transform:translate3d(0,0,0)}}@keyframes slideToRight{to{transform:translate3d(var(--initial-transform,100%),0,0)}}
655
-
656
- /* Drawer / Sheet on our springs. vaul's copy above stays verbatim (tsup checks
657
- it); these override its .5s iOS curve. Enter rides spatial, exit is quicker
658
- on effects and never overshoots. Placed after vaul's rules so ties win. */
659
- .nx-drawer[data-vaul-drawer][data-vaul-snap-points='false'] {
660
- animation-duration: var(--motion-spring-spatial-default-duration);
661
- animation-timing-function: var(--motion-spring-spatial-default-easing);
662
- }
663
- .nx-drawer[data-vaul-drawer][data-vaul-snap-points='false'][data-state='closed'] {
664
- animation-duration: var(--motion-spring-effects-default-duration);
665
- animation-timing-function: var(--motion-spring-effects-default-easing);
666
- }
667
- .nx-drawer-overlay[data-vaul-overlay][data-vaul-snap-points='false'] {
668
- animation-duration: var(--motion-spring-effects-default-duration);
669
- animation-timing-function: var(--motion-spring-effects-default-easing);
670
- }
671
- .nx-drawer-overlay[data-vaul-overlay][data-state='closed'] {
672
- animation-duration: var(--motion-spring-effects-fast-duration);
673
- animation-timing-function: var(--motion-spring-effects-fast-easing);
674
- }
675
- /* Reduced motion: the panel fades instead of sliding. */
676
- @media (prefers-reduced-motion: reduce) {
677
- .nx-drawer[data-vaul-drawer][data-vaul-snap-points='false'][data-state='open'] { animation-name: fadeIn; }
678
- .nx-drawer[data-vaul-drawer][data-vaul-snap-points='false'][data-state='closed'] { animation-name: fadeOut; }
679
- }