@timmo001/groundwork-tokens 0.10.0 → 0.10.2

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
@@ -31,6 +31,10 @@ their own:
31
31
  import { parseTheme, runtimeTheme } from "@timmo001/groundwork-tokens/runtime";
32
32
  ```
33
33
 
34
+ `blumeThemeCss` from the same export renders a solved theme as Blume's tokens,
35
+ for a docs site on `@timmo001/docs-kit` whose app has its own theme. The
36
+ [docs-kit README](https://github.com/timmo001/groundwork/tree/main/packages/docs-kit#theme) shows the site script.
37
+
34
38
  The `omarchy-current` export reads and watches the Omarchy theme a machine
35
39
  is using, for apps outside a browser, such as a desktop app's main process or
36
40
  a terminal UI. `pageTheme`'s `setOmarchyTheme` offers it in the view:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@timmo001/groundwork-tokens",
3
- "version": "0.10.0",
3
+ "version": "0.10.2",
4
4
  "description": "Groundwork's design tokens: the theme schema, the OKLCH solver and every theme as CSS and JSON",
5
5
  "license": "Apache-2.0",
6
6
  "type": "module",
@@ -59,7 +59,7 @@
59
59
  "@timmo001/oxlint-rules": "0.6.4",
60
60
  "@types/bun": "1.4.4",
61
61
  "oxlint": "1.91.0",
62
- "oxlint-tsgolint": "7.0.2005",
62
+ "oxlint-tsgolint": "7.0.2006",
63
63
  "prettier": "3.9.10",
64
64
  "typescript": "7.0.2"
65
65
  }
package/src/choices.ts CHANGED
@@ -69,7 +69,8 @@ export const themeAllows = (choice: ThemeChoice, mode: ThemeMode) =>
69
69
 
70
70
  /**
71
71
  * Choices as a picker's options, grouped: a choice's `family`, or `group`
72
- * for those without one. Order the choices as the picker should list them,
72
+ * for those without one. Each carries the schemes it covers as search
73
+ * keywords. Order the choices as the picker should list them,
73
74
  * usually the app's own theme, then the other core themes, then the optional
74
75
  * ones.
75
76
  */
@@ -77,10 +78,12 @@ export const themeOptions = (
77
78
  choices: readonly ThemeChoice[],
78
79
  group = "Groundwork",
79
80
  ) =>
80
- choices.map(({ id, name, family }) => ({
81
+ choices.map(({ id, name, family, mode }) => ({
81
82
  value: id,
82
83
  label: name,
83
84
  group: family ?? group,
85
+ // So a search for light or dark finds the themes that have it
86
+ keywords: mode === undefined ? ["light", "dark"] : [mode],
84
87
  }));
85
88
 
86
89
  /** The core themes by id and name, in the order the docs list them. */
package/src/generate.ts CHANGED
@@ -525,14 +525,18 @@ const blumeRules = (theme: ResolvedTheme, root: string) => {
525
525
  };
526
526
 
527
527
  /**
528
- * One theme as Blume's tokens, for docs-kit. Fonts are stacks, so the site
529
- * loads the files.
528
+ * One theme as Blume's tokens on `:root`, in each of its modes. Fonts are
529
+ * stacks, so the site loads the files.
530
530
  */
531
+ export const blumeThemeCss = (theme: ResolvedTheme) =>
532
+ blumeRules(theme, ":root").join("\n\n");
533
+
534
+ /** One theme's docs-kit stylesheet. */
531
535
  export const blumeTheme = (theme: ResolvedTheme) =>
532
536
  [
533
537
  `/* ${header} */`,
534
538
  `/* ${theme.name}: ${theme.description} */`,
535
- ...blumeRules(theme, ":root"),
539
+ blumeThemeCss(theme),
536
540
  ].join("\n\n") + "\n";
537
541
 
538
542
  /**
package/src/runtime.ts CHANGED
@@ -14,7 +14,7 @@ import { appTonesCss, type AppTones } from "./tones.ts";
14
14
 
15
15
  export { omarchyTheme, type OmarchyCurrentTheme } from "./omarchy.ts";
16
16
 
17
- export { hexModes } from "./generate.ts";
17
+ export { blumeThemeCss, hexModes } from "./generate.ts";
18
18
 
19
19
  export { appTonesCss, type AppTones } from "./tones.ts";
20
20