@crewlethq/tokens 0.37.1 → 0.38.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/README.md +10 -1
- package/dist/css/themes.css +3 -3
- package/dist/themes.d.ts +4 -4
- package/dist/themes.js +4 -4
- package/package.json +1 -1
- package/test/palette.mjs +24 -6
- package/test/palette.test.mjs +8 -0
package/README.md
CHANGED
|
@@ -45,6 +45,15 @@ const accent = color.brand.accent;
|
|
|
45
45
|
CSS variables follow Style Dictionary's `--{group}-{path}` convention,
|
|
46
46
|
for example `var(--color-brand-accent)` or `var(--spacing-4)`.
|
|
47
47
|
|
|
48
|
+
## Changed in 0.38.0: the hairline that finds a card
|
|
49
|
+
|
|
50
|
+
The plain hairline is the edge of every card and the line inside one: the rule under a card's head, the divider between two stat tiles, a code block's edge and a quiet tag's outline. The palette suite held it to dE 3, the floor for a difference a reader looks for, and the default dark palette drew it dE 3.1 off the card (1.07:1), where a layout audit measured those lines as gone. It is now held to dE 5 on both sides of it, the most the default dark ladder allows while the rail's current row keeps dE 3 against raised. Every named theme already cleared it.
|
|
51
|
+
|
|
52
|
+
| What changed | What to change | Details |
|
|
53
|
+
| --- | --- | --- |
|
|
54
|
+
| `--color-border-default` in the default palette is `#1e2025` in dark (from `#191b20`: dE 5.18 on the card, 1.13:1) and `#e5e6ea` in light (from `#e7e8ec`: dE 5.12 on the sheet, 6.60 on the card). | Nothing. | [Surfaces](#surfaces) |
|
|
55
|
+
| In `@crewlethq/tokens/test/palette`, `the hairline that finds a card is visible on both sides of it` measures against the new export `CARD_HAIRLINE_DE` (5). `HAIRLINE_DE` (3) is unchanged and still holds the strong hairline round a raised chip and the line round the rail's current row. | Nothing, unless an application's own palette override draws the plain hairline within dE 5 of its card or sheet. | [The palette suite](#the-palette-suite) |
|
|
56
|
+
|
|
48
57
|
## Changed in 0.37.1: focus handed back
|
|
49
58
|
|
|
50
59
|
The baseline keeps the ring off an element marked `data-crewlet-focus-returned` (by `@crewlethq/ui`'s `returnFocus`) while the root says the last move was a pointer's (`data-crewlet-focus="pointer"`). A trigger focused again when its palette closes matched `:focus-visible` because the palette's field did, so a click and an Escape left it ringed. The outline turns transparent rather than going, so forced colors still paints one.
|
|
@@ -283,7 +292,7 @@ Four opaque rungs, lowest first. Every ground a piece of text can land on is one
|
|
|
283
292
|
Each step is held to what it has to do, in OKLab dE, by the palette suite:
|
|
284
293
|
|
|
285
294
|
- **The sheet lifts off the frame by dE 3** (3.05 dark, 3.40 light). That lift is the whole layering device. The approved dark sheet, `#0c0e15`, measured 2.96 and was lifted along lightness alone to `#0c0e16`.
|
|
286
|
-
- **A card separates from the sheet by dE 1.5** (2.69 dark, 1.55 light), near-flat on purpose: a card is found by its **hairline**, and a page of cards each lifted by dE 3 is a relief map. So `--color-border-default` is held to dE
|
|
295
|
+
- **A card separates from the sheet by dE 1.5** (2.69 dark, 1.55 light), near-flat on purpose: a card is found by its **hairline**, and a page of cards each lifted by dE 3 is a relief map. So `--color-border-default` is held to dE 5 (`CARD_HAIRLINE_DE`) against both the card and the sheet (5.18 and 7.82 dark, 6.60 and 5.12 light), and `@crewlethq/ui`'s Card suite holds every card variant that stands on this rung to drawing it.
|
|
287
296
|
- **Raised separates from the card by dE 3** (8.52 dark, 3.00 light), because a well has no border of its own. A chip on raised does carry one: the strong hairline round it is held to dE 3 against every rung and every overlay on one (`RAISED_CHIP`), because on a raised ground its fill draws nothing.
|
|
288
297
|
|
|
289
298
|
`--color-surface-hover`, `-pressed` and `-inset` stay **translucent**, so a hovered row is right on every rung. The approved palette draws its hover and its sunk well as overlays too (the hover at 0.061 in dark and 0.044 in light), and both ship as drawn. The suite holds the overlays from below, a hovered row dE 3 off every rung and a pressed row dE 3 off a hovered one: the light hover clears the first at exactly its approved alpha (3.04 on the frame), and the pressed overlay is the least alpha that clears the second (0.098 dark, 0.088 light). In light the overlays and the shadows are drawn in the dark frame's near-black. `--color-surface-glass` is the card at 0.90, frosted by `--blur-sm`: the ground of what floats over CONTENT rather than over interface, a canvas's bars and a chart's reading, and the suite holds every text step over 4.5:1 on it with each data hue, the residual and the inverse ground behind it. And `--color-surface-veil`, the ground a dialog sits on, is each root's own **frame** at 0.65: the application recedes into its own ground rather than under a film of its page.
|
package/dist/css/themes.css
CHANGED
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
--color-brand-accent-soft: rgba(114, 91, 230, 0.16);
|
|
42
42
|
--color-brand-accent-rgb: 114, 91, 230;
|
|
43
43
|
--color-brand-accent-soft-strong: rgba(114, 91, 230, 0.32);
|
|
44
|
-
--color-border-default: #
|
|
44
|
+
--color-border-default: #1e2025;
|
|
45
45
|
--color-border-hover: #2d3448;
|
|
46
46
|
--color-border-strong: #2d3448;
|
|
47
47
|
--color-border-strong-hover: #424f74;
|
|
@@ -154,7 +154,7 @@
|
|
|
154
154
|
--color-brand-accent-soft: rgba(115, 90, 242, 0.125);
|
|
155
155
|
--color-brand-accent-rgb: 115, 90, 242;
|
|
156
156
|
--color-brand-accent-soft-strong: rgba(115, 90, 242, 0.32);
|
|
157
|
-
--color-border-default: #
|
|
157
|
+
--color-border-default: #e5e6ea;
|
|
158
158
|
--color-border-hover: #c9cfdc;
|
|
159
159
|
--color-border-strong: #c9cfdc;
|
|
160
160
|
--color-border-strong-hover: #acb6cc;
|
|
@@ -265,7 +265,7 @@
|
|
|
265
265
|
--color-brand-accent-soft: rgba(115, 90, 242, 0.125);
|
|
266
266
|
--color-brand-accent-rgb: 115, 90, 242;
|
|
267
267
|
--color-brand-accent-soft-strong: rgba(115, 90, 242, 0.32);
|
|
268
|
-
--color-border-default: #
|
|
268
|
+
--color-border-default: #e5e6ea;
|
|
269
269
|
--color-border-hover: #c9cfdc;
|
|
270
270
|
--color-border-strong: #c9cfdc;
|
|
271
271
|
--color-border-strong-hover: #acb6cc;
|
package/dist/themes.d.ts
CHANGED
|
@@ -44,7 +44,7 @@ export declare const themes: {
|
|
|
44
44
|
readonly accentSoftStrong: "rgba(115, 90, 242, 0.32)";
|
|
45
45
|
};
|
|
46
46
|
readonly border: {
|
|
47
|
-
readonly default: "#
|
|
47
|
+
readonly default: "#e5e6ea";
|
|
48
48
|
readonly hover: "#c9cfdc";
|
|
49
49
|
readonly strong: "#c9cfdc";
|
|
50
50
|
readonly strongHover: "#acb6cc";
|
|
@@ -170,7 +170,7 @@ export declare const themes: {
|
|
|
170
170
|
readonly accentSoftStrong: "rgba(114, 91, 230, 0.32)";
|
|
171
171
|
};
|
|
172
172
|
readonly border: {
|
|
173
|
-
readonly default: "#
|
|
173
|
+
readonly default: "#1e2025";
|
|
174
174
|
readonly hover: "#2d3448";
|
|
175
175
|
readonly strong: "#2d3448";
|
|
176
176
|
readonly strongHover: "#424f74";
|
|
@@ -305,7 +305,7 @@ export declare const themeRegistry: readonly [{
|
|
|
305
305
|
readonly sheet: "#0c0e16";
|
|
306
306
|
readonly card: "#11141d";
|
|
307
307
|
readonly raised: "#242833";
|
|
308
|
-
readonly hairline: "#
|
|
308
|
+
readonly hairline: "#1e2025";
|
|
309
309
|
readonly text: "#e7eaf3";
|
|
310
310
|
readonly muted: "#5a6176";
|
|
311
311
|
readonly accent: "#725be6";
|
|
@@ -320,7 +320,7 @@ export declare const themeRegistry: readonly [{
|
|
|
320
320
|
readonly sheet: "#f6f7fb";
|
|
321
321
|
readonly card: "#fcfcfc";
|
|
322
322
|
readonly raised: "#f1f2f6";
|
|
323
|
-
readonly hairline: "#
|
|
323
|
+
readonly hairline: "#e5e6ea";
|
|
324
324
|
readonly text: "#121625";
|
|
325
325
|
readonly muted: "#878d9f";
|
|
326
326
|
readonly accent: "#735af2";
|
package/dist/themes.js
CHANGED
|
@@ -45,7 +45,7 @@ export const themes = {
|
|
|
45
45
|
"accentSoftStrong": "rgba(115, 90, 242, 0.32)"
|
|
46
46
|
},
|
|
47
47
|
"border": {
|
|
48
|
-
"default": "#
|
|
48
|
+
"default": "#e5e6ea",
|
|
49
49
|
"hover": "#c9cfdc",
|
|
50
50
|
"strong": "#c9cfdc",
|
|
51
51
|
"strongHover": "#acb6cc",
|
|
@@ -171,7 +171,7 @@ export const themes = {
|
|
|
171
171
|
"accentSoftStrong": "rgba(114, 91, 230, 0.32)"
|
|
172
172
|
},
|
|
173
173
|
"border": {
|
|
174
|
-
"default": "#
|
|
174
|
+
"default": "#1e2025",
|
|
175
175
|
"hover": "#2d3448",
|
|
176
176
|
"strong": "#2d3448",
|
|
177
177
|
"strongHover": "#424f74",
|
|
@@ -311,7 +311,7 @@ export const themeRegistry = [
|
|
|
311
311
|
"sheet": "#0c0e16",
|
|
312
312
|
"card": "#11141d",
|
|
313
313
|
"raised": "#242833",
|
|
314
|
-
"hairline": "#
|
|
314
|
+
"hairline": "#1e2025",
|
|
315
315
|
"text": "#e7eaf3",
|
|
316
316
|
"muted": "#5a6176",
|
|
317
317
|
"accent": "#725be6",
|
|
@@ -326,7 +326,7 @@ export const themeRegistry = [
|
|
|
326
326
|
"sheet": "#f6f7fb",
|
|
327
327
|
"card": "#fcfcfc",
|
|
328
328
|
"raised": "#f1f2f6",
|
|
329
|
-
"hairline": "#
|
|
329
|
+
"hairline": "#e5e6ea",
|
|
330
330
|
"text": "#121625",
|
|
331
331
|
"muted": "#878d9f",
|
|
332
332
|
"accent": "#735af2",
|
package/package.json
CHANGED
package/test/palette.mjs
CHANGED
|
@@ -80,10 +80,10 @@ export const OPAQUE_SURFACES = [
|
|
|
80
80
|
* found by its HAIRLINE rather than by its fill: a page of cards each lifted
|
|
81
81
|
* by dE 3 is a relief map. So the step comes with a second rule, and that is
|
|
82
82
|
* the one that carries the card: the plain border (CARD_HAIRLINE) has to be
|
|
83
|
-
* a line a reader can see,
|
|
84
|
-
* sheet around it. That a card actually DRAWS that border is a
|
|
85
|
-
* rule, held by the Card suite in @crewlethq/ui, because a palette
|
|
86
|
-
* a stylesheet.
|
|
83
|
+
* a line a reader can see, CARD_HAIRLINE_DE against the card it bounds and
|
|
84
|
+
* against the sheet around it. That a card actually DRAWS that border is a
|
|
85
|
+
* component rule, held by the Card suite in @crewlethq/ui, because a palette
|
|
86
|
+
* cannot see a stylesheet.
|
|
87
87
|
* - RAISED OVER THE CARD is a chip, a well or a key cap with no border of its
|
|
88
88
|
* own, so it is the fill alone that says it is there: dE 3.
|
|
89
89
|
*
|
|
@@ -105,6 +105,24 @@ export const RUNG_STEPS = [
|
|
|
105
105
|
export const CARD_HAIRLINE = ['--color-border-default', '--color-surface-subtle', '--color-surface-background'];
|
|
106
106
|
export const HAIRLINE_DE = 3;
|
|
107
107
|
|
|
108
|
+
/**
|
|
109
|
+
* THE FLOOR FOR THE LINE THAT FINDS A CARD, above the hairline floor every
|
|
110
|
+
* other line keeps.
|
|
111
|
+
*
|
|
112
|
+
* dE 3 is the floor at which a reader can tell two colours apart when looking
|
|
113
|
+
* for the difference. The plain hairline is not looked for: it is the edge of
|
|
114
|
+
* every card, the rule under every card's head, the divider between every
|
|
115
|
+
* pair of stat tiles and the outline of every quiet tag, and it has to be seen
|
|
116
|
+
* at a glance. Held to dE 3 alone, the default dark palette drew it dE 3.1 off
|
|
117
|
+
* the card, 1.07:1, and a layout audit measured those lines as gone: a tile's
|
|
118
|
+
* footer rule, a stat row's dividers and an outline tag read as loose text.
|
|
119
|
+
* Every named theme already drew it at dE 6.6 or more in dark. dE 5 is as
|
|
120
|
+
* far as the default dark ladder lets it move along lightness while the rail's
|
|
121
|
+
* current row (raised, RAIL_CURRENT_ROW) keeps HAIRLINE_DE against it, and it
|
|
122
|
+
* is where the line reads as a line.
|
|
123
|
+
*/
|
|
124
|
+
export const CARD_HAIRLINE_DE = 5;
|
|
125
|
+
|
|
108
126
|
/**
|
|
109
127
|
* A chip drawn on the raised rung inside the strong hairline, as [fill,
|
|
110
128
|
* edge]: the neutral pill, and a key cap. Its fill IS raised, so on a raised
|
|
@@ -1306,10 +1324,10 @@ function checkState(state, values, profile, push, theme = { tint: null, contrast
|
|
|
1306
1324
|
const measured = deltaE(colour(line), colour(side));
|
|
1307
1325
|
say(
|
|
1308
1326
|
'the hairline that finds a card is visible on both sides of it',
|
|
1309
|
-
measured >=
|
|
1327
|
+
measured >= CARD_HAIRLINE_DE,
|
|
1310
1328
|
`${line} on ${side}`,
|
|
1311
1329
|
measured,
|
|
1312
|
-
`dE ${measured.toFixed(2)} >= ${
|
|
1330
|
+
`dE ${measured.toFixed(2)} >= ${CARD_HAIRLINE_DE}`,
|
|
1313
1331
|
);
|
|
1314
1332
|
}
|
|
1315
1333
|
}
|
package/test/palette.test.mjs
CHANGED
|
@@ -272,6 +272,14 @@ describe('the four rungs', () => {
|
|
|
272
272
|
assert.deepEqual(darkFailures(line, dark.surface.subtle), ['the hairline that finds a card is visible on both sides of it']);
|
|
273
273
|
});
|
|
274
274
|
|
|
275
|
+
test('a hairline that only clears the noticing floor is caught', () => {
|
|
276
|
+
// The dark line as it shipped before CARD_HAIRLINE_DE: dE 3.1 off the
|
|
277
|
+
// card, 1.07:1, which a layout audit measured as no line at all inside a
|
|
278
|
+
// card (a stat row's dividers, a tile's footer rule, an outline tag).
|
|
279
|
+
const [line] = CARD_HAIRLINE;
|
|
280
|
+
assert.deepEqual(darkFailures(line, '#191b20'), ['the hairline that finds a card is visible on both sides of it']);
|
|
281
|
+
});
|
|
282
|
+
|
|
275
283
|
test('a raised chip is measured in every theme state, and one whose edge is its own fill is caught', () => {
|
|
276
284
|
const CHIP_RULE = 'the strong hairline finds a raised chip on every ground';
|
|
277
285
|
const [fill, edge] = RAISED_CHIP;
|