@eos-ui/tokens 0.2.0 → 0.2.1

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.
@@ -54,7 +54,7 @@ export declare const defaults: {
54
54
  readonly measure: "62ch";
55
55
  readonly "stroke-hair": "1px";
56
56
  readonly "stroke-card": "1px";
57
- readonly "stroke-edge": "1.5px";
57
+ readonly "stroke-edge": "1px";
58
58
  readonly "stroke-focus": "2px";
59
59
  readonly "focus-gap": "2px";
60
60
  readonly "focus-gap-field": "calc(-1 * var(--e-stroke-edge))";
@@ -55,7 +55,7 @@ export const defaults = {
55
55
  "measure": "62ch",
56
56
  "stroke-hair": "1px",
57
57
  "stroke-card": "1px",
58
- "stroke-edge": "1.5px",
58
+ "stroke-edge": "1px",
59
59
  "stroke-focus": "2px",
60
60
  "focus-gap": "2px",
61
61
  "focus-gap-field": "calc(-1 * var(--e-stroke-edge))",
@@ -225,7 +225,7 @@ export const usage = {
225
225
  "measure": "Longest comfortable line of copy.",
226
226
  "stroke-hair": "Dividers and the rule between rows.",
227
227
  "stroke-card": "The outline of a card, panel, table or other container that is not clickable, and of a chip or stamp. Follows the hairline; a bold elevation draws it at 2px unless `strokes.card` sets it.",
228
- "stroke-edge": "The outline of a control, chip or stamp. 1.5 times the hairline unless `strokes.edge` sets it.",
228
+ "stroke-edge": "The outline of a control, chip or stamp. The same as the hairline unless `strokes.edge` sets it (a whole number of pixels, rounded down from 1.5 times a custom hairline), so the border and the outline laid over it line up in every browser.",
229
229
  "stroke-focus": "The focus outline.",
230
230
  "focus-gap": "Space between a button or link and its focus outline.",
231
231
  "focus-gap-field": "Space between a text input and its focus outline: minus the control border, so the outline lies exactly over the border with no seam, whatever its width.",
package/dist/theme.d.ts CHANGED
@@ -35,7 +35,7 @@ export interface ThemeInput {
35
35
  textScale?: number;
36
36
  /** Multiplier for the spacing scale, `space-1` to `space-8`. 1 is the default scale; non-finite or non-positive values are ignored. */
37
37
  spaceScale?: number;
38
- /** Line weights in px. `hair` sets `stroke-hair`, `stroke-card` and `stroke-edge` (1.5 times it); `focus` sets `stroke-focus` and `focus-gap` (the same). `edge` and `card` set `stroke-edge` (controls) and `stroke-card` (containers, chips) outright and win over what `hair` and a bold `elevation` give. `focus-gap-field` always follows `stroke-edge` in CSS (minus the border width), so a field's focus outline sits exactly over its border. */
38
+ /** Line weights in px. `hair` sets `stroke-hair`, `stroke-card` and `stroke-edge` (1.5 times it, rounded down to whole pixels); `focus` sets `stroke-focus` and `focus-gap` (the same). `edge` and `card` set `stroke-edge` (controls) and `stroke-card` (containers, chips) outright and win over what `hair` and a bold `elevation` give. `focus-gap-field` always follows `stroke-edge` in CSS (minus the border width), so a field's focus outline sits exactly over its border. */
39
39
  strokes?: {
40
40
  hair?: number;
41
41
  focus?: number;
package/dist/theme.js CHANGED
@@ -59,7 +59,7 @@ function deriveStrokes(input, out) {
59
59
  if (hair !== undefined) {
60
60
  out["stroke-hair"] = px(hair);
61
61
  out["stroke-card"] = px(hair);
62
- out["stroke-edge"] = px(hair * 1.5);
62
+ out["stroke-edge"] = px(Math.max(1, Math.floor(hair * 1.5)));
63
63
  }
64
64
  if (focus !== undefined) {
65
65
  out["stroke-focus"] = px(focus);
package/dist/tokens.css CHANGED
@@ -57,7 +57,7 @@
57
57
  --e-measure: 62ch;
58
58
  --e-stroke-hair: 1px;
59
59
  --e-stroke-card: 1px;
60
- --e-stroke-edge: 1.5px;
60
+ --e-stroke-edge: 1px;
61
61
  --e-stroke-focus: 2px;
62
62
  --e-focus-gap: 2px;
63
63
  --e-focus-gap-field: calc(-1 * var(--e-stroke-edge));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eos-ui/tokens",
3
- "version": "0.2.0",
3
+ "version": "0.2.1",
4
4
  "description": "Eos design tokens: CSS custom properties, typed values and a theme generator with contrast checks.",
5
5
  "type": "module",
6
6
  "license": "MIT",
package/src/tokens.json CHANGED
@@ -484,8 +484,8 @@
484
484
  },
485
485
  {
486
486
  "name": "stroke-edge",
487
- "value": "1.5px",
488
- "usage": "The outline of a control, chip or stamp. 1.5 times the hairline unless `strokes.edge` sets it.",
487
+ "value": "1px",
488
+ "usage": "The outline of a control, chip or stamp. The same as the hairline unless `strokes.edge` sets it (a whole number of pixels, rounded down from 1.5 times a custom hairline), so the border and the outline laid over it line up in every browser.",
489
489
  "from": "strokes"
490
490
  },
491
491
  {