@eluan/tokens 0.1.0 → 0.3.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/dist/spacing.css CHANGED
@@ -1,7 +1,21 @@
1
1
  /* ============================================
2
2
  * Spacing Scales
3
3
  * Semantic spacing tokens that adapt to Compact, Standard, and Wide
4
- * These reference primitive spacing tokens from Layer 1
4
+ *
5
+ * --spacing-* and --size-* reference primitive rungs from Layer 1, and each
6
+ * density shifts the whole ladder by one rung.
7
+ *
8
+ * --font-size-* works the same way, but the rungs it picks are typeset steps
9
+ * (typeset.css), not static primitives: each density selects a step and the
10
+ * step's value is itself viewport-fluid. So `--font-size-base` is one step
11
+ * lower in compact and one step higher in wide, and whichever step is chosen
12
+ * still interpolates between its small/medium/large anchors as the viewport
13
+ * changes. Wide saturates at the top of the ladder (4xl and 5xl both land on
14
+ * step-6), mirroring compact, where xs and sm have always shared a rung.
15
+ *
16
+ * Per-step line-height and letter-spacing live alongside the sizes as
17
+ * --line-height-step-* / --letter-spacing-step-*; components that opt into a
18
+ * step (see the Typography component) should take all three together.
5
19
  * ============================================ */
6
20
 
7
21
  [data-spacing="compact"] {
@@ -15,25 +29,26 @@
15
29
  --spacing-3xl: var(--spacing-space-24);
16
30
  --spacing-4xl: var(--spacing-space-32);
17
31
 
18
- --size-xxs: var(--spacing-space-12);
19
- --size-xs: var(--spacing-space-16);
20
- --size-sm: var(--spacing-space-20);
21
- --size-md: var(--spacing-space-24);
22
- --size-lg: var(--spacing-space-32);
23
- --size-xl: var(--spacing-space-40);
24
- --size-2xl: var(--spacing-space-48);
25
- --size-3xl: var(--spacing-space-64);
26
- --size-4xl: var(--spacing-space-96);
32
+ --size-xxs: var(--sizing-size-12);
33
+ --size-xs: var(--sizing-size-16);
34
+ --size-sm: var(--sizing-size-20);
35
+ --size-md: var(--sizing-size-24);
36
+ --size-lg: var(--sizing-size-32);
37
+ --size-xl: var(--sizing-size-40);
38
+ --size-2xl: var(--sizing-size-48);
39
+ --size-3xl: var(--sizing-size-64);
40
+ --size-4xl: var(--sizing-size-96);
27
41
 
28
- --font-size-xs: var(--font-size-12);
29
- --font-size-sm: var(--font-size-12);
30
- --font-size-base: var(--font-size-14);
31
- --font-size-lg: var(--font-size-16);
32
- --font-size-xl: var(--font-size-18);
33
- --font-size-2xl: var(--font-size-20);
34
- --font-size-3xl: var(--font-size-24);
35
- --font-size-4xl: var(--font-size-30);
36
- --font-size-5xl: var(--font-size-36);
42
+ /* One typeset step down from standard */
43
+ --font-size-xs: var(--font-size-step-neg3);
44
+ --font-size-sm: var(--font-size-step-neg2);
45
+ --font-size-base: var(--font-size-step-neg1);
46
+ --font-size-lg: var(--font-size-step-0);
47
+ --font-size-xl: var(--font-size-step-1);
48
+ --font-size-2xl: var(--font-size-step-2);
49
+ --font-size-3xl: var(--font-size-step-3);
50
+ --font-size-4xl: var(--font-size-step-4);
51
+ --font-size-5xl: var(--font-size-step-5);
37
52
  }
38
53
 
39
54
  [data-spacing="standard"] {
@@ -47,25 +62,26 @@
47
62
  --spacing-3xl: var(--spacing-space-40);
48
63
  --spacing-4xl: var(--spacing-space-80);
49
64
 
50
- --size-xxs: var(--spacing-space-16);
51
- --size-xs: var(--spacing-space-20);
52
- --size-sm: var(--spacing-space-24);
53
- --size-md: var(--spacing-space-32);
54
- --size-lg: var(--spacing-space-40);
55
- --size-xl: var(--spacing-space-48);
56
- --size-2xl: var(--spacing-space-64);
57
- --size-3xl: var(--spacing-space-96);
58
- --size-4xl: var(--spacing-space-160);
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);
59
74
 
60
- --font-size-xs: var(--font-size-12);
61
- --font-size-sm: var(--font-size-14);
62
- --font-size-base: var(--font-size-16);
63
- --font-size-lg: var(--font-size-18);
64
- --font-size-xl: var(--font-size-20);
65
- --font-size-2xl: var(--font-size-24);
66
- --font-size-3xl: var(--font-size-30);
67
- --font-size-4xl: var(--font-size-36);
68
- --font-size-5xl: var(--font-size-48);
75
+ /* The reference mapping — base sits on step-0 */
76
+ --font-size-xs: var(--font-size-step-neg2);
77
+ --font-size-sm: var(--font-size-step-neg1);
78
+ --font-size-base: var(--font-size-step-0);
79
+ --font-size-lg: var(--font-size-step-1);
80
+ --font-size-xl: var(--font-size-step-2);
81
+ --font-size-2xl: var(--font-size-step-3);
82
+ --font-size-3xl: var(--font-size-step-4);
83
+ --font-size-4xl: var(--font-size-step-5);
84
+ --font-size-5xl: var(--font-size-step-6);
69
85
  }
70
86
 
71
87
  [data-spacing="wide"] {
@@ -79,23 +95,24 @@
79
95
  --spacing-3xl: var(--spacing-space-80);
80
96
  --spacing-4xl: var(--spacing-space-160);
81
97
 
82
- --size-xxs: var(--spacing-space-20);
83
- --size-xs: var(--spacing-space-24);
84
- --size-sm: var(--spacing-space-32);
85
- --size-md: var(--spacing-space-40);
86
- --size-lg: var(--spacing-space-48);
87
- --size-xl: var(--spacing-space-56);
88
- --size-2xl: var(--spacing-space-80);
89
- --size-3xl: var(--spacing-space-120);
90
- --size-4xl: var(--spacing-space-240);
98
+ --size-xxs: var(--sizing-size-20);
99
+ --size-xs: var(--sizing-size-24);
100
+ --size-sm: var(--sizing-size-32);
101
+ --size-md: var(--sizing-size-40);
102
+ --size-lg: var(--sizing-size-48);
103
+ --size-xl: var(--sizing-size-56);
104
+ --size-2xl: var(--sizing-size-80);
105
+ --size-3xl: var(--sizing-size-120);
106
+ --size-4xl: var(--sizing-size-240);
91
107
 
92
- --font-size-xs: var(--font-size-14);
93
- --font-size-sm: var(--font-size-16);
94
- --font-size-base: var(--font-size-18);
95
- --font-size-lg: var(--font-size-20);
96
- --font-size-xl: var(--font-size-24);
97
- --font-size-2xl: var(--font-size-30);
98
- --font-size-3xl: var(--font-size-36);
99
- --font-size-4xl: var(--font-size-48);
100
- --font-size-5xl: var(--font-size-60);
108
+ /* One typeset step up from standard; 4xl/5xl saturate at the ladder top */
109
+ --font-size-xs: var(--font-size-step-neg1);
110
+ --font-size-sm: var(--font-size-step-0);
111
+ --font-size-base: var(--font-size-step-1);
112
+ --font-size-lg: var(--font-size-step-2);
113
+ --font-size-xl: var(--font-size-step-3);
114
+ --font-size-2xl: var(--font-size-step-4);
115
+ --font-size-3xl: var(--font-size-step-5);
116
+ --font-size-4xl: var(--font-size-step-6);
117
+ --font-size-5xl: var(--font-size-step-6);
101
118
  }
package/dist/themes.css CHANGED
@@ -1,172 +1,56 @@
1
1
  /* ============================================
2
2
  * LAYER 3: Themes
3
- * Component-level tokens that define the visual identity
4
- * Each theme uses different accent colors from the primitive palette
3
+ * Component-level tokens that define the visual identity.
4
+ * `minimal` is the only built-in theme; define your own with
5
+ * createTheme() from @eluan/core (or @eluan/theme-generator) — a custom
6
+ * theme inherits this token set and overrides only what it names.
7
+
5
8
  * Categories: action, container, interactive, destructive,
6
9
  * cautionary, important, informative, positive, dataviz
7
10
  * ============================================ */
8
11
  @import "./modes.css";
9
12
  /* ----------------------------------------
10
- * Theme: Classic Retro
11
- * Based on Blaze Orange
13
+ * Neutral ramp — theme-selected alias
14
+ * Each theme points --color-neutral-* at the raw scale that carries its
15
+ * monochrome identity; modes.css derives backgrounds/foregrounds from it,
16
+ * so mode step logic stays shared while the ramp swaps per brand.
17
+ * Custom themes can remap the ramp via createTheme token overrides.
18
+ * The :root default mirrors `minimal` (the sole built-in theme) so unthemed
19
+ * scopes still resolve, and must precede the theme blocks so the attribute
20
+ * selectors win the cascade.
12
21
  * ---------------------------------------- */
13
- [data-theme="industrial-retro"] {
14
- --font-heading: "Geist", ui-sans-serif, system-ui, sans-serif;
15
- --font-body: "Geist", ui-sans-serif, system-ui, sans-serif;
16
- --font-mono: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
17
-
18
- --container-bg: var(--backgrounds-primary);
19
- --container-bg-alt: var(--backgrounds-secondary);
20
- --container-bg-inverse: var(--foregrounds-secondary);
21
- --container-border: var(--backgrounds-tertiary);
22
- --container-border-alt: var(--backgrounds-quaternary);
23
- --container-border-inverse: var(--foregrounds-tertiary);
24
- --container-fg: var(--foregrounds-primary);
25
- --container-fg-alt: var(--foregrounds-secondary);
26
- --container-fg-inverse: var(--backgrounds-primary);
27
- --interactive-bg: var(--backgrounds-primary);
28
- --interactive-bg-alt: var(--backgrounds-secondary);
29
- --interactive-bg-alt2: var(--blazeorange-background);
30
- --interactive-bg-disabled: var(--backgrounds-tertiary);
31
- --interactive-bg-hover: var(--backgrounds-tertiary);
32
- --interactive-bg-active: var(--blazeorange-shade);
33
- --interactive-bg-selected: var(--blazeorange-shade);
34
- --interactive-bg-inverse: var(--foregrounds-primary);
35
- --interactive-border: var(--backgrounds-tertiary);
36
- --interactive-border-alt: var(--backgrounds-quaternary);
37
- --interactive-border-disabled: var(--backgrounds-quaternary);
38
- --interactive-fg: var(--foregrounds-primary);
39
- --interactive-fg-alt: var(--foregrounds-tertiary);
40
- --interactive-fg-readonly: var(--foregrounds-secondary);
41
- --interactive-fg-disabled: var(--foregrounds-quinary);
42
- --interactive-fg-active: var(--blazeorange-tint);
43
- --interactive-fg-selected: var(--blazeorange-tint);
44
- --interactive-fg-inverse: var(--backgrounds-primary);
45
- --action-primary-bg: var(--blazeorange-main);
46
- --action-primary-bg-hover: var(--blazeorange-shade);
47
- --action-primary-bg-active: var(--blazeorange-shade);
48
- --action-primary-bg-selected: var(--blazeorange-shade);
49
- --action-primary-bg-disabled: var(--blazeorange-tint);
50
- --action-primary-bg-inverse: var(--blazeorange-background);
51
- --action-primary-fg: var(--backgrounds-primary);
52
- --action-primary-fg-disabled: var(--foregrounds-quinary);
53
- --action-primary-fg-active: var(--backgrounds-primary);
54
- --action-primary-fg-selected: var(--backgrounds-primary);
55
- --action-primary-fg-inverse: var(--blazeorange-foreground);
56
- --action-secondary-bg-hover: var(--blazeorange-tint);
57
- --action-secondary-bg-active: var(--blazeorange-main);
58
- --action-secondary-bg-selected: var(--blazeorange-main);
59
- --action-secondary-bg-disabled: var(--backgrounds-tertiary);
60
- --action-secondary-border: var(--blazeorange-main);
61
- --action-secondary-border-alt: var(--blazeorange-shade);
62
- --action-secondary-border-disabled: var(--blazeorange-tint);
63
- --action-secondary-border-inverse: var(--blazeorange-background);
64
- --action-secondary-fg: var(--blazeorange-main);
65
- --action-secondary-fg-alt: var(--foregrounds-primary);
66
- --action-secondary-fg-disabled: var(--foregrounds-quinary);
67
- --action-secondary-fg-active: var(--backgrounds-primary);
68
- --action-secondary-fg-selected: var(--backgrounds-primary);
69
- --action-secondary-fg-inverse: var(--foregrounds-primary);
70
- --action-tertiary-bg: var(--backgrounds-primary);
71
- --action-tertiary-bg-alt: var(--backgrounds-secondary);
72
- --action-tertiary-bg-hover: var(--blazeorange-background);
73
- --action-tertiary-bg-active: var(--blazeorange-tint);
74
- --action-tertiary-bg-selected: var(--blazeorange-tint);
75
- --action-tertiary-bg-disabled: var(--backgrounds-primary);
76
- --action-tertiary-bg-inverse: var(--backgrounds-primary);
77
- --action-tertiary-border: var(--blazeorange-main);
78
- --action-tertiary-border-alt: var(--blazeorange-shade);
79
- --action-tertiary-border-disabled: var(--backgrounds-quaternary);
80
- --action-tertiary-border-inverse: var(--blazeorange-tint);
81
- --action-tertiary-fg: var(--blazeorange-main);
82
- --action-tertiary-fg-alt: var(--foregrounds-primary);
83
- --action-tertiary-fg-disabled: var(--foregrounds-quinary);
84
- --action-tertiary-fg-active: var(--blazeorange-foreground);
85
- --action-tertiary-fg-selected: var(--blazeorange-foreground);
86
- --action-tertiary-fg-inverse: var(--backgrounds-primary);
87
- --destructive-bg: var(--torchred-background);
88
- --destructive-bg-alt: var(--torchred-tint);
89
- --destructive-bg-hover: var(--torchred-tint);
90
- --destructive-bg-active: var(--torchred-shade);
91
- --destructive-bg-selected: var(--torchred-shade);
92
- --destructive-bg-disabled: var(--backgrounds-tertiary);
93
- --destructive-bg-inverse: var(--torchred-shade);
94
- --destructive-border: var(--torchred-main);
95
- --destructive-border-alt: var(--torchred-shade);
96
- --destructive-border-disabled: var(--torchred-tint);
97
- --destructive-border-inverse: var(--torchred-background);
98
- --destructive-fg: var(--torchred-foreground);
99
- --destructive-fg-alt: var(--foregrounds-primary);
100
- --destructive-fg-disabled: var(--foregrounds-quinary);
101
- --destructive-fg-active: var(--backgrounds-primary);
102
- --destructive-fg-selected: var(--backgrounds-primary);
103
- --destructive-fg-inverse: var(--torchred-background);
104
- --positive-bg: var(--seagreen-background);
105
- --positive-bg-alt: var(--seagreen-tint);
106
- --positive-bg-inverse: var(--seagreen-shade);
107
- --positive-border: var(--seagreen-main);
108
- --positive-border-alt: var(--seagreen-shade);
109
- --positive-border-inverse: var(--seagreen-background);
110
- --positive-fg: var(--seagreen-foreground);
111
- --positive-fg-alt: var(--foregrounds-primary);
112
- --positive-fg-inverse: var(--seagreen-background);
113
- --cautionary-bg: var(--maitai-background);
114
- --cautionary-bg-alt: var(--maitai-tint);
115
- --cautionary-bg-inverse: var(--maitai-shade);
116
- --cautionary-border: var(--maitai-main);
117
- --cautionary-border-alt: var(--maitai-shade);
118
- --cautionary-border-inverse: var(--maitai-background);
119
- --cautionary-fg: var(--maitai-foreground);
120
- --cautionary-fg-alt: var(--foregrounds-primary);
121
- --cautionary-fg-inverse: var(--maitai-background);
122
- --informative-bg: var(--blueribbon-background);
123
- --informative-bg-alt: var(--blueribbon-tint);
124
- --informative-bg-inverse: var(--blueribbon-shade);
125
- --informative-border: var(--blueribbon-main);
126
- --informative-border-alt: var(--blueribbon-shade);
127
- --informative-border-inverse: var(--blueribbon-background);
128
- --informative-fg: var(--blueribbon-foreground);
129
- --informative-fg-alt: var(--foregrounds-primary);
130
- --informative-fg-inverse: var(--blueribbon-background);
131
- --important-bg: var(--electricviolet-background);
132
- --important-bg-alt: var(--electricviolet-tint);
133
- --important-bg-inverse: var(--electricviolet-shade);
134
- --important-border: var(--electricviolet-main);
135
- --important-border-alt: var(--electricviolet-shade);
136
- --important-border-inverse: var(--electricviolet-background);
137
- --important-fg: var(--electricviolet-foreground);
138
- --important-fg-alt: var(--foregrounds-primary);
139
- --important-fg-inverse: var(--electricviolet-background);
140
- --dataviz-1-main: var(--blazeorange-main);
141
- --dataviz-1-tint: var(--blazeorange-tint);
142
- --dataviz-1-shade: var(--blazeorange-shade);
143
- --dataviz-2-main: var(--blueribbon-main);
144
- --dataviz-2-tint: var(--blueribbon-tint);
145
- --dataviz-2-shade: var(--blueribbon-shade);
146
- --dataviz-3-main: var(--seagreen-main);
147
- --dataviz-3-tint: var(--seagreen-tint);
148
- --dataviz-3-shade: var(--seagreen-shade);
149
- --dataviz-4-main: var(--electricviolet-main);
150
- --dataviz-4-tint: var(--electricviolet-tint);
151
- --dataviz-4-shade: var(--electricviolet-shade);
152
- --dataviz-5-main: var(--maitai-main);
153
- --dataviz-5-tint: var(--maitai-tint);
154
- --dataviz-5-shade: var(--maitai-shade);
155
- --dataviz-6-main: var(--cerise-main);
156
- --dataviz-6-tint: var(--cerise-tint);
157
- --dataviz-6-shade: var(--cerise-shade);
158
- --dataviz-7-main: var(--electriclime-main);
159
- --dataviz-7-tint: var(--electriclime-tint);
160
- --dataviz-7-shade: var(--electriclime-shade);
161
- --dataviz-8-main: var(--lochmara-main);
162
- --dataviz-8-tint: var(--lochmara-tint);
163
- --dataviz-8-shade: var(--lochmara-shade);
22
+ :root {
23
+ --color-neutral-0: var(--color-mono-0);
24
+ --color-neutral-50: var(--color-mono-50);
25
+ --color-neutral-100: var(--color-mono-100);
26
+ --color-neutral-200: var(--color-mono-200);
27
+ --color-neutral-300: var(--color-mono-300);
28
+ --color-neutral-400: var(--color-mono-400);
29
+ --color-neutral-500: var(--color-mono-500);
30
+ --color-neutral-600: var(--color-mono-600);
31
+ --color-neutral-700: var(--color-mono-700);
32
+ --color-neutral-800: var(--color-mono-800);
33
+ --color-neutral-900: var(--color-mono-900);
34
+ --color-neutral-950: var(--color-mono-950);
164
35
  }
165
36
 
166
37
  [data-theme="minimal"] {
38
+ /* Neutral ramp — mono (pure achromatic grey) */
39
+ --color-neutral-0: var(--color-mono-0);
40
+ --color-neutral-50: var(--color-mono-50);
41
+ --color-neutral-100: var(--color-mono-100);
42
+ --color-neutral-200: var(--color-mono-200);
43
+ --color-neutral-300: var(--color-mono-300);
44
+ --color-neutral-400: var(--color-mono-400);
45
+ --color-neutral-500: var(--color-mono-500);
46
+ --color-neutral-600: var(--color-mono-600);
47
+ --color-neutral-700: var(--color-mono-700);
48
+ --color-neutral-800: var(--color-mono-800);
49
+ --color-neutral-900: var(--color-mono-900);
50
+ --color-neutral-950: var(--color-mono-950);
167
51
  --font-heading: "Inter", ui-sans-serif, system-ui, sans-serif;
168
52
  --font-body: "Inter", ui-sans-serif, system-ui, sans-serif;
169
- --font-mono: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
53
+ --font-mono: "Paper Mono", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
170
54
  --container-bg: var(--backgrounds-primary);
171
55
  --container-bg-alt: var(--backgrounds-secondary);
172
56
  --container-bg-inverse: var(--foregrounds-secondary);
package/dist/tokens.css CHANGED
@@ -7,7 +7,7 @@
7
7
  * Layer 3: Themes → Component-level tokens for different visual identities
8
8
  *
9
9
  * Usage:
10
- * <html data-mode="light" data-theme="industrial-retro">
10
+ * <html data-mode="light" data-theme="minimal">
11
11
  * Primitives are always available via :root
12
12
  * Mode sets semantic colors (backgrounds, foregrounds, palette tints)
13
13
  * Theme sets component tokens (action, container, interactive, etc.)
@@ -15,12 +15,13 @@
15
15
  * Import order matters - each layer can reference the previous one.
16
16
  */
17
17
 
18
- /* Only load shared base font (Geist Mono) — theme fonts loaded on demand */
18
+ /* Only load shared base font (Paper Mono) — theme fonts loaded on demand */
19
19
  @import "./fonts-base.css";
20
20
  @import "./primitives.css";
21
21
  @import "./modes.css";
22
22
  @import "./themes.css";
23
23
  @import "./spacing.css";
24
+ @import "./typeset.css";
24
25
  @import "./curves.css";
25
26
 
26
27
  /* ============================================
@@ -0,0 +1,149 @@
1
+ /* ============================================
2
+ * Typeset — Fluid Type Scale
3
+ *
4
+ * A 12-step scale (step-6 … step-0 … step-neg3) where every step is
5
+ * viewport-fluid. Each step interpolates linearly between three anchors:
6
+ *
7
+ * small 480px = 30rem → --viewports-screen-s (primitives.css)
8
+ * medium 748px = 46.75rem → --viewports-screen-m
9
+ * large 1024px = 64rem → --viewports-screen-l
10
+ *
11
+ * Derivation of the three columns:
12
+ * small = 14px × 1.2^step (minor third — tighter ratio on small screens)
13
+ * large = 18px × 1.25^step (major third — more contrast on large screens)
14
+ * medium = small + 0.44 × (large − small)
15
+ *
16
+ * Two segments, so the curve bends at the medium anchor instead of running one
17
+ * straight line from small to large:
18
+ * Segment 1 (:root) small → medium over 30rem → 46.75rem
19
+ * Segment 2 (@media min-width: 46.75rem) medium → large over 46.75rem → 64rem
20
+ * Each segment is a clamp(), so below 480px every step pins to its small value
21
+ * and above 1024px to its large value.
22
+ *
23
+ * Pinning: [data-typeset="small|medium|large"] freezes a whole page — or any
24
+ * subtree — to one column, exactly like the other axes (data-spacing,
25
+ * data-curves). These blocks come last on purpose: equal specificity means
26
+ * source order decides, so an explicit pin always beats the fluid :root
27
+ * declarations and the media-query segment. Removing the attribute hands
28
+ * control back to the media queries.
29
+ *
30
+ * Companion tokens: --line-height-step-* and --letter-spacing-step-* pair with
31
+ * each size. They don't vary by viewport, so they're declared once at :root.
32
+ * Letter-spacing tightens progressively from step-2 up — headings need optical
33
+ * correction at display sizes, and em units make the tracking scale with the
34
+ * (fluid) size automatically.
35
+ * ============================================ */
36
+
37
+ :root {
38
+ /* ----------------------------------------
39
+ * Font Sizes — segment 1: small → medium
40
+ * 480px (30rem) → 748px (46.75rem)
41
+ * ---------------------------------------- */
42
+ --font-size-step-6: clamp(2.613125rem, 1.2911rem + 4.4067vw, 3.35125rem);
43
+ --font-size-step-5: clamp(2.1775rem, 1.1879rem + 3.2985vw, 2.73rem);
44
+ --font-size-step-4: clamp(1.814375rem, 1.08rem + 2.4478vw, 2.224375rem);
45
+ --font-size-step-3: clamp(1.511875rem, 0.9712rem + 1.8022vw, 1.81375rem);
46
+ --font-size-step-2: clamp(1.26rem, 0.8682rem + 1.306vw, 1.47875rem);
47
+ --font-size-step-1: clamp(1.05rem, 0.769rem + 0.9366vw, 1.206875rem);
48
+ --font-size-step-0: clamp(0.875rem, 0.678rem + 0.6567vw, 0.985rem);
49
+ --font-size-step-neg1: clamp(0.729375rem, 0.595rem + 0.4478vw, 0.804375rem);
50
+ --font-size-step-neg2: clamp(0.6075rem, 0.5191rem + 0.2948vw, 0.656875rem);
51
+ --font-size-step-neg3: clamp(0.50625rem, 0.4514rem + 0.1828vw, 0.536875rem);
52
+
53
+ /* ----------------------------------------
54
+ * Line Heights — one per step, viewport-independent
55
+ * Body copy stays generous (1.5); headings tighten as they grow.
56
+ * ---------------------------------------- */
57
+ --line-height-step-6: 1.2;
58
+ --line-height-step-5: 1.2;
59
+ --line-height-step-4: 1.2;
60
+ --line-height-step-3: 1.2;
61
+ --line-height-step-2: 1.375;
62
+ --line-height-step-1: 1.375;
63
+ --line-height-step-0: 1.5;
64
+ --line-height-step-neg1: 1.5;
65
+ --line-height-step-neg2: 1.5;
66
+ --line-height-step-neg3: 1.5;
67
+
68
+ /* ----------------------------------------
69
+ * Letter Spacing — one per step, viewport-independent
70
+ * em units so tracking tracks the fluid size. Progressive negative
71
+ * tracking above step-1 gives display text the tight optical fit a
72
+ * dedicated "Tight" cut would, without a second font payload.
73
+ * ---------------------------------------- */
74
+ --letter-spacing-step-6: -0.03em;
75
+ --letter-spacing-step-5: -0.025em;
76
+ --letter-spacing-step-4: -0.02em;
77
+ --letter-spacing-step-3: -0.015em;
78
+ --letter-spacing-step-2: -0.01em;
79
+ --letter-spacing-step-1: 0em;
80
+ --letter-spacing-step-0: 0em;
81
+ --letter-spacing-step-neg1: 0em;
82
+ --letter-spacing-step-neg2: 0em;
83
+ --letter-spacing-step-neg3: 0em;
84
+ }
85
+
86
+ /* ----------------------------------------
87
+ * Font Sizes — segment 2: medium → large
88
+ * 748px (46.75rem) → 1024px (64rem)
89
+ * ---------------------------------------- */
90
+
91
+ @media (min-width: 46.75rem) {
92
+ :root {
93
+ --font-size-step-6: clamp(3.35125rem, 0.8037rem + 5.4493vw, 4.29125rem);
94
+ --font-size-step-5: clamp(2.73rem, 0.8244rem + 4.0761vw, 3.433125rem);
95
+ --font-size-step-4: clamp(2.224375rem, 0.8083rem + 3.029vw, 2.746875rem);
96
+ --font-size-step-3: clamp(1.81375rem, 0.7737rem + 2.2246vw, 2.1975rem);
97
+ --font-size-step-2: clamp(1.47875rem, 0.7216rem + 1.6196vw, 1.758125rem);
98
+ --font-size-step-1: clamp(1.206875rem, 0.6665rem + 1.1558vw, 1.40625rem);
99
+ --font-size-step-0: clamp(0.985rem, 0.6056rem + 0.8116vw, 1.125rem);
100
+ --font-size-step-neg1: clamp(0.804375rem, 0.5452rem + 0.5543vw, 0.9rem);
101
+ --font-size-step-neg2: clamp(0.656875rem, 0.4858rem + 0.3659vw, 0.72rem);
102
+ --font-size-step-neg3: clamp(0.536875rem, 0.4302rem + 0.2283vw, 0.57625rem);
103
+ }
104
+ }
105
+
106
+ /* ============================================
107
+ * Pinned Typesets
108
+ * <html data-typeset="small"> freezes the whole page; the attribute works on
109
+ * any element to pin a subtree. Must stay after the fluid declarations above.
110
+ * ============================================ */
111
+
112
+ [data-typeset="small"] {
113
+ --font-size-step-6: 2.613125rem; /* 41.81px */
114
+ --font-size-step-5: 2.1775rem; /* 34.84px */
115
+ --font-size-step-4: 1.814375rem; /* 29.03px */
116
+ --font-size-step-3: 1.511875rem; /* 24.19px */
117
+ --font-size-step-2: 1.26rem; /* 20.16px */
118
+ --font-size-step-1: 1.05rem; /* 16.8px */
119
+ --font-size-step-0: 0.875rem; /* 14px */
120
+ --font-size-step-neg1: 0.729375rem; /* 11.67px */
121
+ --font-size-step-neg2: 0.6075rem; /* 9.72px */
122
+ --font-size-step-neg3: 0.50625rem; /* 8.1px */
123
+ }
124
+
125
+ [data-typeset="medium"] {
126
+ --font-size-step-6: 3.35125rem; /* 53.62px */
127
+ --font-size-step-5: 2.73rem; /* 43.68px */
128
+ --font-size-step-4: 2.224375rem; /* 35.59px */
129
+ --font-size-step-3: 1.81375rem; /* 29.02px */
130
+ --font-size-step-2: 1.47875rem; /* 23.66px */
131
+ --font-size-step-1: 1.206875rem; /* 19.31px */
132
+ --font-size-step-0: 0.985rem; /* 15.76px */
133
+ --font-size-step-neg1: 0.804375rem; /* 12.87px */
134
+ --font-size-step-neg2: 0.656875rem; /* 10.51px */
135
+ --font-size-step-neg3: 0.536875rem; /* 8.59px */
136
+ }
137
+
138
+ [data-typeset="large"] {
139
+ --font-size-step-6: 4.29125rem; /* 68.66px */
140
+ --font-size-step-5: 3.433125rem; /* 54.93px */
141
+ --font-size-step-4: 2.746875rem; /* 43.95px */
142
+ --font-size-step-3: 2.1975rem; /* 35.16px */
143
+ --font-size-step-2: 1.758125rem; /* 28.13px */
144
+ --font-size-step-1: 1.40625rem; /* 22.5px */
145
+ --font-size-step-0: 1.125rem; /* 18px */
146
+ --font-size-step-neg1: 0.9rem; /* 14.4px */
147
+ --font-size-step-neg2: 0.72rem; /* 11.52px */
148
+ --font-size-step-neg3: 0.57625rem; /* 9.22px */
149
+ }
package/package.json CHANGED
@@ -1,8 +1,9 @@
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.1.0",
4
+ "version": "0.3.0",
5
5
  "license": "MIT",
6
+ "author": "Frolda",
6
7
  "homepage": "https://github.com/vasfio/eluan#readme",
7
8
  "repository": {
8
9
  "type": "git",
@@ -22,6 +23,9 @@
22
23
  "**/*.css"
23
24
  ],
24
25
  "type": "module",
26
+ "engines": {
27
+ "node": ">=20"
28
+ },
25
29
  "main": "./dist/index.js",
26
30
  "module": "./dist/index.js",
27
31
  "types": "./dist/index.d.ts",
@@ -33,7 +37,6 @@
33
37
  "./css": "./dist/tokens.css",
34
38
  "./fonts/all": "./dist/fonts.css",
35
39
  "./fonts/base": "./dist/fonts-base.css",
36
- "./fonts/industrial-retro": "./dist/fonts-industrial-retro.css",
37
40
  "./fonts/minimal": "./dist/fonts-minimal.css"
38
41
  },
39
42
  "files": [
@@ -46,12 +49,11 @@
46
49
  "typescript": "^5.4.5"
47
50
  },
48
51
  "dependencies": {
49
- "@fontsource/geist": "^5.2.8",
50
- "@fontsource/geist-mono": "^5.2.7",
51
52
  "@fontsource/inter": "^5.2.8"
52
53
  },
53
54
  "scripts": {
54
- "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/curves.css src/fonts.css src/fonts-base.css src/fonts-industrial-retro.css src/fonts-minimal.css dist/",
55
- "dev": "tsc --watch"
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",
56
+ "dev": "tsc --watch",
57
+ "lint": "eslint src --report-unused-disable-directives --max-warnings 0"
56
58
  }
57
59
  }
@@ -1,3 +0,0 @@
1
- /* industrial-retro theme — Geist (heading + body) */
2
- @import "@fontsource/geist/400.css";
3
- @import "@fontsource/geist/500.css";