create-claude-workspace 1.1.93 → 1.1.95
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.
|
@@ -306,7 +306,7 @@ npx themecraft generate # generates type-safe SCSS from tokens.json
|
|
|
306
306
|
**Pipeline:**
|
|
307
307
|
1. `tokens.json` — define token names (colors, sizes, typography, breakpoints) with JSON schema validation
|
|
308
308
|
2. `npx themecraft generate` — produces type-safe SCSS variables with IDE autocomplete
|
|
309
|
-
3. Theme files (`themes/light.scss`, `dark.scss`)
|
|
309
|
+
3. Theme values files (`themes/light-values.scss`, `dark-values.scss`) + single entry point (`themes/themes.scss`) with ALL themes
|
|
310
310
|
4. `@themecraft/core/themes` → `variables()` mixin emits CSS custom properties at `:root`
|
|
311
311
|
5. `@themecraft/angular` → `provideTheme()` for runtime switching, `provideThemeServer()` for SSR (no FOUC)
|
|
312
312
|
|
|
@@ -355,13 +355,19 @@ Then run `<PM> install` to create the link. SCSS `@use 'theme/colors'` (or `@use
|
|
|
355
355
|
|
|
356
356
|
**How it works:** `npx themecraft generate` runs inside the theme library and produces typed SCSS files (e.g., `src/generated/theme/_colors.scss`, `_sizes.scss`, `_typography.scss`) that wrap `color-var()`/`size-var()` internally. The library's `package.json` `exports` field maps `./colors` → `./src/generated/theme/_colors.scss` etc. Because the library is linked as a workspace dependency, `@use 'theme/colors'` resolves through `node_modules/theme/package.json` exports. Components consume the generated variables — never the raw accessor functions, never `generated/` paths, never subdirectory links.
|
|
357
357
|
|
|
358
|
+
**What lives where:**
|
|
359
|
+
- **Theme library** (`libs/ui/theme/`) — ONLY `tokens.json`, `themecraft.config.json`, `package.json` with `exports`, and generated SCSS files (output of `npx themecraft generate`). **NEVER put theme values files, entry points, or global styles here.**
|
|
360
|
+
- **Application** (`apps/[app]/src/`) — theme values files (`themes/light-values.scss`, `dark-values.scss`), single theme entry point (`themes/themes.scss`), global styles (`styles.scss`). These are app-specific — different apps can define different themes using the same shared tokens.
|
|
361
|
+
|
|
358
362
|
**Token source (pick one):**
|
|
359
363
|
- **With Figma:** `npx themecraft sync --figma-file-key YOUR_FILE_KEY --token YOUR_ACCESS_TOKEN` pulls design variables into `tokens.json`, then `npx themecraft generate`
|
|
360
364
|
- **Without Figma:** `npx themecraft init` creates `tokens.json` scaffold → manually define token names (color groups, size groups, typography levels) → `npx themecraft generate`
|
|
361
365
|
|
|
362
366
|
Either way, the result is the same: typed SCSS files inside the theme library, importable via `@use 'theme/colors'`.
|
|
363
367
|
|
|
364
|
-
**Theme values**
|
|
368
|
+
**Theme values files** — one file per theme, each exports a `$theme` variable:
|
|
369
|
+
|
|
370
|
+
`themes/light-values.scss`:
|
|
365
371
|
```scss
|
|
366
372
|
@use '@themecraft/core/theming' as theming;
|
|
367
373
|
@use 'theme/variables/colors';
|
|
@@ -389,10 +395,30 @@ $theme: theming.define-light-theme((
|
|
|
389
395
|
));
|
|
390
396
|
```
|
|
391
397
|
|
|
392
|
-
|
|
398
|
+
`themes/dark-values.scss`:
|
|
399
|
+
```scss
|
|
400
|
+
@use '@themecraft/core/theming' as theming;
|
|
401
|
+
@use 'theme/variables/colors';
|
|
402
|
+
// ... same imports
|
|
403
|
+
|
|
404
|
+
$theme: theming.define-dark-theme((
|
|
405
|
+
color: theming.define-color-scheme((
|
|
406
|
+
colors.$background-body: #1a1a2e,
|
|
407
|
+
colors.$content-primary: #e0e0e0,
|
|
408
|
+
colors.$interactive-primary: #64b5f6,
|
|
409
|
+
)),
|
|
410
|
+
// ... sizes, typography, breakpoints
|
|
411
|
+
));
|
|
412
|
+
```
|
|
413
|
+
|
|
414
|
+
**Single entry point for ALL themes** (`themes/themes.scss`) — compiles to one CSS file with all themes. **NEVER create separate entry points per theme** (e.g., `light.scss`, `dark.scss` each with their own `@include themes.variables`) — that breaks theme switching:
|
|
393
415
|
```scss
|
|
394
416
|
@use './light-values' as light;
|
|
395
|
-
@use '
|
|
417
|
+
@use './dark-values' as dark;
|
|
418
|
+
@use '@themecraft/core/themes' with ($themes: (
|
|
419
|
+
light: light.$theme,
|
|
420
|
+
dark: dark.$theme,
|
|
421
|
+
));
|
|
396
422
|
|
|
397
423
|
@include themes.variables(':root');
|
|
398
424
|
```
|
|
@@ -197,7 +197,7 @@ npx themecraft generate # generates type-safe SCSS from tokens.json
|
|
|
197
197
|
**Pipeline:**
|
|
198
198
|
1. `tokens.json` — define token names (colors, sizes, typography, breakpoints) with JSON schema validation
|
|
199
199
|
2. `npx themecraft generate` — produces type-safe SCSS variables with IDE autocomplete
|
|
200
|
-
3. Theme files (`themes/light.scss`, `dark.scss`)
|
|
200
|
+
3. Theme values files (`themes/light-values.scss`, `dark-values.scss`) + single entry point (`themes/themes.scss`) with ALL themes — NEVER separate entry points per theme
|
|
201
201
|
4. `@themecraft/core/themes` → `variables()` mixin emits CSS custom properties at `:root`
|
|
202
202
|
5. `ThemeManager` (from `@themecraft/core`) — runtime theme switching, storage persistence, FOUC prevention
|
|
203
203
|
|
|
@@ -245,6 +245,10 @@ Then run `<PM> install` to create the link. SCSS `@use 'theme/colors'` (or `@use
|
|
|
245
245
|
|
|
246
246
|
**How it works:** `npx themecraft generate` runs inside the theme library and produces typed SCSS files (e.g., `src/generated/theme/_colors.scss`, `_sizes.scss`, `_typography.scss`) that wrap `color-var()`/`size-var()` internally. The library's `package.json` `exports` field maps `./colors` → `./src/generated/theme/_colors.scss` etc. Because the library is linked as a workspace dependency, `@use 'theme/colors'` resolves through `node_modules/theme/package.json` exports. Components consume the generated variables — never the raw accessor functions, never `generated/` paths, never subdirectory links.
|
|
247
247
|
|
|
248
|
+
**What lives where:**
|
|
249
|
+
- **Theme library** (`libs/ui/theme/`) — ONLY `tokens.json`, `themecraft.config.json`, `package.json` with `exports`, and generated SCSS files (output of `npx themecraft generate`). **NEVER put theme values files, entry points, or global styles here.**
|
|
250
|
+
- **Application** (`apps/[app]/src/` or `src/`) — theme values files (`themes/light-values.scss`, `dark-values.scss`), single theme entry point (`themes/themes.scss`), global styles. These are app-specific — different apps can define different themes using the same shared tokens.
|
|
251
|
+
|
|
248
252
|
**Token source (pick one):**
|
|
249
253
|
- **With Figma:** `npx themecraft sync --figma-file-key YOUR_FILE_KEY --token YOUR_ACCESS_TOKEN` pulls design variables into `tokens.json`, then `npx themecraft generate`
|
|
250
254
|
- **Without Figma:** `npx themecraft init` creates `tokens.json` scaffold → manually define token names (color groups, size groups, typography levels) → `npx themecraft generate`
|
|
@@ -195,7 +195,7 @@ npx themecraft generate # generates type-safe SCSS from tokens.json
|
|
|
195
195
|
**Pipeline:**
|
|
196
196
|
1. `tokens.json` — define token names (colors, sizes, typography, breakpoints)
|
|
197
197
|
2. `npx themecraft generate` — produces type-safe SCSS variables with IDE autocomplete
|
|
198
|
-
3. Theme files (`themes/light.scss`, `dark.scss`)
|
|
198
|
+
3. Theme values files (`themes/light-values.scss`, `dark-values.scss`) + single entry point (`themes/themes.scss`) with ALL themes — NEVER separate entry points per theme
|
|
199
199
|
4. `@themecraft/core/themes` → `variables()` mixin emits CSS custom properties at `:root`
|
|
200
200
|
5. `ThemeManager` (from `@themecraft/core`) — runtime switching, storage, FOUC prevention
|
|
201
201
|
|
|
@@ -245,6 +245,10 @@ Then run `<PM> install` to create the link. SCSS `@use 'theme/colors'` (or `@use
|
|
|
245
245
|
|
|
246
246
|
**How it works:** `npx themecraft generate` runs inside the theme library and produces typed SCSS files (e.g., `src/generated/theme/_colors.scss`, `_sizes.scss`, `_typography.scss`) that wrap `color-var()`/`size-var()` internally. The library's `package.json` `exports` field maps `./colors` → `./src/generated/theme/_colors.scss` etc. Because the library is linked as a workspace dependency, `@use 'theme/colors'` resolves through `node_modules/theme/package.json` exports. Components consume the generated variables — never the raw accessor functions, never `generated/` paths, never subdirectory links.
|
|
247
247
|
|
|
248
|
+
**What lives where:**
|
|
249
|
+
- **Theme library** (`libs/ui/theme/`) — ONLY `tokens.json`, `themecraft.config.json`, `package.json` with `exports`, and generated SCSS files (output of `npx themecraft generate`). **NEVER put theme values files, entry points, or global styles here.**
|
|
250
|
+
- **Application** (`apps/[app]/src/` or `src/`) — theme values files (`themes/light-values.scss`, `dark-values.scss`), single theme entry point (`themes/themes.scss`), global styles. These are app-specific — different apps can define different themes using the same shared tokens.
|
|
251
|
+
|
|
248
252
|
**Token source (pick one):**
|
|
249
253
|
- **With Figma:** `npx themecraft sync --figma-file-key YOUR_FILE_KEY --token YOUR_ACCESS_TOKEN` pulls design variables into `tokens.json`, then `npx themecraft generate`
|
|
250
254
|
- **Without Figma:** `npx themecraft init` creates `tokens.json` scaffold → manually define token names (color groups, size groups, typography levels) → `npx themecraft generate`
|
|
@@ -223,7 +223,7 @@ npx themecraft generate # generates type-safe SCSS from tokens.json
|
|
|
223
223
|
**Pipeline:**
|
|
224
224
|
1. `tokens.json` — define token names (colors, sizes, typography, breakpoints)
|
|
225
225
|
2. `npx themecraft generate` — produces type-safe SCSS variables with IDE autocomplete
|
|
226
|
-
3. Theme files (`themes/light.scss`, `dark.scss`)
|
|
226
|
+
3. Theme values files (`themes/light-values.scss`, `dark-values.scss`) + single entry point (`themes/themes.scss`) with ALL themes — NEVER separate entry points per theme
|
|
227
227
|
4. `@themecraft/core/themes` → `variables()` mixin emits CSS custom properties at `:root`
|
|
228
228
|
5. `ThemeManager` (from `@themecraft/core`) — runtime switching, storage, FOUC prevention
|
|
229
229
|
|
|
@@ -273,6 +273,10 @@ Then run `<PM> install` to create the link. SCSS `@use 'theme/colors'` (or `@use
|
|
|
273
273
|
|
|
274
274
|
**How it works:** `npx themecraft generate` runs inside the theme library and produces typed SCSS files (e.g., `src/generated/theme/_colors.scss`, `_sizes.scss`, `_typography.scss`) that wrap `color-var()`/`size-var()` internally. The library's `package.json` `exports` field maps `./colors` → `./src/generated/theme/_colors.scss` etc. Because the library is linked as a workspace dependency, `@use 'theme/colors'` resolves through `node_modules/theme/package.json` exports. Components consume the generated variables — never the raw accessor functions, never `generated/` paths, never subdirectory links.
|
|
275
275
|
|
|
276
|
+
**What lives where:**
|
|
277
|
+
- **Theme library** (`libs/ui/theme/`) — ONLY `tokens.json`, `themecraft.config.json`, `package.json` with `exports`, and generated SCSS files (output of `npx themecraft generate`). **NEVER put theme values files, entry points, or global styles here.**
|
|
278
|
+
- **Application** (`apps/[app]/src/` or `src/`) — theme values files (`themes/light-values.scss`, `dark-values.scss`), single theme entry point (`themes/themes.scss`), global styles. These are app-specific — different apps can define different themes using the same shared tokens.
|
|
279
|
+
|
|
276
280
|
**Token source (pick one):**
|
|
277
281
|
- **With Figma:** `npx themecraft sync --figma-file-key YOUR_FILE_KEY --token YOUR_ACCESS_TOKEN` pulls design variables into `tokens.json`, then `npx themecraft generate`
|
|
278
282
|
- **Without Figma:** `npx themecraft init` creates `tokens.json` scaffold → manually define token names (color groups, size groups, typography levels) → `npx themecraft generate`
|