@siyahi/tools 0.1.9-next.33 → 0.1.9-next.34

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 CHANGED
@@ -178,6 +178,7 @@ the surface under it. It fails unless text reaches 4.5:1 on the page, on its own
178
178
  fill and on the tints Siyahi's components put it on (Callout washes, the
179
179
  destructive tint and its hover, code-line fills, treemap heat steps), a field's
180
180
  edge, the focus ring, a selected tab and every chart and meaning colour reach
181
- 3:1 against what is next to them, and every colour sits inside sRGB. Slots two
181
+ 3:1 against what is next to them, every bar colour's tint (`--bar-tint`) reaches
182
+ 1.5:1 against the card and each slot's against the next slot's, and every colour sits inside sRGB. Slots two
182
183
  apart share a lightness and are told apart by hue, so series take slots in
183
184
  order.
package/contrast.mjs CHANGED
@@ -35,6 +35,12 @@ import { readTheme } from "./theme.mjs";
35
35
 
36
36
  const TEXT = 4.5;
37
37
  const MARK = 3;
38
+ // A fill told apart from the fill or card beside it, inside a 1px edge that already carries the mark's 3:1. Only a
39
+ // nearly solid tint reaches 3:1 against its neighbour's: the solid slots next to each other sit just over 3:1, and
40
+ // mixing both into the card narrows that. At 25% a stack's pale segments sat at 1.2:1 against each other and read as
41
+ // one, and a pale slot's lone bar at 1.3:1 against the card. 1.5:1 is a guard against sliding back there, not a
42
+ // published threshold.
43
+ const FILL = 1.5;
38
44
  const SURFACES = ["background", "card"];
39
45
  const CHARTS = ["chart-1", "chart-2", "chart-3", "chart-4", "chart-5"];
40
46
 
@@ -145,11 +151,21 @@ const PAIRS = [
145
151
  // The selected tab's fill against its list.
146
152
  { fg: "foreground", bg: "muted", min: MARK },
147
153
  // Chart marks on the canvas and the card. A bar is read by its full-colour
148
- // edge, so these are the edges too; the tint inside is carried by the edge and
149
- // has no pair of its own, nor has a dimmed bar's fainter tint. A stale
150
- // block's marks (greyed, at 65%) are exempt: stale is meant to read faintly.
154
+ // edge, so these are the edges too. A stale block's marks (greyed, at 65%)
155
+ // are exempt: stale is meant to read faintly.
151
156
  ...[...CHARTS, "positive", "negative"].map((fg) => ({ fg, bg: "", min: MARK })),
152
157
  ...CHARTS.slice(0, -1).map((fg, i) => ({ fg, bg: CHARTS[i + 1] ?? "", min: MARK })),
158
+ // A bar's tint (--bar-tint) carries its colour where the bar is short, such as
159
+ // a thin stacked segment that is mostly edge: every bar colour's tint against
160
+ // the card, and each slot's against the next slot's, its neighbour in a stack.
161
+ // A dimmed bar's fainter tint has no pair: a selection means it to fade.
162
+ ...[...CHARTS, "positive", "negative"].map((fg) => ({ fg: `${fg}@bar-tint`, bg: "", min: FILL, surface: "card" })),
163
+ ...CHARTS.slice(0, -1).map((slot, i) => ({
164
+ fg: `${slot}@bar-tint`,
165
+ bg: `${CHARTS[i + 1]}@bar-tint`,
166
+ min: FILL,
167
+ surface: "card",
168
+ })),
153
169
  // Every bar colour against the 40% muted band a chart card lays behind a
154
170
  // hovered category (lib/chart-frame).
155
171
  ...[...CHARTS, "positive", "negative"].map((fg) => ({ fg, bg: "muted/40", min: MARK, surface: "card" })),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@siyahi/tools",
3
- "version": "0.1.9-next.33",
3
+ "version": "0.1.9-next.34",
4
4
  "description": "Checks and build helpers for Siyahi pages: a lint plugin, a font preload plugin, a theme contrast check, and screenshot and layout shift scripts.",
5
5
  "homepage": "https://siyahi.jatinbansal.com",
6
6
  "license": "MIT",