@theholocron/docs-theme 0.1.0 → 1.0.9

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,34 @@
1
+ # @theholocron/docs-theme
2
+
3
+ Starlight plugin that injects the shared `@theholocron` docs CSS theme.
4
+
5
+ ## Install
6
+
7
+ ```bash
8
+ npm i @theholocron/docs-theme
9
+ ```
10
+
11
+ ## Usage
12
+
13
+ ```ts
14
+ // astro.config.ts
15
+ import { docsTheme } from "@theholocron/docs-theme";
16
+ import starlight from "@astrojs/starlight";
17
+ import { defineConfig } from "astro/config";
18
+
19
+ export default defineConfig({
20
+ integrations: [
21
+ starlight({
22
+ plugins: [docsTheme()],
23
+ title: "My Docs",
24
+ }),
25
+ ],
26
+ });
27
+ ```
28
+
29
+ ## Peer dependencies
30
+
31
+ | Package | Version |
32
+ | -------------------- | ---------- |
33
+ | `astro` | `>=5.0.0` |
34
+ | `@astrojs/starlight` | `>=0.30.0` |
@@ -0,0 +1,19 @@
1
+ //#region src/index.d.ts
2
+ interface SetupOptions {
3
+ config: {
4
+ customCss?: string[];
5
+ };
6
+ updateConfig(newConfig: {
7
+ customCss: string[];
8
+ }): void;
9
+ [key: string]: unknown;
10
+ }
11
+ interface StarlightPlugin {
12
+ name: string;
13
+ hooks: {
14
+ setup(options: SetupOptions): void | Promise<void>;
15
+ };
16
+ }
17
+ declare function docsTheme(): StarlightPlugin;
18
+ //#endregion
19
+ export { docsTheme as default, docsTheme };
package/dist/index.mjs ADDED
@@ -0,0 +1,13 @@
1
+ import { fileURLToPath } from "node:url";
2
+ //#region src/index.ts
3
+ const styles = fileURLToPath(new URL("./styles.css", import.meta.url));
4
+ function docsTheme() {
5
+ return {
6
+ name: "@theholocron/docs-theme",
7
+ hooks: { setup({ config, updateConfig }) {
8
+ updateConfig({ customCss: [styles, ...config.customCss ?? []] });
9
+ } }
10
+ };
11
+ }
12
+ //#endregion
13
+ export { docsTheme as default, docsTheme };
@@ -0,0 +1,21 @@
1
+ /*
2
+ * The Holocron — Starlight theme
3
+ *
4
+ * Overrides Starlight CSS custom properties.
5
+ * @see https://starlight.astro.build/guides/css-and-tailwind/
6
+ *
7
+ * Only accent colors are set here. All other values inherit Starlight defaults.
8
+ * Consumer sites may add their own customCss entries after this to override further.
9
+ */
10
+
11
+ :root[data-theme="dark"] {
12
+ --sl-color-accent-low: #1d1204;
13
+ --sl-color-accent: #c89b3c;
14
+ --sl-color-accent-high: #f5d07a;
15
+ }
16
+
17
+ :root[data-theme="light"] {
18
+ --sl-color-accent-low: #f5e8c8;
19
+ --sl-color-accent: #9b6f2a;
20
+ --sl-color-accent-high: #5c3d0e;
21
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@theholocron/docs-theme",
3
- "version": "0.1.0",
3
+ "version": "1.0.9",
4
4
  "description": "Starlight plugin providing the shared docs theme.",
5
5
  "keywords": [
6
6
  "astro",
@@ -29,7 +29,8 @@
29
29
  "types": "./dist/index.d.mts",
30
30
  "import": "./dist/index.mjs",
31
31
  "default": "./dist/index.mjs"
32
- }
32
+ },
33
+ "./styles.css": "./dist/styles.css"
33
34
  },
34
35
  "main": "./dist/index.mjs",
35
36
  "files": [
@@ -42,14 +43,14 @@
42
43
  "@theholocron/tsconfig": "^7.4.1",
43
44
  "@theholocron/tsdown-config": "^7.4.1",
44
45
  "@theholocron/vitest-config": "^7.4.1",
45
- "@types/node": "^26.1.1",
46
+ "@types/node": "^26.1.2",
46
47
  "@vitest/coverage-v8": "^4.1.10",
47
48
  "@vitest/eslint-plugin": "^1.6.23",
48
49
  "astro": "^7.1.5",
49
50
  "eslint": "^10.7.0",
50
51
  "eslint-plugin-n": "^18.2.2",
51
52
  "eslint-plugin-simple-import-sort": "^14.0.0",
52
- "globals": "^17.7.0",
53
+ "globals": "^17.8.0",
53
54
  "tsdown": "^0.22.13",
54
55
  "typescript": "^5.9.3",
55
56
  "vitest": "^4.1.10"