@createnew/tokens 0.1.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 ADDED
@@ -0,0 +1,64 @@
1
+ # @createnew/tokens
2
+
3
+ Design tokens for the CreateNew Design System.
4
+
5
+ ## Installation
6
+
7
+ ```bash
8
+ npm install @createnew/tokens
9
+ ```
10
+
11
+ ## Usage
12
+
13
+ ### CSS Custom Properties
14
+
15
+ Import the CSS file to get all tokens as CSS custom properties:
16
+
17
+ ```css
18
+ @import "@createnew/tokens/tokens.css";
19
+ ```
20
+
21
+ Or in your HTML:
22
+
23
+ ```html
24
+ <link rel="stylesheet" href="node_modules/@createnew/tokens/dist/tokens.css">
25
+ ```
26
+
27
+ ### TypeScript
28
+
29
+ Import tokens as TypeScript objects:
30
+
31
+ ```typescript
32
+ import { tokens, semanticTokens, textStyles } from "@createnew/tokens";
33
+
34
+ const primaryColor = tokens.semantic.color.brand.primary;
35
+ ```
36
+
37
+ ## Token Structure
38
+
39
+ - **Core Tokens**: Raw values (colors, spacing, radii, shadows, typography)
40
+ - **Semantic Tokens**: Component-agnostic semantic values (surface, text, brand, border)
41
+ - **Text Styles**: Composite typographic styles (body, caption, title, display)
42
+
43
+ ## Building
44
+
45
+ ```bash
46
+ npm run build
47
+ ```
48
+
49
+ This generates:
50
+ - `dist/tokens.js` - TypeScript exports
51
+ - `dist/tokens.css` - CSS custom properties (generated by Style Dictionary)
52
+
53
+ ### Token Source
54
+
55
+ Tokens are defined in JSON format in the `tokens/` directory:
56
+ - `tokens/core.json` - Core design tokens (colors, spacing, typography, etc.)
57
+ - `tokens/semantic.json` - Semantic tokens (references core tokens)
58
+ - `tokens/text-styles.json` - Composite text styles
59
+
60
+ Style Dictionary transforms these JSON files into CSS custom properties and TypeScript exports.
61
+
62
+ ## Documentation
63
+
64
+ For comprehensive documentation, architecture details, and complete examples, see the [main README](../../README.md).
@@ -0,0 +1,306 @@
1
+ /**
2
+ * Font Face Declarations for CreateNew Design System
3
+ *
4
+ * Rebond Grotesque: Used primarily for headings on CreateNew.co
5
+ * Geist: Used for body text on CreateNew.co
6
+ */
7
+
8
+ /* Geist - Body Font (loaded from Google Fonts) */
9
+ /* Using @import for reliable Google Fonts loading */
10
+ @import url('https://fonts.googleapis.com/css2?family=Geist:wght@400;500;700&display=swap');
11
+
12
+ /* Rebond Grotesque - Heading Font */
13
+
14
+ @font-face {
15
+ font-family: 'Rebond Grotesque';
16
+ src: local(''), url('/fonts/RebondGrotesque-Hairline.woff2') format('woff2');
17
+ font-weight: 100;
18
+ font-style: normal;
19
+ font-display: swap;
20
+ }
21
+
22
+ @font-face {
23
+ font-family: 'Rebond Grotesque';
24
+ src: local(''), url('/fonts/RebondGrotesque-Thin.woff2') format('woff2');
25
+ font-weight: 200;
26
+ font-style: normal;
27
+ font-display: swap;
28
+ }
29
+
30
+ @font-face {
31
+ font-family: 'Rebond Grotesque';
32
+ src: local(''), url('/fonts/RebondGrotesque-Extralight.woff2') format('woff2');
33
+ font-weight: 300;
34
+ font-style: normal;
35
+ font-display: swap;
36
+ }
37
+
38
+ @font-face {
39
+ font-family: 'Rebond Grotesque';
40
+ src: local(''), url('/fonts/RebondGrotesque-Light.woff2') format('woff2');
41
+ font-weight: 300;
42
+ font-style: normal;
43
+ font-display: swap;
44
+ }
45
+
46
+ @font-face {
47
+ font-family: 'Rebond Grotesque';
48
+ src: local(''), url('/fonts/RebondGrotesque-Regular.woff2') format('woff2');
49
+ font-weight: 400;
50
+ font-style: normal;
51
+ font-display: swap;
52
+ }
53
+
54
+ @font-face {
55
+ font-family: 'Rebond Grotesque';
56
+ src: local(''), url('/fonts/RebondGrotesque-Medium.woff2') format('woff2');
57
+ font-weight: 500;
58
+ font-style: normal;
59
+ font-display: swap;
60
+ }
61
+
62
+ @font-face {
63
+ font-family: 'Rebond Grotesque';
64
+ src: local(''), url('/fonts/RebondGrotesque-Semibold.woff2') format('woff2');
65
+ font-weight: 600;
66
+ font-style: normal;
67
+ font-display: swap;
68
+ }
69
+
70
+ @font-face {
71
+ font-family: 'Rebond Grotesque';
72
+ src: local(''), url('/fonts/RebondGrotesque-Bold.woff2') format('woff2');
73
+ font-weight: 700;
74
+ font-style: normal;
75
+ font-display: swap;
76
+ }
77
+
78
+ @font-face {
79
+ font-family: 'Rebond Grotesque';
80
+ src: local(''), url('/fonts/RebondGrotesque-Extrabold.woff2') format('woff2');
81
+ font-weight: 800;
82
+ font-style: normal;
83
+ font-display: swap;
84
+ }
85
+
86
+ /* Italic variants */
87
+ @font-face {
88
+ font-family: 'Rebond Grotesque';
89
+ src: local(''), url('/fonts/RebondGrotesque-ThinItalic.woff2') format('woff2');
90
+ font-weight: 200;
91
+ font-style: italic;
92
+ font-display: swap;
93
+ }
94
+
95
+ @font-face {
96
+ font-family: 'Rebond Grotesque';
97
+ src: local(''), url('/fonts/RebondGrotesque-ExtralightItalic.woff2') format('woff2');
98
+ font-weight: 300;
99
+ font-style: italic;
100
+ font-display: swap;
101
+ }
102
+
103
+ @font-face {
104
+ font-family: 'Rebond Grotesque';
105
+ src: local(''), url('/fonts/RebondGrotesque-LightItalic.woff2') format('woff2');
106
+ font-weight: 300;
107
+ font-style: italic;
108
+ font-display: swap;
109
+ }
110
+
111
+ @font-face {
112
+ font-family: 'Rebond Grotesque';
113
+ src: local(''), url('/fonts/RebondGrotesque-RegularItalic.woff2') format('woff2');
114
+ font-weight: 400;
115
+ font-style: italic;
116
+ font-display: swap;
117
+ }
118
+
119
+ @font-face {
120
+ font-family: 'Rebond Grotesque';
121
+ src: local(''), url('/fonts/RebondGrotesque-MediumItalic.woff2') format('woff2');
122
+ font-weight: 500;
123
+ font-style: italic;
124
+ font-display: swap;
125
+ }
126
+
127
+ @font-face {
128
+ font-family: 'Rebond Grotesque';
129
+ src: local(''), url('/fonts/RebondGrotesque-SemiboldItalic.woff2') format('woff2');
130
+ font-weight: 600;
131
+ font-style: italic;
132
+ font-display: swap;
133
+ }
134
+
135
+ @font-face {
136
+ font-family: 'Rebond Grotesque';
137
+ src: local(''), url('/fonts/RebondGrotesque-BoldItalic.woff2') format('woff2');
138
+ font-weight: 700;
139
+ font-style: italic;
140
+ font-display: swap;
141
+ }
142
+
143
+ @font-face {
144
+ font-family: 'Rebond Grotesque';
145
+ src: local(''), url('/fonts/RebondGrotesque-ExtraboldItalic.woff2') format('woff2');
146
+ font-weight: 800;
147
+ font-style: italic;
148
+ font-display: swap;
149
+ }
150
+
151
+
152
+ /**
153
+ * Do not edit directly, this file was auto-generated.
154
+ */
155
+
156
+ :root {
157
+
158
+ --color-black: #000000;
159
+ --color-white: #ffffff;
160
+ --color-transparent: transparent;
161
+ --color-surface-default: #ffffff;
162
+ --color-surface-raised: #eceff3;
163
+ --color-surface-sunken: #f1f4f7;
164
+ --color-surface-hero: #ffffff;
165
+ --color-surface-dark: #0d0d12;
166
+ --color-surface-footer: #0d0d12;
167
+ --color-surface-warm: #fbfaf9;
168
+ --color-foreground-default: #0d0d12;
169
+ --color-foreground-muted: #666d80;
170
+ --color-foreground-muted-on-dark: #818899;
171
+ --color-foreground-inverted: #ffffff;
172
+ --color-brand-primary: #91ba00;
173
+ --color-brand-accent: #607a05;
174
+ --color-brand-violet: #c083e2;
175
+ --color-brand-purple: #8a5ae0;
176
+ --color-brand-gold: #ffc400;
177
+ --color-brand-orange: #ff6200;
178
+ --color-brand-blue: #0085ff;
179
+ --color-brand-teal: #00cc74;
180
+ --color-brand-cyan: #33d7f2;
181
+ --color-border-subtle: #dfe1e7;
182
+ --color-border-strong: #666d80;
183
+ --color-border-warm: #f3efec;
184
+ --color-overlay: rgba(0, 0, 0, 0.4);
185
+ --color-status-error: #ef4444;
186
+ --spacing-xs: 4px;
187
+ --spacing-s: 8px;
188
+ --spacing-m: 12px;
189
+ --spacing-l: 16px;
190
+ --spacing-xl: 24px;
191
+ --spacing-2xl: 32px;
192
+ --spacing-3xl: 48px;
193
+ --radius-xs: 4px;
194
+ --radius-s: 6px;
195
+ --radius-m: 8px;
196
+ --radius-l: 12px;
197
+ --radius-xl: 16px;
198
+ --radius-2xl: 20px;
199
+ --radius-full: 9999px;
200
+ --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
201
+ --shadow-m: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
202
+ --shadow-l: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
203
+ --shadow-xl: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
204
+ --font-family-heading: 'Rebond Grotesque', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
205
+ --font-family-sans: 'Geist', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
206
+ --font-family-mono: ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, monospace;
207
+ --font-size-xs: 12px;
208
+ --font-size-sm: 13px;
209
+ --font-size-base: 14px;
210
+ --font-size-md: 15px;
211
+ --font-size-lg: 16px;
212
+ --font-size-xl: 18px;
213
+ --font-size-2xl: 20px;
214
+ --font-size-3xl: 24px;
215
+ --font-size-4xl: 30px;
216
+ --font-size-5xl: 32px;
217
+ --font-size-6xl: 36px;
218
+ --font-size-7xl: 40px;
219
+ --font-size-8xl: 48px;
220
+ --font-size-9xl: 56px;
221
+ --font-size-10xl: 64px;
222
+ --line-height-none: 1;
223
+ --line-height-tight: 1.2;
224
+ --line-height-snug: 1.3;
225
+ --line-height-normal: 1.5;
226
+ --line-height-relaxed: 1.6;
227
+ --line-height-loose: 1.75;
228
+ --line-height-compact: 1.143;
229
+ --line-height-tight-fixed: 1.067;
230
+ --line-height-medium: 1.538;
231
+ --font-weight-normal: 400;
232
+ --font-weight-medium: 500;
233
+ --font-weight-semibold: 600;
234
+ --font-weight-bold: 700;
235
+ --breakpoint-mobile: 810px;
236
+ --breakpoint-tablet: 1199px;
237
+ --breakpoint-desktop: 1200px;
238
+ --breakpoint-container-max: 1440px;
239
+ --breakpoint-small-mobile: 390px;
240
+ --text-display-font-size: 64px;
241
+ --text-display-line-height: 1;
242
+ --text-display-font-weight: 600;
243
+ --text-display-font-family: 'Rebond Grotesque', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
244
+ --text-heading-2-font-size: 56px;
245
+ --text-heading-2-line-height: 1;
246
+ --text-heading-2-font-weight: 600;
247
+ --text-heading-2-font-family: 'Rebond Grotesque', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
248
+ --text-heading-3-font-size: 32px;
249
+ --text-heading-3-line-height: 1.2;
250
+ --text-heading-3-font-weight: 500;
251
+ --text-heading-3-font-family: 'Geist', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
252
+ --text-title-font-size: 20px;
253
+ --text-title-line-height: 1.3;
254
+ --text-title-font-weight: 500;
255
+ --text-title-font-family: 'Geist', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
256
+ --text-body-font-size: 16px;
257
+ --text-body-line-height: 1.6;
258
+ --text-body-font-weight: 400;
259
+ --text-body-font-family: 'Geist', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
260
+ --text-body-strong-font-size: 16px;
261
+ --text-body-strong-line-height: 1.6;
262
+ --text-body-strong-font-weight: 500;
263
+ --text-body-strong-font-family: 'Geist', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
264
+ --text-nav-label-font-size: 15px;
265
+ --text-nav-label-line-height: 1.067;
266
+ --text-nav-label-font-weight: 500;
267
+ --text-nav-label-font-family: 'Geist', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
268
+ --text-label-font-size: 14px;
269
+ --text-label-line-height: 1.143;
270
+ --text-label-font-weight: 500;
271
+ --text-label-font-family: 'Geist', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
272
+ --text-caption-font-size: 14px;
273
+ --text-caption-line-height: 1.143;
274
+ --text-caption-font-weight: 400;
275
+ --text-caption-font-family: 'Geist', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
276
+ --text-link-small-font-size: 13px;
277
+ --text-link-small-line-height: 1.538;
278
+ --text-link-small-font-weight: 400;
279
+ --text-link-small-font-family: 'Geist', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
280
+ }
281
+
282
+
283
+ /* Dark Mode Theme */
284
+ [data-theme="dark"] {
285
+ --color-surface-default: #0d0d12;
286
+ --color-surface-raised: #36384a;
287
+ --color-surface-sunken: #0d0d12;
288
+ --color-surface-hero: #1a1a24;
289
+ --color-surface-dark: #f1f4f7;
290
+ --color-surface-footer: #1a1a24;
291
+ --color-surface-warm: #36384a;
292
+ --color-foreground-default: #ffffff;
293
+ --color-foreground-muted: #818899;
294
+ --color-foreground-mutedOnDark: #666d80;
295
+ --color-foreground-inverted: #0d0d12;
296
+ --color-brand-primary: #91ba00;
297
+ --color-brand-accent: #607a05;
298
+ --color-border-subtle: #36384a;
299
+ --color-border-strong: #666d80;
300
+ --color-border-warm: #36384a;
301
+ --color-overlay: rgba(0, 0, 0, 0.6);
302
+ --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.3);
303
+ --shadow-m: 0 1px 3px 0 rgb(0 0 0 / 0.4), 0 1px 2px -1px rgb(0 0 0 / 0.3);
304
+ --shadow-l: 0 4px 6px -1px rgb(0 0 0 / 0.4), 0 2px 4px -2px rgb(0 0 0 / 0.3);
305
+ --shadow-xl: 0 10px 15px -3px rgb(0 0 0 / 0.5), 0 4px 6px -4px rgb(0 0 0 / 0.4);
306
+ }