@hattisar/design-tokens 0.3.10 → 0.3.12
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 +92 -39
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hattisar/design-tokens",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.12",
|
|
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
|
@@ -352,17 +352,35 @@
|
|
|
352
352
|
--sidebar-width-collapsed: 64px;
|
|
353
353
|
--sidebar-height: calc(100vh - var(--header-height));
|
|
354
354
|
|
|
355
|
-
/*
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
355
|
+
/* Two widths, because a page is one of two things.
|
|
356
|
+
Measured against Shopify at 1920: their product *list* runs
|
|
357
|
+
256→1888, effectively the full area, and their product *form* runs
|
|
358
|
+
605→1554 — 950px, centred, with 365px of gap either side. A table
|
|
359
|
+
wants every pixel; a form wants a column you can read across
|
|
360
|
+
without your eyes travelling.
|
|
361
|
+
|
|
362
|
+
There were three before — 800 for plain field lists, 1152 for
|
|
363
|
+
forms with a sidebar, 1600 for line-item documents — and they were
|
|
364
|
+
flush left. Three caps left-aligned is the worst of both: the
|
|
365
|
+
right edge moves between pages *and* so does the amount of empty
|
|
366
|
+
space, so the app reads as if it cannot decide how wide it is.
|
|
367
|
+
|
|
368
|
+
--page-width-content is 1152 rather than Shopify's 950 for a
|
|
369
|
+
reason that is ours and not theirs: their product form has no
|
|
370
|
+
line-item grid and every one of our documents does. A sales order
|
|
371
|
+
at 950 would scroll its item table sideways on every visit, and
|
|
372
|
+
trading a horizontal scroll on the busiest form in the app for
|
|
373
|
+
200px of symmetry is a bad deal. */
|
|
374
|
+
--page-width-content: 1152px;
|
|
375
|
+
|
|
376
|
+
/* Kept as aliases: several rules and a handful of pages still name
|
|
377
|
+
them, and pointing all three at the same value is what makes the
|
|
378
|
+
consolidation a one-line change rather than a sweep through forty
|
|
379
|
+
files. They resolve to the same width now — the modifier classes
|
|
380
|
+
are inert. */
|
|
381
|
+
--page-width-small: var(--page-width-content);
|
|
382
|
+
--page-width-medium: var(--page-width-content);
|
|
383
|
+
--page-width-large: var(--page-width-content);
|
|
366
384
|
|
|
367
385
|
color-scheme: light dark;
|
|
368
386
|
}
|
|
@@ -1032,6 +1050,50 @@ input[type="date"]::-webkit-calendar-picker-indicator:hover {
|
|
|
1032
1050
|
* picker in the app is a Combobox underneath, so this is the
|
|
1033
1051
|
* difference between one red label on a form and all of them.
|
|
1034
1052
|
*/
|
|
1053
|
+
/*
|
|
1054
|
+
* And a star after the label text, the way Zoho marks a required
|
|
1055
|
+
* field.
|
|
1056
|
+
*
|
|
1057
|
+
* Harder than it looks, because the label's text is a bare text node:
|
|
1058
|
+
* `<label>First Name<input required></label>`. A plain `label::after`
|
|
1059
|
+
* renders after *everything* in the label — under the input, not
|
|
1060
|
+
* beside the words — and the only way to attach it to the text
|
|
1061
|
+
* directly would be to wrap that text in a span on every field of
|
|
1062
|
+
* every form.
|
|
1063
|
+
*
|
|
1064
|
+
* So the label becomes a wrapping flex row for required fields only,
|
|
1065
|
+
* and the three items are ordered explicitly: the text (order 0, an
|
|
1066
|
+
* anonymous flex item), the star (order 1), then the control, forced
|
|
1067
|
+
* onto the next line by a full-width basis. The result is the text and
|
|
1068
|
+
* its star on one line and the field under them — which is what the
|
|
1069
|
+
* label already looked like, with a star added and no markup touched.
|
|
1070
|
+
*/
|
|
1071
|
+
label:has(:required) {
|
|
1072
|
+
/*
|
|
1073
|
+
* !important because 212 labels in this app carry an inline
|
|
1074
|
+
* `style={{ display: "block" }}`, and an inline declaration beats
|
|
1075
|
+
* any stylesheet rule regardless of specificity. This is the case
|
|
1076
|
+
* the keyword exists for: overriding markup a stylesheet cannot
|
|
1077
|
+
* reach. Without it the star renders after the control on every one
|
|
1078
|
+
* of those labels instead of beside the words.
|
|
1079
|
+
*/
|
|
1080
|
+
display: flex !important;
|
|
1081
|
+
flex-wrap: wrap;
|
|
1082
|
+
align-items: baseline;
|
|
1083
|
+
}
|
|
1084
|
+
|
|
1085
|
+
label:has(:required) > * {
|
|
1086
|
+
order: 2;
|
|
1087
|
+
flex-basis: 100%;
|
|
1088
|
+
}
|
|
1089
|
+
|
|
1090
|
+
label:has(:required)::after {
|
|
1091
|
+
content: "*";
|
|
1092
|
+
order: 1;
|
|
1093
|
+
margin-left: 2px;
|
|
1094
|
+
color: var(--color-danger);
|
|
1095
|
+
}
|
|
1096
|
+
|
|
1035
1097
|
label:has(:required) {
|
|
1036
1098
|
color: var(--color-danger);
|
|
1037
1099
|
}
|
|
@@ -1255,37 +1317,28 @@ input[type="radio"] {
|
|
|
1255
1317
|
margin-bottom: 12px;
|
|
1256
1318
|
}
|
|
1257
1319
|
|
|
1258
|
-
/* Capped
|
|
1259
|
-
|
|
1260
|
-
|
|
1261
|
-
|
|
1262
|
-
|
|
1263
|
-
|
|
1264
|
-
left edge away from both of those, and away from itself between a
|
|
1265
|
-
wide table and a two-field form, reading as content jumping around
|
|
1266
|
-
from page to page instead of a page that's simply narrower. */
|
|
1267
|
-
.record-form-layout > form {
|
|
1268
|
-
flex: 1;
|
|
1269
|
-
min-width: 0;
|
|
1270
|
-
max-width: var(--page-width-small);
|
|
1271
|
-
}
|
|
1320
|
+
/* Capped and centred, one width for every form.
|
|
1321
|
+
This reverses the note that stood here, so the reasoning it replaces
|
|
1322
|
+
is worth keeping rather than deleting: centring was rejected before
|
|
1323
|
+
because it drifted the form's left edge away from the page's own
|
|
1324
|
+
title and away from the list pages' left edge, so content appeared
|
|
1325
|
+
to jump around between pages.
|
|
1272
1326
|
|
|
1273
|
-
|
|
1274
|
-
|
|
1275
|
-
|
|
1276
|
-
|
|
1277
|
-
|
|
1278
|
-
max-width: var(--page-width-medium);
|
|
1279
|
-
}
|
|
1327
|
+
That was true, and it was true *because there were three widths*. A
|
|
1328
|
+
centred box only moves if the box keeps changing size — with one
|
|
1329
|
+
width the left edge is the same on every form in the app, which is
|
|
1330
|
+
the thing the old note actually wanted. The page title moves with
|
|
1331
|
+
it, so the two stay aligned.
|
|
1280
1332
|
|
|
1281
|
-
|
|
1282
|
-
|
|
1283
|
-
|
|
1284
|
-
|
|
1285
|
-
instead, still full-bleed on any normal screen. Flush left, same
|
|
1286
|
-
reasoning as .record-form-layout > form above. */
|
|
1333
|
+
Tables are untouched and stay full width, which is what Shopify does
|
|
1334
|
+
and what a table wants. */
|
|
1335
|
+
.record-form-layout > form,
|
|
1336
|
+
.record-form-layout.medium-form-layout > form,
|
|
1287
1337
|
.wide-form-layout > form {
|
|
1288
|
-
|
|
1338
|
+
flex: 1;
|
|
1339
|
+
min-width: 0;
|
|
1340
|
+
max-width: var(--page-width-content);
|
|
1341
|
+
margin-inline: auto;
|
|
1289
1342
|
}
|
|
1290
1343
|
|
|
1291
1344
|
.wide-form-layout .party-form-columns {
|