@hattisar/design-tokens 0.3.12 → 0.3.14
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/package.json +1 -1
- package/tokens.css +25 -6
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hattisar/design-tokens",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.14",
|
|
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
|
@@ -123,6 +123,14 @@
|
|
|
123
123
|
nearest shade that passes is #1a73e8 at 4.51:1, visually the same
|
|
124
124
|
blue, if the ratio matters more than the exact hex. */
|
|
125
125
|
--color-cta: #4285f4;
|
|
126
|
+
/* The call-to-action blue as *text* on a surface, which is a
|
|
127
|
+
stricter bar than as a fill. #4285f4 carries white at 3.56:1 — the
|
|
128
|
+
one documented exception in check-contrast.mjs — and reusing it for
|
|
129
|
+
text would spread that exception instead of containing it. Scaled
|
|
130
|
+
13% darker it reaches 4.59:1 on a white card while reading as the
|
|
131
|
+
same blue. Dark mode needs no adjustment: #4285f4 already measures
|
|
132
|
+
4.61:1 on #1f1f23, so it keeps the brand hex exactly. */
|
|
133
|
+
--color-cta-on-surface: #3973d4;
|
|
126
134
|
--color-cta-hover: color-mix(in srgb, var(--color-cta) 88%, black);
|
|
127
135
|
--color-cta-active: color-mix(in srgb, var(--color-cta) 76%, black);
|
|
128
136
|
--color-cta-text: #ffffff;
|
|
@@ -277,7 +285,7 @@
|
|
|
277
285
|
A control that stretches to the page is the thing that made these
|
|
278
286
|
forms read as a wall: an email box does not need 900px, and at
|
|
279
287
|
that width the eye has to travel back across empty space to find
|
|
280
|
-
the next label.
|
|
288
|
+
the next label. Both are held to a fixed, comfortable size and
|
|
281
289
|
lets the page be as wide as it likes. */
|
|
282
290
|
--form-label-width: 160px;
|
|
283
291
|
--form-control-width: 340px;
|
|
@@ -353,7 +361,7 @@
|
|
|
353
361
|
--sidebar-height: calc(100vh - var(--header-height));
|
|
354
362
|
|
|
355
363
|
/* Two widths, because a page is one of two things.
|
|
356
|
-
Measured against
|
|
364
|
+
Measured against a storefront admin at 1920: its product *list* runs
|
|
357
365
|
256→1888, effectively the full area, and their product *form* runs
|
|
358
366
|
605→1554 — 950px, centred, with 365px of gap either side. A table
|
|
359
367
|
wants every pixel; a form wants a column you can read across
|
|
@@ -365,7 +373,7 @@
|
|
|
365
373
|
right edge moves between pages *and* so does the amount of empty
|
|
366
374
|
space, so the app reads as if it cannot decide how wide it is.
|
|
367
375
|
|
|
368
|
-
--page-width-content is 1152 rather than
|
|
376
|
+
--page-width-content is 1152 rather than the 950 measured there,
|
|
369
377
|
reason that is ours and not theirs: their product form has no
|
|
370
378
|
line-item grid and every one of our documents does. A sales order
|
|
371
379
|
at 950 would scroll its item table sideways on every visit, and
|
|
@@ -442,6 +450,9 @@
|
|
|
442
450
|
--color-brand-active: color-mix(in srgb, var(--color-brand) 75%, black);
|
|
443
451
|
--color-brand-text: #09090b;
|
|
444
452
|
--color-cta: #4285f4;
|
|
453
|
+
/* Light mode darkens this for contrast; on a dark surface the brand
|
|
454
|
+
blue already clears AA, so it stands unmodified. */
|
|
455
|
+
--color-cta-on-surface: #4285f4;
|
|
445
456
|
--color-cta-hover: color-mix(in srgb, var(--color-cta) 88%, black);
|
|
446
457
|
--color-cta-active: color-mix(in srgb, var(--color-cta) 76%, black);
|
|
447
458
|
--color-cta-text: #ffffff;
|
|
@@ -550,6 +561,14 @@
|
|
|
550
561
|
--color-brand-active: color-mix(in srgb, var(--color-brand) 70%, black);
|
|
551
562
|
--color-brand-text: #ffffff;
|
|
552
563
|
--color-cta: #4285f4;
|
|
564
|
+
/* The call-to-action blue as *text* on a surface, which is a
|
|
565
|
+
stricter bar than as a fill. #4285f4 carries white at 3.56:1 — the
|
|
566
|
+
one documented exception in check-contrast.mjs — and reusing it for
|
|
567
|
+
text would spread that exception instead of containing it. Scaled
|
|
568
|
+
13% darker it reaches 4.59:1 on a white card while reading as the
|
|
569
|
+
same blue. Dark mode needs no adjustment: #4285f4 already measures
|
|
570
|
+
4.61:1 on #1f1f23, so it keeps the brand hex exactly. */
|
|
571
|
+
--color-cta-on-surface: #3973d4;
|
|
553
572
|
--color-cta-hover: color-mix(in srgb, var(--color-cta) 88%, black);
|
|
554
573
|
--color-cta-active: color-mix(in srgb, var(--color-cta) 76%, black);
|
|
555
574
|
--color-cta-text: #ffffff;
|
|
@@ -1029,7 +1048,7 @@ input[type="date"]::-webkit-calendar-picker-indicator:hover {
|
|
|
1029
1048
|
/* A required field says so on its label, in the red this app already
|
|
1030
1049
|
uses for things that are wrong or missing.
|
|
1031
1050
|
Asked for: "use our existing red for required field title" — the
|
|
1032
|
-
|
|
1051
|
+
usual convention, where a required label is red and the
|
|
1033
1052
|
optional ones are not.
|
|
1034
1053
|
|
|
1035
1054
|
Written as `:has()` rather than a prop on forty forms: the label
|
|
@@ -1051,7 +1070,7 @@ input[type="date"]::-webkit-calendar-picker-indicator:hover {
|
|
|
1051
1070
|
* difference between one red label on a form and all of them.
|
|
1052
1071
|
*/
|
|
1053
1072
|
/*
|
|
1054
|
-
* And a star after the label text, the way
|
|
1073
|
+
* And a star after the label text, the usual way to mark a required
|
|
1055
1074
|
* field.
|
|
1056
1075
|
*
|
|
1057
1076
|
* Harder than it looks, because the label's text is a bare text node:
|
|
@@ -1330,7 +1349,7 @@ input[type="radio"] {
|
|
|
1330
1349
|
the thing the old note actually wanted. The page title moves with
|
|
1331
1350
|
it, so the two stay aligned.
|
|
1332
1351
|
|
|
1333
|
-
Tables are untouched and stay full width, which is what
|
|
1352
|
+
Tables are untouched and stay full width, which is what those do
|
|
1334
1353
|
and what a table wants. */
|
|
1335
1354
|
.record-form-layout > form,
|
|
1336
1355
|
.record-form-layout.medium-form-layout > form,
|