@hattisar/design-tokens 0.3.15 → 0.3.17

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 (2) hide show
  1. package/package.json +1 -1
  2. package/tokens.css +33 -17
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hattisar/design-tokens",
3
- "version": "0.3.15",
3
+ "version": "0.3.17",
4
4
  "description": "Shared design tokens (colors, type, radius, spacing, motion) and base primitives (reset, buttons, inputs, cards, modals, auth shell) for every Hattisar frontend.",
5
5
  "main": "tokens.css",
6
6
  "files": [
package/tokens.css CHANGED
@@ -268,6 +268,13 @@
268
268
  --space-6: 24px;
269
269
  --space-8: 32px;
270
270
  --space-10: 40px;
271
+
272
+ /* The gap between a label and the control under it. Was a bare 6px
273
+ inside the input rule; named because anything wrapping a control
274
+ has to reproduce it exactly — a wrapper that keeps the margin on
275
+ the input ends up 6px taller than the field it contains, which is
276
+ how an overlaid control centres itself slightly high. */
277
+ --field-label-gap: 6px;
271
278
  --space-12: 48px;
272
279
  /* Two steps past the old ceiling, for the gaps that separate whole
273
280
  regions of a page rather than elements inside one. Without them
@@ -289,6 +296,10 @@
289
296
  lets the page be as wide as it likes. */
290
297
  --form-label-width: 160px;
291
298
  --form-control-width: 340px;
299
+ /* A control sharing a line with others — the second and third field
300
+ of a header row. Narrower than a control that owns its row, because
301
+ three of those do not fit and a date needs far less than 340px. */
302
+ --form-control-width-compact: 200px;
292
303
  --form-control-width-wide: 520px;
293
304
  --field-min-width-narrow: 140px;
294
305
 
@@ -342,16 +353,24 @@
342
353
  --sidebar-bg: var(--color-background-card);
343
354
  --sidebar-text: var(--color-text-primary);
344
355
  --sidebar-text-muted: var(--color-text-muted);
345
- --sidebar-active-bg: var(--color-surface-tint);
346
356
  --sidebar-active-text: var(--color-text-primary);
347
357
  --sidebar-hover-bg: var(--color-surface-tint);
348
- /* Icon tint for the active nav row — not a full fill, so
349
- --sidebar-active-bg/text above stay the "you're here" pill and
350
- this just adds a distinct accent on top. Reuses --sidebar-active-
351
- text rather than its own color, so the accent never drifts out of
352
- sync with the text it's paired with. No left border (removed —
353
- read as a stray dark mark down the row on top of the pill). */
354
- --sidebar-active-icon: var(--sidebar-active-text);
358
+ /* Accent ink for the row you are on: icon, label and a 3px left bar
359
+ all take this, and nothing takes it as a fill. --color-cta-on-
360
+ surface rather than --color-cta itself because this sits on a
361
+ white rail: measured, 3973d4 lands at 4.59:1 against it and
362
+ 4285f4 at 3.56:1, so the unmodified CTA blue would miss AA for
363
+ normal text on the one rail it appears on most.
364
+
365
+ Was var(--sidebar-active-text), i.e. --color-text-primary, which
366
+ made it the same near-black as every other row's hover state and
367
+ so no accent at all. The active row had a pill fill to lean on
368
+ instead, except that in light theme the fill token and
369
+ --sidebar-hover-bg were both --color-surface-tint — so the page
370
+ you were on and whatever row the cursor happened to be over were
371
+ pixel-identical. That fill token is gone; both secondary rails
372
+ already read this one, so all three navs now share one accent. */
373
+ --sidebar-active-ink: var(--color-cta-on-surface);
355
374
  --sidebar-rail-bg: var(--color-background-card);
356
375
 
357
376
  /* Every left-hand nav rail in an app sharing this one width instead
@@ -523,14 +542,12 @@
523
542
  --sidebar-bg: #18181b;
524
543
  --sidebar-text: var(--color-text-primary);
525
544
  --sidebar-text-muted: var(--color-text-muted);
526
- /* Two distinct white-overlay intensities on top of --sidebar-bg —
527
- hover lighter, active a touch stronger — so the current page's row
528
- still reads as visibly different from a row you're just passing
529
- the cursor over. */
530
- --sidebar-active-bg: color-mix(in srgb, white 7%, transparent);
531
545
  --sidebar-active-text: var(--color-text-primary);
532
546
  --sidebar-hover-bg: rgba(255, 255, 255, 0.06);
533
- --sidebar-active-icon: var(--sidebar-active-text);
547
+ /* --color-cta unmodified here: on #18181b it measures 4.97:1, where
548
+ the on-surface variant light theme uses is tuned for a white
549
+ ground. See the light block above for what this token is. */
550
+ --sidebar-active-ink: var(--color-cta);
534
551
  --sidebar-rail-bg: #18181b;
535
552
 
536
553
  color-scheme: dark;
@@ -632,10 +649,9 @@
632
649
  --sidebar-bg: var(--color-background-card);
633
650
  --sidebar-text: #09090b;
634
651
  --sidebar-text-muted: var(--color-text-muted);
635
- --sidebar-active-bg: var(--color-surface-tint);
636
652
  --sidebar-active-text: var(--color-text-primary);
637
653
  --sidebar-hover-bg: var(--color-surface-tint);
638
- --sidebar-active-icon: var(--sidebar-active-text);
654
+ --sidebar-active-ink: var(--color-cta-on-surface);
639
655
  --sidebar-rail-bg: var(--color-background-card);
640
656
 
641
657
  color-scheme: light;
@@ -904,7 +920,7 @@ textarea {
904
920
  line-height: 1.4;
905
921
  width: 100%;
906
922
  padding: 8px 12px;
907
- margin-top: 6px;
923
+ margin-top: var(--field-label-gap);
908
924
  border: 1px solid var(--color-border-strong);
909
925
  border-radius: var(--radius-sm);
910
926
  background: var(--color-input);