@hattisar/design-tokens 0.3.27 → 0.3.29
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 +107 -5
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hattisar/design-tokens",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.29",
|
|
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
|
@@ -267,6 +267,28 @@
|
|
|
267
267
|
--card-header-height: 36px;
|
|
268
268
|
--card-header-control-height: 24px;
|
|
269
269
|
|
|
270
|
+
/* The signature widget card: a filled frame, a header band that shows the
|
|
271
|
+
frame's own fill, and a white body set into it. WidgetCard, the line-items
|
|
272
|
+
card, the form sections and the settings cards all read these, so the look
|
|
273
|
+
is changed here once and never restated per card. They are built from the
|
|
274
|
+
colour and radius tokens, so they follow the theme without a block of
|
|
275
|
+
their own. */
|
|
276
|
+
--widget-bg: var(--color-table-header);
|
|
277
|
+
--widget-border-width: 1px;
|
|
278
|
+
--widget-border-color: var(--color-border-strong);
|
|
279
|
+
--widget-radius: var(--radius-sm);
|
|
280
|
+
--widget-shadow: var(--shadow-sm);
|
|
281
|
+
--widget-header-height: var(--card-header-height);
|
|
282
|
+
--widget-header-padding: 6px var(--space-3);
|
|
283
|
+
--widget-title-size: var(--text-sm);
|
|
284
|
+
--widget-title-weight: var(--font-weight-medium);
|
|
285
|
+
--widget-body-bg: var(--color-background-card);
|
|
286
|
+
--widget-body-padding: var(--space-3) var(--space-4);
|
|
287
|
+
--widget-divider: var(--color-border);
|
|
288
|
+
/* The surface a sheet or label sits on in a preview: a shade off the card. */
|
|
289
|
+
--widget-canvas-bg: color-mix(in srgb, var(--color-text-primary) 5%, var(--color-background-card));
|
|
290
|
+
--widget-row-padding: var(--space-3) var(--space-4);
|
|
291
|
+
|
|
270
292
|
/* Colours that must not follow the theme, named instead of repeated as
|
|
271
293
|
hex. White on a saturated fill (an org tile, an integration logo)
|
|
272
294
|
stays white in dark mode; the scrim dims the page behind a modal or
|
|
@@ -296,6 +318,11 @@
|
|
|
296
318
|
--button-height: 28px;
|
|
297
319
|
--button-radius: var(--radius-full);
|
|
298
320
|
--button-padding-x: var(--space-3);
|
|
321
|
+
/* Not equal on purpose: the label's cap-height centre sits 0.75px above the
|
|
322
|
+
box's centre with equal padding, which reads as text riding high in the
|
|
323
|
+
pill. Three-quarters of a pixel off each side puts the ink in the middle. */
|
|
324
|
+
--button-padding-top: calc(var(--space-1) + 0.75px);
|
|
325
|
+
--button-padding-bottom: calc(var(--space-1) - 0.75px);
|
|
299
326
|
--button-font-size: var(--text-sm);
|
|
300
327
|
--button-font-weight: var(--font-weight-medium);
|
|
301
328
|
|
|
@@ -1048,7 +1075,7 @@ button {
|
|
|
1048
1075
|
border: none;
|
|
1049
1076
|
border-radius: var(--button-radius);
|
|
1050
1077
|
min-height: var(--button-height);
|
|
1051
|
-
padding: var(--
|
|
1078
|
+
padding: var(--button-padding-top) var(--button-padding-x) var(--button-padding-bottom);
|
|
1052
1079
|
font-size: var(--button-font-size);
|
|
1053
1080
|
font-weight: var(--button-font-weight);
|
|
1054
1081
|
background: var(--color-cta);
|
|
@@ -1119,7 +1146,7 @@ button:focus-visible {
|
|
|
1119
1146
|
border: none;
|
|
1120
1147
|
border-radius: var(--button-radius);
|
|
1121
1148
|
min-height: var(--button-height);
|
|
1122
|
-
padding: var(--
|
|
1149
|
+
padding: var(--button-padding-top) var(--button-padding-x) var(--button-padding-bottom);
|
|
1123
1150
|
font-size: var(--button-font-size);
|
|
1124
1151
|
font-weight: var(--button-font-weight);
|
|
1125
1152
|
background: var(--button-secondary-bg);
|
|
@@ -1156,7 +1183,7 @@ button:focus-visible {
|
|
|
1156
1183
|
border: none;
|
|
1157
1184
|
border-radius: var(--button-radius);
|
|
1158
1185
|
min-height: var(--button-height);
|
|
1159
|
-
padding: var(--
|
|
1186
|
+
padding: var(--button-padding-top) var(--button-padding-x) var(--button-padding-bottom);
|
|
1160
1187
|
font-size: var(--button-font-size);
|
|
1161
1188
|
font-weight: var(--button-font-weight);
|
|
1162
1189
|
background: var(--color-destructive-fill);
|
|
@@ -1469,6 +1496,10 @@ select:disabled {
|
|
|
1469
1496
|
input[type="checkbox"],
|
|
1470
1497
|
input[type="radio"] {
|
|
1471
1498
|
width: auto;
|
|
1499
|
+
/* No vertical margin: the field rule above gives every input a top margin,
|
|
1500
|
+
which on a checkbox or radio set beside its label pushes it below the
|
|
1501
|
+
text's centre. The sides keep the browser's own spacing. */
|
|
1502
|
+
margin-block: 0;
|
|
1472
1503
|
accent-color: var(--color-brand);
|
|
1473
1504
|
}
|
|
1474
1505
|
|
|
@@ -1594,8 +1625,6 @@ input[type="radio"] {
|
|
|
1594
1625
|
display: block;
|
|
1595
1626
|
font-size: var(--text-xs);
|
|
1596
1627
|
font-weight: 400;
|
|
1597
|
-
letter-spacing: 0.06em;
|
|
1598
|
-
text-transform: uppercase;
|
|
1599
1628
|
color: var(--color-text-muted);
|
|
1600
1629
|
margin-bottom: 6px;
|
|
1601
1630
|
}
|
|
@@ -1782,3 +1811,76 @@ a.card:hover {
|
|
|
1782
1811
|
justify-content: flex-end;
|
|
1783
1812
|
gap: 10px;
|
|
1784
1813
|
}
|
|
1814
|
+
|
|
1815
|
+
/**
|
|
1816
|
+
* Semantic tier (--ui-*): what surfaces, controls and states are called, built only from the
|
|
1817
|
+
* primitives above, so light and dark follow with no second copy of any value. Inventory and the
|
|
1818
|
+
* Storefront both read these; an app sets a few of them (its accent, its density) rather than
|
|
1819
|
+
* redefining the rest. Added alongside the existing tokens and changes none of them.
|
|
1820
|
+
*
|
|
1821
|
+
* Surfaces separate by tone, not by line: the page is the base, what is raised above it (cards,
|
|
1822
|
+
* panels, popovers) is a soft tint of the text color, and a tray inside one a step further.
|
|
1823
|
+
*/
|
|
1824
|
+
:root {
|
|
1825
|
+
/* The one accent: primary actions, active marks, counts, focus. An app or a seller can swap these three. */
|
|
1826
|
+
--ui-accent: #0f766e;
|
|
1827
|
+
--ui-accent-hover: #0b5f58;
|
|
1828
|
+
--ui-accent-ink: #fff;
|
|
1829
|
+
--ui-accent-soft: color-mix(in srgb, var(--ui-accent) var(--ui-wash), transparent);
|
|
1830
|
+
--ui-surface: var(--color-background-page);
|
|
1831
|
+
--ui-card: color-mix(in srgb, var(--color-text-primary) var(--ui-tint-card), var(--ui-surface));
|
|
1832
|
+
--ui-tray: color-mix(in srgb, var(--color-text-primary) var(--ui-tint-tray), var(--ui-card));
|
|
1833
|
+
/* The column header band: a step off the surface a table sits on. */
|
|
1834
|
+
--ui-band: color-mix(in srgb, var(--color-text-primary) var(--ui-tint-band), var(--ui-surface));
|
|
1835
|
+
/* Form fields are a filled shape: the share of the text color mixed into the card, at rest and under the pointer. */
|
|
1836
|
+
--ui-field-bg: color-mix(in srgb, var(--color-text-primary) var(--ui-tint-field), var(--ui-card));
|
|
1837
|
+
--ui-field-bg-hover: color-mix(in srgb, var(--color-text-primary) var(--ui-tint-field-hover), var(--ui-card));
|
|
1838
|
+
--ui-row-alt: color-mix(in srgb, var(--color-text-primary) 3%, transparent);
|
|
1839
|
+
/* Every other row of a table, laid over its surface: what tells one row from the next now that no rule does. */
|
|
1840
|
+
--ui-row-zebra: color-mix(in srgb, var(--color-text-primary) 4%, transparent);
|
|
1841
|
+
/* A rule between rows: present enough to follow a line across, quiet enough not to read as a grid. */
|
|
1842
|
+
--ui-divider: color-mix(in srgb, var(--color-text-primary) 8%, transparent);
|
|
1843
|
+
/* The one hairline that stays when borders do not: a thin line blended into the surface, where two panels of the same tone meet. */
|
|
1844
|
+
--ui-edge: color-mix(in srgb, var(--color-text-primary) 8%, transparent);
|
|
1845
|
+
/* Marks that are drawn, not outlines: scrollbar thumbs, the off state of a switch, chart gridlines. They stay visible when borders do not. */
|
|
1846
|
+
--ui-mark: color-mix(in srgb, var(--color-text-primary) 22%, transparent);
|
|
1847
|
+
--ui-grid: color-mix(in srgb, var(--color-text-primary) 10%, transparent);
|
|
1848
|
+
--ui-tint-card: 4%;
|
|
1849
|
+
--ui-tint-tray: 6%;
|
|
1850
|
+
--ui-tint-band: 7%;
|
|
1851
|
+
--ui-tint-field: 7%;
|
|
1852
|
+
--ui-tint-field-hover: 10%;
|
|
1853
|
+
--ui-tint-skeleton: 9%;
|
|
1854
|
+
--ui-wash: 14%;
|
|
1855
|
+
/* Control and row sizes. */
|
|
1856
|
+
--ui-ctl: 32px;
|
|
1857
|
+
--ui-ctl-sm: 28px;
|
|
1858
|
+
--ui-hit: 40px;
|
|
1859
|
+
--ui-row-h: 48px;
|
|
1860
|
+
--ui-icon: 20px;
|
|
1861
|
+
--ui-icon-sm: 16px;
|
|
1862
|
+
--ui-tight: 2px;
|
|
1863
|
+
--ui-lh: 20px;
|
|
1864
|
+
--ui-title-lh: 24px;
|
|
1865
|
+
--ui-tracking: -0.01em;
|
|
1866
|
+
--ui-count-pad: 1px 6px;
|
|
1867
|
+
--ui-focus: 2px;
|
|
1868
|
+
--ui-hairline: 1px;
|
|
1869
|
+
--ui-transition: 0.12s ease;
|
|
1870
|
+
--ui-disabled: 0.5;
|
|
1871
|
+
--ui-scrim: color-mix(in srgb, #000 45%, transparent);
|
|
1872
|
+
--ui-scrim-ink: #fff;
|
|
1873
|
+
--ui-shadow-pop: 0 8px 24px color-mix(in srgb, #000 16%, transparent), 0 0 0 1px color-mix(in srgb, #000 5%, transparent);
|
|
1874
|
+
}
|
|
1875
|
+
|
|
1876
|
+
:root[data-theme="dark"] {
|
|
1877
|
+
--ui-accent: #2dd4bf;
|
|
1878
|
+
--ui-accent-hover: #5eead4;
|
|
1879
|
+
--ui-accent-ink: #04201d;
|
|
1880
|
+
--ui-surface: var(--color-background-global);
|
|
1881
|
+
--ui-tint-card: 5%;
|
|
1882
|
+
--ui-card: color-mix(in srgb, var(--color-text-primary) var(--ui-tint-card), var(--color-background-page));
|
|
1883
|
+
--ui-tint-band: 10%;
|
|
1884
|
+
--ui-tint-field: 11%;
|
|
1885
|
+
--ui-tint-field-hover: 15%;
|
|
1886
|
+
}
|