@eluan/tokens 0.3.0 → 0.4.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 CHANGED
@@ -39,14 +39,14 @@ Then activate a theme by setting attributes on `<html>` (or use `<EluanProvider>
39
39
  | Font-size aliases | `--font-size-xs` … `--font-size-5xl` | `data-spacing` picks a typeset step |
40
40
  | Fonts | `--font-heading`, `--font-body`, `--font-mono` | `data-theme` |
41
41
 
42
- The typeset is a fluid 12-step scale: each step interpolates between anchors at 480px, 748px, and 1024px viewport widths, so type resizes without media queries. `data-typeset="small" \| "medium" \| "large"` pins the whole scale (or any subtree) to one column; omit the attribute for fluid behaviour. Spacing density shifts the `--font-size-*` aliases one step up or down. Full details in the [theming guide](https://github.com/vasfio/eluan/blob/main/docs/theming.md#the-typeset-axis).
42
+ The typeset is a fluid 10-step scale: each step interpolates between anchors at 480px, 748px, and 1024px viewport widths, so type resizes without media queries. `data-typeset="small" \| "medium" \| "large"` pins the whole scale (or any subtree) to one column; omit the attribute for fluid behaviour. Spacing density shifts the `--font-size-*` aliases one step up or down. Full details in the [theming guide](https://github.com/vasfio/eluan/blob/main/docs/theming.md#the-typeset-axis).
43
43
 
44
44
  ## Fonts
45
45
 
46
46
  Two faces ship with the package:
47
47
 
48
48
  - **Paper Mono** — the monospace face for every theme. A variable font (weight axis 100–800) vendored as WOFF2 inside the package, so it works offline with no CDN or extra dependency. Licensed under the SIL Open Font License 1.1.
49
- - **Inter** — the `minimal` theme's heading and body face, self-hosted via `@fontsource/inter` (weights 400 and 500 only).
49
+ - **Inter Variable** — the `minimal` theme's heading and body face, self-hosted via `@fontsource-variable/inter` (weight axis 100–900, so every weight is a real face).
50
50
 
51
51
  ## Subpath exports
52
52
 
@@ -1,3 +1,2 @@
1
- /* minimal theme — Inter (heading + body) */
2
- @import "@fontsource/inter/400.css";
3
- @import "@fontsource/inter/500.css";
1
+ /* minimal theme — Inter Variable, wght 100–900 (heading + body) */
2
+ @import "@fontsource-variable/inter/wght.css";
package/dist/fonts.css CHANGED
@@ -3,15 +3,13 @@
3
3
  Self-hosted, no CDN dependency.
4
4
 
5
5
  Paper Mono ships inside this package as a variable WOFF2 (wght 100–800) and
6
- is declared in fonts-base.css. Inter comes from Google Fonts via @fontsource;
7
- only the weights the system actually uses are loaded (max weight across all
8
- themes = 500), which is why there is no 600+ import — components cap their
9
- `weight` prop at medium rather than faux-bolding.
6
+ is declared in fonts-base.css. Inter comes from Google Fonts via @fontsource
7
+ as a variable font (wght 100–900), so every weight a component asks for is a
8
+ real face — nothing is faux-bolded.
10
9
  */
11
10
 
12
11
  /* Paper Mono — all themes mono */
13
12
  @import "./fonts-base.css";
14
13
 
15
- /* Inter — minimal heading + body */
16
- @import "@fontsource/inter/400.css";
17
- @import "@fontsource/inter/500.css";
14
+ /* Inter Variable — minimal heading + body */
15
+ @import "@fontsource-variable/inter/wght.css";
package/dist/index.js CHANGED
@@ -442,7 +442,7 @@ export const viewports = {
442
442
  // ============================================
443
443
  // Typeset — Fluid Type Scale
444
444
  // ============================================
445
- // The 12-step scale that replaced the static font-size primitives. Each step
445
+ // The 10-step scale that replaced the static font-size primitives. Each step
446
446
  // has three anchor values; on the web they are interpolated by the two-segment
447
447
  // clamp()s in typeset.css, on other platforms by resolveTypesetSize() below.
448
448
  //
@@ -646,8 +646,7 @@ export async function loadThemeFonts(theme) {
646
646
  return;
647
647
  switch (theme) {
648
648
  case "minimal":
649
- await import("@fontsource/inter/400.css");
650
- await import("@fontsource/inter/500.css");
649
+ await import("@fontsource-variable/inter/wght.css");
651
650
  break;
652
651
  }
653
652
  _loadedFonts.add(theme);
package/dist/modes.css CHANGED
@@ -21,6 +21,12 @@
21
21
  --foregrounds-tertiary: var(--color-neutral-600);
22
22
  --foregrounds-quaternary: var(--color-neutral-500);
23
23
  --foregrounds-quinary: var(--color-neutral-400);
24
+ /* Tooltip surface — mode-aware because the tooltip loses its border in dark
25
+ * mode, where the background and --container-border are the same value.
26
+ * Declared here rather than in themes.css: theme tokens are mode-agnostic
27
+ * aliases, and modes.css is imported first, so a theme-layer declaration
28
+ * would win the cascade over any mode override. */
29
+ --tooltip-bg: var(--backgrounds-primary);
24
30
  --maitai-main: var(--color-maitai-500);
25
31
  --maitai-background: var(--color-maitai-50);
26
32
  --maitai-tint: var(--color-maitai-100);
@@ -128,6 +134,7 @@
128
134
  --foregrounds-tertiary: var(--color-teak-800);
129
135
  --foregrounds-quaternary: var(--color-teak-700);
130
136
  --foregrounds-quinary: var(--color-teak-600);
137
+ --tooltip-bg: var(--backgrounds-primary);
131
138
  --maitai-main: var(--color-maitai-600);
132
139
  --maitai-background: var(--color-maitai-100);
133
140
  --maitai-tint: var(--color-maitai-200);
@@ -235,6 +242,8 @@
235
242
  --foregrounds-tertiary: var(--color-neutral-200);
236
243
  --foregrounds-quaternary: var(--color-neutral-300);
237
244
  --foregrounds-quinary: var(--color-neutral-400);
245
+ /* Same value as --container-border, so the tooltip border disappears. */
246
+ --tooltip-bg: var(--backgrounds-tertiary);
238
247
  --maitai-main: var(--color-maitai-500);
239
248
  --maitai-background: var(--color-maitai-950);
240
249
  --maitai-tint: var(--color-maitai-900);
@@ -321,11 +321,17 @@
321
321
  * Semantic --size-* tokens (spacing.css) reference these so component
322
322
  * dimensions never borrow from the spacing family. */
323
323
  --sizing-size-12: 0.75rem;
324
+ --sizing-size-14: 0.875rem;
324
325
  --sizing-size-16: 1rem;
326
+ --sizing-size-18: 1.125rem;
325
327
  --sizing-size-20: 1.25rem;
328
+ --sizing-size-22: 1.375rem;
326
329
  --sizing-size-24: 1.5rem;
330
+ --sizing-size-28: 1.75rem;
327
331
  --sizing-size-32: 2rem;
332
+ --sizing-size-36: 2.25rem;
328
333
  --sizing-size-40: 2.5rem;
334
+ --sizing-size-44: 2.75rem;
329
335
  --sizing-size-48: 3rem;
330
336
  --sizing-size-56: 3.5rem;
331
337
  --sizing-size-64: 4rem;
@@ -341,9 +347,13 @@
341
347
  --spacing-space-0: 0rem;
342
348
  --spacing-space-2: 0.125rem;
343
349
  --spacing-space-4: 0.25rem;
350
+ --spacing-space-6: 0.375rem;
344
351
  --spacing-space-8: 0.5rem;
352
+ --spacing-space-10: 0.625rem;
345
353
  --spacing-space-12: 0.75rem;
354
+ --spacing-space-14: 0.875rem;
346
355
  --spacing-space-16: 1rem;
356
+ --spacing-space-18: 1.125rem;
347
357
  --spacing-space-20: 1.25rem;
348
358
  --spacing-space-24: 1.5rem;
349
359
  --spacing-space-32: 2rem;
@@ -366,7 +376,7 @@
366
376
  /* ----------------------------------------
367
377
  * Font Size Primitives
368
378
  * ----------------------------------------
369
- * Removed. Type is no longer a set of static rungs — the fluid 12-step
379
+ * Removed. Type is no longer a set of static rungs — the fluid 10-step
370
380
  * typeset in typeset.css (--font-size-step-6 … --font-size-step-neg3) is
371
381
  * the sole source of sizes, and spacing.css points the density-scaled
372
382
  * --font-size-* aliases at those steps.
package/dist/spacing.css CHANGED
@@ -3,7 +3,9 @@
3
3
  * Semantic spacing tokens that adapt to Compact, Standard, and Wide
4
4
  *
5
5
  * --spacing-* and --size-* reference primitive rungs from Layer 1, and each
6
- * density shifts the whole ladder by one rung.
6
+ * density shifts the whole ladder by one rung. Standard sits on half-step
7
+ * rungs (spacing 2/4/6/10/14/18/20/32/64, sizes 14/18/22/28/36/44/56/80/120)
8
+ * so it lands visibly between compact and wide rather than hugging compact.
7
9
  *
8
10
  * --font-size-* works the same way, but the rungs it picks are typeset steps
9
11
  * (typeset.css), not static primitives: each density selects a step and the
@@ -54,23 +56,23 @@
54
56
  [data-spacing="standard"] {
55
57
  --spacing-xxs: var(--spacing-space-2);
56
58
  --spacing-xs: var(--spacing-space-4);
57
- --spacing-sm: var(--spacing-space-8);
58
- --spacing-md: var(--spacing-space-12);
59
- --spacing-lg: var(--spacing-space-16);
60
- --spacing-xl: var(--spacing-space-20);
61
- --spacing-2xl: var(--spacing-space-24);
62
- --spacing-3xl: var(--spacing-space-40);
63
- --spacing-4xl: var(--spacing-space-80);
59
+ --spacing-sm: var(--spacing-space-6);
60
+ --spacing-md: var(--spacing-space-10);
61
+ --spacing-lg: var(--spacing-space-14);
62
+ --spacing-xl: var(--spacing-space-18);
63
+ --spacing-2xl: var(--spacing-space-20);
64
+ --spacing-3xl: var(--spacing-space-32);
65
+ --spacing-4xl: var(--spacing-space-64);
64
66
 
65
- --size-xxs: var(--sizing-size-16);
66
- --size-xs: var(--sizing-size-20);
67
- --size-sm: var(--sizing-size-24);
68
- --size-md: var(--sizing-size-32);
69
- --size-lg: var(--sizing-size-40);
70
- --size-xl: var(--sizing-size-48);
71
- --size-2xl: var(--sizing-size-64);
72
- --size-3xl: var(--sizing-size-96);
73
- --size-4xl: var(--sizing-size-160);
67
+ --size-xxs: var(--sizing-size-14);
68
+ --size-xs: var(--sizing-size-18);
69
+ --size-sm: var(--sizing-size-22);
70
+ --size-md: var(--sizing-size-28);
71
+ --size-lg: var(--sizing-size-36);
72
+ --size-xl: var(--sizing-size-44);
73
+ --size-2xl: var(--sizing-size-56);
74
+ --size-3xl: var(--sizing-size-80);
75
+ --size-4xl: var(--sizing-size-120);
74
76
 
75
77
  /* The reference mapping — base sits on step-0 */
76
78
  --font-size-xs: var(--font-size-step-neg2);
package/dist/themes.css CHANGED
@@ -48,8 +48,8 @@
48
48
  --color-neutral-800: var(--color-mono-800);
49
49
  --color-neutral-900: var(--color-mono-900);
50
50
  --color-neutral-950: var(--color-mono-950);
51
- --font-heading: "Inter", ui-sans-serif, system-ui, sans-serif;
52
- --font-body: "Inter", ui-sans-serif, system-ui, sans-serif;
51
+ --font-heading: "Inter Variable", "Inter", ui-sans-serif, system-ui, sans-serif;
52
+ --font-body: "Inter Variable", "Inter", ui-sans-serif, system-ui, sans-serif;
53
53
  --font-mono: "Paper Mono", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
54
54
  --container-bg: var(--backgrounds-primary);
55
55
  --container-bg-alt: var(--backgrounds-secondary);
package/dist/typeset.css CHANGED
@@ -1,7 +1,7 @@
1
1
  /* ============================================
2
2
  * Typeset — Fluid Type Scale
3
3
  *
4
- * A 12-step scale (step-6 … step-0 … step-neg3) where every step is
4
+ * A 10-step scale (step-6 … step-0 … step-neg3) where every step is
5
5
  * viewport-fluid. Each step interpolates linearly between three anchors:
6
6
  *
7
7
  * small 480px = 30rem → --viewports-screen-s (primitives.css)
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@eluan/tokens",
3
3
  "description": "Design tokens, CSS variables, themes, and fonts for the Eluan design system",
4
- "version": "0.3.0",
4
+ "version": "0.4.0",
5
5
  "license": "MIT",
6
6
  "author": "Frolda",
7
7
  "homepage": "https://github.com/vasfio/eluan#readme",
@@ -49,7 +49,7 @@
49
49
  "typescript": "^5.4.5"
50
50
  },
51
51
  "dependencies": {
52
- "@fontsource/inter": "^5.2.8"
52
+ "@fontsource-variable/inter": "^5.3.0"
53
53
  },
54
54
  "scripts": {
55
55
  "build": "rm -rf dist && tsc -p tsconfig.build.json && cp src/tokens.css src/primitives.css src/modes.css src/themes.css src/spacing.css src/typeset.css src/curves.css src/fonts.css src/fonts-base.css src/fonts-minimal.css dist/ && cp -R src/files dist/files",