@vantagecompute/docusaurus-theme 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,114 @@
1
+ # @vantagecompute/docusaurus-theme
2
+
3
+ Shared Docusaurus theme for all Vantage Compute documentation sites. Provides the Vantage design system (CSS tokens, typography, dark/light themes), brand assets (Satoshi fonts, SVG icons, logo), and common theme component overrides.
4
+
5
+ ## Installation
6
+
7
+ ```bash
8
+ npm install @vantagecompute/docusaurus-theme
9
+ ```
10
+
11
+ ## Usage
12
+
13
+ Add the theme to your `docusaurus.config.js`:
14
+
15
+ ```js
16
+ const { staticDir, rehypeTabsTransform } = require('@vantagecompute/docusaurus-theme');
17
+
18
+ const config = {
19
+ // Add the Vantage theme
20
+ themes: ['@vantagecompute/docusaurus-theme'],
21
+
22
+ // Serve shared static assets (fonts, icons, logo)
23
+ staticDirectories: ['static', staticDir],
24
+
25
+ presets: [
26
+ ['classic', {
27
+ docs: {
28
+ // Optional: use the shared rehype plugin for lowercase <tabs>/<tabitem> support
29
+ rehypePlugins: [rehypeTabsTransform],
30
+ },
31
+ // Do NOT set customCss — the theme injects it automatically
32
+ }],
33
+ ],
34
+ };
35
+ ```
36
+
37
+ ## What's included
38
+
39
+ ### Design System CSS
40
+ The full Vantage design system (`custom.css`) is automatically loaded as a client module. It provides:
41
+ - **Design tokens** — Ink (neutral) and Iris (accent) color palettes with CSS variables
42
+ - **Dark/light themes** — Complete dark mode support
43
+ - **Typography** — Satoshi + Open Sans body, JetBrains Mono code
44
+ - **Component styles** — Navbar, sidebar, TOC, admonitions/callouts, tables, code blocks, breadcrumbs, tabs, guided how-to steps, and more
45
+
46
+ ### Brand Assets (static files)
47
+ Served automatically via `configureStaticDirs`:
48
+ - **Fonts** — Satoshi (Regular, Medium, Bold + italics) as `.woff` files
49
+ - **Icons** — Sun/moon toggles, search, external link, GitHub, chevron SVGs
50
+ - **Logo** — `vantage-logo.svg`
51
+ - **Favicon** — `favicon.ico`
52
+
53
+ ### Theme Component Overrides
54
+ | Component | Description |
55
+ |---|---|
56
+ | `ColorModeToggle` | Custom sun/moon SVG icon toggle |
57
+ | `DocBreadcrumbs` | Full-path breadcrumb rendering |
58
+ | `Tabs` | Bugfix for Docusaurus 3.10 whitespace crash |
59
+ | `MDXComponents` | Global `Tabs`/`TabItem` registration |
60
+ | `Navbar/MobileSidebar/SecondaryMenu` | Clean secondary menu render |
61
+
62
+ ### Utilities
63
+ | Export | Description |
64
+ |---|---|
65
+ | `rehypeTabsTransform` | Rehype plugin that transforms lowercase `<tabs>`/`<tabitem>` to React components |
66
+
67
+ ## Customization
68
+
69
+ ### Overriding theme components
70
+ Docusaurus uses layered theme resolution. To override any component the shared theme provides, create the same file path in your site's `src/theme/` directory. Your local version takes priority.
71
+
72
+ ```
73
+ your-docs-site/
74
+ src/
75
+ theme/
76
+ ColorModeToggle/ ← overrides the package's ColorModeToggle
77
+ index.js
78
+ ```
79
+
80
+ ### Extending CSS
81
+ Add your own CSS in `src/css/custom.css` and reference it in your preset config. Your styles will layer on top of the shared design system:
82
+
83
+ ```js
84
+ presets: [
85
+ ['classic', {
86
+ theme: {
87
+ customCss: require.resolve('./src/css/custom.css'),
88
+ },
89
+ }],
90
+ ],
91
+ ```
92
+
93
+ ### Overriding CSS variables
94
+ Override any design token in your custom CSS:
95
+
96
+ ```css
97
+ :root {
98
+ --iris-700: #your-brand-color;
99
+ --ifm-color-primary: #your-brand-color;
100
+ }
101
+ ```
102
+
103
+ ## Development
104
+
105
+ ```bash
106
+ npm install
107
+ npm run build # Compile TypeScript entry point
108
+ ```
109
+
110
+ The package uses TypeScript for the plugin entry point (`src/index.ts` → `lib/index.js`). Theme components, CSS, and static assets are shipped as source and resolved by Docusaurus at build time.
111
+
112
+ ## License
113
+
114
+ MIT
package/lib/index.d.ts ADDED
@@ -0,0 +1,16 @@
1
+ import type { Plugin } from '@docusaurus/types';
2
+ export default function themeVantage(): Plugin;
3
+ /**
4
+ * Returns the absolute path to this package's static directory.
5
+ * Add this to your `staticDirectories` in docusaurus.config.js:
6
+ *
7
+ * ```js
8
+ * const { staticDir } = require('@vantagecompute/docusaurus-theme');
9
+ * module.exports = {
10
+ * staticDirectories: ['static', staticDir],
11
+ * };
12
+ * ```
13
+ */
14
+ export declare const staticDir: string;
15
+ export { default as rehypeTabsTransform } from './utils/rehypeTabsTransform';
16
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAEhD,MAAM,CAAC,OAAO,UAAU,YAAY,IAAI,MAAM,CAgB7C;AAED;;;;;;;;;;GAUG;AACH,eAAO,MAAM,SAAS,QAAuC,CAAC;AAE9D,OAAO,EAAE,OAAO,IAAI,mBAAmB,EAAE,MAAM,6BAA6B,CAAC"}
package/lib/index.js ADDED
@@ -0,0 +1,37 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.rehypeTabsTransform = exports.staticDir = void 0;
7
+ exports.default = themeVantage;
8
+ const path_1 = __importDefault(require("path"));
9
+ function themeVantage() {
10
+ return {
11
+ name: '@vantagecompute/docusaurus-theme',
12
+ getThemePath() {
13
+ return path_1.default.resolve(__dirname, '../src/theme');
14
+ },
15
+ getPathsToWatch() {
16
+ return [path_1.default.resolve(__dirname, '../src/theme/**/*.{js,jsx,ts,tsx,css}')];
17
+ },
18
+ getClientModules() {
19
+ return [path_1.default.resolve(__dirname, '../src/css/custom.css')];
20
+ },
21
+ };
22
+ }
23
+ /**
24
+ * Returns the absolute path to this package's static directory.
25
+ * Add this to your `staticDirectories` in docusaurus.config.js:
26
+ *
27
+ * ```js
28
+ * const { staticDir } = require('@vantagecompute/docusaurus-theme');
29
+ * module.exports = {
30
+ * staticDirectories: ['static', staticDir],
31
+ * };
32
+ * ```
33
+ */
34
+ exports.staticDir = path_1.default.resolve(__dirname, '../static');
35
+ var rehypeTabsTransform_1 = require("./utils/rehypeTabsTransform");
36
+ Object.defineProperty(exports, "rehypeTabsTransform", { enumerable: true, get: function () { return __importDefault(rehypeTabsTransform_1).default; } });
37
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;AAGA,+BAgBC;AAnBD,gDAAwB;AAGxB,SAAwB,YAAY;IAClC,OAAO;QACL,IAAI,EAAE,kCAAkC;QAExC,YAAY;YACV,OAAO,cAAI,CAAC,OAAO,CAAC,SAAS,EAAE,cAAc,CAAC,CAAC;QACjD,CAAC;QAED,eAAe;YACb,OAAO,CAAC,cAAI,CAAC,OAAO,CAAC,SAAS,EAAE,uCAAuC,CAAC,CAAC,CAAC;QAC5E,CAAC;QAED,gBAAgB;YACd,OAAO,CAAC,cAAI,CAAC,OAAO,CAAC,SAAS,EAAE,uBAAuB,CAAC,CAAC,CAAC;QAC5D,CAAC;KACF,CAAC;AACJ,CAAC;AAED;;;;;;;;;;GAUG;AACU,QAAA,SAAS,GAAG,cAAI,CAAC,OAAO,CAAC,SAAS,EAAE,WAAW,CAAC,CAAC;AAE9D,mEAA6E;AAApE,2IAAA,OAAO,OAAuB"}
package/package.json ADDED
@@ -0,0 +1,46 @@
1
+ {
2
+ "name": "@vantagecompute/docusaurus-theme",
3
+ "version": "0.1.0",
4
+ "description": "Shared Vantage Compute Docusaurus theme — design system, brand assets, and common theme overrides for all vantagecompute documentation sites.",
5
+ "license": "MIT",
6
+ "main": "lib/index.js",
7
+ "types": "lib/index.d.ts",
8
+ "files": [
9
+ "lib",
10
+ "static",
11
+ "src"
12
+ ],
13
+ "scripts": {
14
+ "build": "tsc",
15
+ "prepublishOnly": "npm run build"
16
+ },
17
+ "peerDependencies": {
18
+ "@docusaurus/core": "^3.0.0",
19
+ "@docusaurus/theme-common": "^3.0.0",
20
+ "@docusaurus/plugin-content-docs": "^3.0.0",
21
+ "react": "^18.0.0",
22
+ "react-dom": "^18.0.0"
23
+ },
24
+ "dependencies": {
25
+ "clsx": "^2.0.0",
26
+ "unist-util-visit": "^5.0.0"
27
+ },
28
+ "devDependencies": {
29
+ "@docusaurus/module-type-aliases": "^3.10.1",
30
+ "@docusaurus/tsconfig": "^3.10.1",
31
+ "@docusaurus/types": "^3.10.1",
32
+ "@types/react": "^19.2.17",
33
+ "typescript": "~5.6.2"
34
+ },
35
+ "repository": {
36
+ "type": "git",
37
+ "url": "https://github.com/vantagecompute/vantage-docusaurus-theme.git"
38
+ },
39
+ "keywords": [
40
+ "docusaurus",
41
+ "docusaurus-theme",
42
+ "vantage",
43
+ "vantagecompute",
44
+ "documentation"
45
+ ]
46
+ }