bhooai-nexus 0.1.3 → 0.1.4
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 +2 -0
- package/apps/admin/package.json +3 -5
- package/apps/admin/postcss.config.js +5 -6
- package/docs/ARCHITECTURE.md +13 -0
- package/docs/IMPROVEMENTS.md +5 -0
- package/docs/api/postcss.html +241 -0
- package/docs/assets/nav.js +3 -0
- package/docs/getting-started.html +18 -1
- package/docs/guides/guide-frontend-styling.html +235 -0
- package/docs/learn/12-apps.html +19 -1
- package/docs/troubleshooting.html +400 -0
- package/package.json +5 -1
- package/packages/nexus-admin/package.json +1 -1
- package/packages/nexus-ads/package.json +4 -2
- package/packages/nexus-ai-client/package.json +4 -2
- package/packages/nexus-auth/package.json +4 -2
- package/packages/nexus-cache/package.json +4 -2
- package/packages/nexus-cli/package.json +4 -2
- package/packages/nexus-cli/templates/apps/admin/package.json +1 -3
- package/packages/nexus-cli/templates/apps/admin/postcss.config.js +3 -6
- package/packages/nexus-cli/templates/apps/frontend/package.json +1 -0
- package/packages/nexus-cli/templates/apps/frontend/postcss.config.js +3 -0
- package/packages/nexus-cli/templates/apps/frontend/src/index.css +44 -0
- package/packages/nexus-cli/templates/apps/frontend/src/main.tsx +1 -0
- package/packages/nexus-cli/templates/apps/frontend/tailwind.config.js +9 -0
- package/packages/nexus-core/package.json +4 -2
- package/packages/nexus-crypto/package.json +4 -2
- package/packages/nexus-data/package.json +4 -2
- package/packages/nexus-email/package.json +4 -2
- package/packages/nexus-graphql/package.json +4 -2
- package/packages/nexus-payments/package.json +4 -2
- package/packages/nexus-plugins/package.json +4 -2
- package/packages/nexus-postcss/package.json +34 -0
- package/packages/nexus-postcss/src/index.js +1 -0
- package/packages/nexus-postcss/src/plugins.js +46 -0
- package/packages/nexus-postcss/src/theme.css +64 -0
- package/packages/nexus-postcss/src/types.ts +12 -0
- package/packages/nexus-realtime/package.json +4 -2
- package/packages/nexus-telemetry/package.json +4 -2
package/README.md
CHANGED
|
@@ -14,6 +14,7 @@ Build full-stack Node.js applications with one CLI and one configuration file. B
|
|
|
14
14
|
- Python FastAPI AI server with OpenAI-compatible chat, embeddings, Ollama, and SSE streaming
|
|
15
15
|
- Admin console with configuration, environment, process, monitoring, database, AI, and cluster management
|
|
16
16
|
- Master/slave cluster mesh with load balancing, node agents, request allocation, health checks, and upload path pinning
|
|
17
|
+
- Tailwind CSS + `@bhooai/nexus-postcss` preset with PostCSS pipeline, design tokens, and dark theme baseline for every scaffolded frontend
|
|
17
18
|
|
|
18
19
|
## Requirements
|
|
19
20
|
|
|
@@ -274,6 +275,7 @@ Development endpoints are frontend `http://localhost:3000`, admin `http://localh
|
|
|
274
275
|
|
|
275
276
|
- [`docs/ARCHITECTURE.md`](docs/ARCHITECTURE.md) — architecture and data flow
|
|
276
277
|
- [`docs/IMPROVEMENTS.md`](docs/IMPROVEMENTS.md) — improvement history
|
|
278
|
+
- [`docs/troubleshooting.html`](docs/troubleshooting.html) — common errors and fixes
|
|
277
279
|
- [`docs/screenshots/README.md`](docs/screenshots/README.md) — screenshot catalog
|
|
278
280
|
- [`apps/ai-server/README.md`](apps/ai-server/README.md) — Python AI service
|
|
279
281
|
- Package documentation under `packages/nexus-*/README.md`
|
package/apps/admin/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bhooai/admin-host",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.1",
|
|
4
4
|
"private": true,
|
|
5
5
|
"type": "module",
|
|
6
6
|
"scripts": {
|
|
@@ -13,13 +13,11 @@
|
|
|
13
13
|
"react-dom": "^18.3.1"
|
|
14
14
|
},
|
|
15
15
|
"devDependencies": {
|
|
16
|
+
"@bhooai/nexus-postcss": "*",
|
|
16
17
|
"@types/react": "^18.3.0",
|
|
17
18
|
"@types/react-dom": "^18.3.0",
|
|
18
19
|
"@vitejs/plugin-react": "^4.3.0",
|
|
19
|
-
"autoprefixer": "^10.4.20",
|
|
20
|
-
"postcss": "^8.4.47",
|
|
21
|
-
"tailwindcss": "^3.4.13",
|
|
22
20
|
"typescript": "^5.6.2",
|
|
23
21
|
"vite": "^5.4.0"
|
|
24
22
|
}
|
|
25
|
-
}
|
|
23
|
+
}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
};
|
|
1
|
+
import { createPreset } from '@bhooai/nexus-postcss';
|
|
2
|
+
|
|
3
|
+
export default createPreset({
|
|
4
|
+
extraContent: ['../../packages/nexus-admin/src/**/*.{ts,tsx}'],
|
|
5
|
+
});
|
package/docs/ARCHITECTURE.md
CHANGED
|
@@ -27,6 +27,7 @@ BhooAI-Nexus/ (container; no package.json)
|
|
|
27
27
|
│ ├── nexus-ads Google Ads REST client (GAQL)
|
|
28
28
|
│ ├── nexus-ai-client Node client for the Python AI server (SSE, retries, timeout)
|
|
29
29
|
│ ├── nexus-plugins plugin runtime: manifest, host, sandbox, hooks
|
|
30
|
+
│ ├── nexus-postcss opinionated PostCSS preset (Tailwind, nesting, preset-env, autoprefixer, cssnano) + theme.css design tokens
|
|
30
31
|
│ └── nexus-cli init, dev (supervisor), build, test, doctor
|
|
31
32
|
├── apps/
|
|
32
33
|
│ ├── backend/ user backend built on @bhooai/nexus-* (modules + plugins)
|
|
@@ -37,6 +38,18 @@ BhooAI-Nexus/ (container; no package.json)
|
|
|
37
38
|
└── tests/ cross-service Playwright e2e
|
|
38
39
|
```
|
|
39
40
|
|
|
41
|
+
### Frontend CSS pipeline
|
|
42
|
+
|
|
43
|
+
Both `apps/frontend` and `apps/admin` use Tailwind CSS via the framework-owned
|
|
44
|
+
`@bhooai/nexus-postcss` preset. The preset (`packages/nexus-postcss/src/plugins.js`)
|
|
45
|
+
loads six PostCSS plugins in order: `postcss-import` → `postcss-nested` → `tailwindcss`
|
|
46
|
+
→ `postcss-preset-env` (stage 2) → `autoprefixer` → `cssnano` (production only). A
|
|
47
|
+
`theme.css` stylesheet (`packages/nexus-postcss/src/theme.css`) defines 22 CSS custom
|
|
48
|
+
properties (`--nexus-bg`, `--nexus-ink`, `--nexus-surface`, `--nexus-accent`, etc.) on
|
|
49
|
+
`:root`, plus 15 `--admin-*` aliases for backwards compatibility. Scaffolded projects
|
|
50
|
+
import the tokens with `@import '@bhooai/nexus-postcss/theme.css'` at the top of their
|
|
51
|
+
`index.css`.
|
|
52
|
+
|
|
40
53
|
Run workspace commands from `bhooai-nexus/`. The parent directory only groups
|
|
41
54
|
the package and related local projects.
|
|
42
55
|
|
package/docs/IMPROVEMENTS.md
CHANGED
|
@@ -12,6 +12,11 @@ This document records (a) improvements already made over the obvious/naive appro
|
|
|
12
12
|
- **`nexus.runtime.json` instead of AST patching.** The admin app writes overrides to a gitignored JSON file rather than rewriting the human-edited `nexus.config.ts` with `ts-morph`. The typed config stays clean; admin never touches source.
|
|
13
13
|
- **Single cross-service contract.** `contracts/ai-openapi.yaml` is the source of truth for the Node↔Python AI boundary; the Python server and the Node `nexus-ai-client` both derive from it, eliminating drift between terminals.
|
|
14
14
|
|
|
15
|
+
### Frontend CSS pipeline
|
|
16
|
+
- **`@bhooai/nexus-postcss` preset.** A framework-owned PostCSS preset packages the entire CSS build chain — `postcss-import` → `postcss-nested` → `tailwindcss` → `postcss-preset-env` → `autoprefixer` → `cssnano` (production only) — behind one `createPreset()` factory call. Scaffolded projects get Tailwind by default without hand-maintaining a plugin list. All 7 preset deps are MIT-licensed.
|
|
17
|
+
- **`theme.css` design tokens.** 22 CSS custom properties (`--nexus-bg`, `--nexus-ink`, `--nexus-surface`, `--nexus-accent`, `--nexus-mesh`, etc.) on `:root` provide a consistent dark theme baseline. 15 `--admin-*` aliases map to their `--nexus-*` equivalents for backwards compatibility with existing admin CSS. Apps opt in with `@import '@bhooai/nexus-postcss/theme.css'`.
|
|
18
|
+
- **Plugin resolution inside the preset.** Plugins are imported and instantiated within `@bhooai/nexus-postcss` (not resolved from the consumer's `node_modules`), so scaffolded projects don't need `postcss-import`/`postcss-nested`/etc. installed directly.
|
|
19
|
+
|
|
15
20
|
### GraphQL (no Apollo)
|
|
16
21
|
- **`graphql` (graphql-js) core + a from-scratch federation layer.** Composition, supergraph SDL, a query planner (FetchNode DAG with `@key` entity joins, `@provides`/`@requires`), and a gateway executor — all ours. No `@apollo/*`, no `@graphql-tools/federation`.
|
|
17
22
|
- **In-process vs distributed execution behind one gateway interface.** A single-subgraph app pays no federation overhead (direct `execute()`); `nexus add subgraph` opts into federation. The naive sequential planner is correct before being clever.
|
|
@@ -0,0 +1,241 @@
|
|
|
1
|
+
<!doctype html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="utf-8" />
|
|
5
|
+
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
6
|
+
<title>PostCSS Preset API — BhooAI Nexus Docs</title>
|
|
7
|
+
<link rel="stylesheet" href="../assets/style.css" />
|
|
8
|
+
<link rel="icon" href="../assets/favicon.ico" sizes="32x32" />
|
|
9
|
+
</head>
|
|
10
|
+
<body>
|
|
11
|
+
<div id="sidebar"></div>
|
|
12
|
+
<main id="content">
|
|
13
|
+
<h1><span class="badge core">@bhooai/nexus-postcss</span> PostCSS Preset API
|
|
14
|
+
<span class="sub">Opinionated PostCSS pipeline — Tailwind, nesting, future CSS, autoprefixing, and minification in one curated preset.</span></h1>
|
|
15
|
+
|
|
16
|
+
<p>A single, framework-owned PostCSS preset that every Nexus frontend and admin app
|
|
17
|
+
consumes. Scaffolded projects get it automatically via <code>nexus init</code>; existing
|
|
18
|
+
apps add it with one line in <code>postcss.config.js</code>.</p>
|
|
19
|
+
|
|
20
|
+
<div class="callout note">
|
|
21
|
+
<span class="label">Why a preset?</span>
|
|
22
|
+
Nexus follows a "from-scratch where it matters" philosophy. The preset packages the
|
|
23
|
+
entire CSS build chain — Tailwind, nesting, autoprefixing, minification — behind one
|
|
24
|
+
versioned, curated entry point so scaffolded projects don't hand-maintain a plugin list.
|
|
25
|
+
</div>
|
|
26
|
+
|
|
27
|
+
<h2>Exports</h2>
|
|
28
|
+
<table>
|
|
29
|
+
<thead><tr><th>Area</th><th>Exports</th></tr></thead>
|
|
30
|
+
<tbody>
|
|
31
|
+
<tr><td>factory</td><td><code>createPreset</code></td></tr>
|
|
32
|
+
<tr><td>types</td><td><code>NexusPostcssOptions</code></td></tr>
|
|
33
|
+
<tr><td>stylesheet</td><td><code>@bhooai/nexus-postcss/theme.css</code></td></tr>
|
|
34
|
+
</tbody>
|
|
35
|
+
</table>
|
|
36
|
+
|
|
37
|
+
<h2>Plugin chain (in order)</h2>
|
|
38
|
+
<table>
|
|
39
|
+
<thead><tr><th>#</th><th>Plugin</th><th>What it does</th></tr></thead>
|
|
40
|
+
<tbody>
|
|
41
|
+
<tr><td>1</td><td><code>postcss-import</code></td><td>Resolves <code>@import</code> statements — enables <code>@import '@bhooai/nexus-postcss/theme.css'</code></td></tr>
|
|
42
|
+
<tr><td>2</td><td><code>postcss-nested</code></td><td>Native CSS nesting (<code>& .child { }</code>) before Tailwind processes <code>@apply</code></td></tr>
|
|
43
|
+
<tr><td>3</td><td><code>tailwindcss</code></td><td>Injects <code>@tailwind base/components/utilities</code> + scans <code>content</code> paths for utility classes</td></tr>
|
|
44
|
+
<tr><td>4</td><td><code>postcss-preset-env</code></td><td>Future CSS features today (stage 2 by default) — <code>color-mix()</code>, <code>@custom-media</code>, etc.</td></tr>
|
|
45
|
+
<tr><td>5</td><td><code>autoprefixer</code></td><td>Vendor prefixes based on <code>browserslist</code></td></tr>
|
|
46
|
+
<tr><td>6</td><td><code>cssnano</code></td><td>Minification — <strong>only when <code>NODE_ENV=production</code></strong> or <code>minify:true</code></td></tr>
|
|
47
|
+
</tbody>
|
|
48
|
+
</table>
|
|
49
|
+
|
|
50
|
+
<div class="callout note">
|
|
51
|
+
<span class="label">Plugin resolution</span>
|
|
52
|
+
All plugins are <strong>imported and instantiated inside the preset package</strong>, not
|
|
53
|
+
resolved from the consumer's <code>node_modules</code>. This means scaffolded projects
|
|
54
|
+
don't need to install <code>postcss-import</code>, <code>postcss-nested</code>, etc.
|
|
55
|
+
directly — they're transitive deps of <code>@bhooai/nexus-postcss</code>.
|
|
56
|
+
</div>
|
|
57
|
+
|
|
58
|
+
<h2><code>createPreset(options)</code></h2>
|
|
59
|
+
<p>Returns <code>{ plugins: PostCSSPlugin[] }</code> — an array of instantiated PostCSS
|
|
60
|
+
plugins ready for <code>postcss.config.js</code>.</p>
|
|
61
|
+
|
|
62
|
+
<h3>Options</h3>
|
|
63
|
+
<table>
|
|
64
|
+
<thead><tr><th>Option</th><th>Type</th><th>Default</th><th>Description</th></tr></thead>
|
|
65
|
+
<tbody>
|
|
66
|
+
<tr><td><code>content</code></td><td><code>string[]</code></td><td><code>['./index.html', './src/**/*.{ts,tsx}']</code></td><td>Tailwind content scan paths</td></tr>
|
|
67
|
+
<tr><td><code>extraContent</code></td><td><code>string[]</code></td><td><code>[]</code></td><td>Additional content paths merged into <code>content</code></td></tr>
|
|
68
|
+
<tr><td><code>theme</code></td><td><code>object</code></td><td><code>{}</code></td><td>Tailwind theme extensions</td></tr>
|
|
69
|
+
<tr><td><code>tailwindPlugins</code></td><td><code>array</code></td><td><code>[]</code></td><td>Tailwind plugins (e.g. <code>@tailwindcss/forms</code>)</td></tr>
|
|
70
|
+
<tr><td><code>import</code></td><td><code>boolean</code></td><td><code>true</code></td><td>Enable <code>postcss-import</code></td></tr>
|
|
71
|
+
<tr><td><code>nested</code></td><td><code>boolean</code></td><td><code>true</code></td><td>Enable <code>postcss-nested</code></td></tr>
|
|
72
|
+
<tr><td><code>presetEnv</code></td><td><code>boolean | 'stage2' | 'stage3' | 'stage4'</code></td><td><code>true</code> (stage2)</td><td>Enable <code>postcss-preset-env</code> with the given stage</td></tr>
|
|
73
|
+
<tr><td><code>autoprefixer</code></td><td><code>boolean | object</code></td><td><code>true</code></td><td>Enable autoprefixer (or pass options like <code>{ overrideBrowserslist }</code>)</td></tr>
|
|
74
|
+
<tr><td><code>minify</code></td><td><code>boolean</code></td><td><code>NODE_ENV === 'production'</code></td><td>Enable <code>cssnano</code> minification</td></tr>
|
|
75
|
+
<tr><td><code>plugins</code></td><td><code>Array<string | [string, object]></code></td><td><code>[]</code></td><td>Custom PostCSS plugins to append after the preset chain</td></tr>
|
|
76
|
+
</tbody>
|
|
77
|
+
</table>
|
|
78
|
+
|
|
79
|
+
<h2>Usage</h2>
|
|
80
|
+
|
|
81
|
+
<h3>Default (scaffolded projects)</h3>
|
|
82
|
+
<pre><code><span class="com">// postcss.config.js</span>
|
|
83
|
+
<span class="kw">import</span> { createPreset } <span class="kw">from</span> <span class="str">'@bhooai/nexus-postcss'</span>;
|
|
84
|
+
|
|
85
|
+
<span class="kw">export default</span> createPreset();</code></pre>
|
|
86
|
+
|
|
87
|
+
<h3>With framework admin content scanning</h3>
|
|
88
|
+
<pre><code><span class="com">// postcss.config.js (admin app)</span>
|
|
89
|
+
<span class="kw">import</span> { createPreset } <span class="kw">from</span> <span class="str">'@bhooai/nexus-postcss'</span>;
|
|
90
|
+
|
|
91
|
+
<span class="kw">export default</span> createPreset({
|
|
92
|
+
extraContent: [<span class="str">'../../packages/nexus-admin/src/**/*.{ts,tsx}'</span>],
|
|
93
|
+
});</code></pre>
|
|
94
|
+
|
|
95
|
+
<h3>With Tailwind theme extensions</h3>
|
|
96
|
+
<pre><code><span class="kw">export default</span> createPreset({
|
|
97
|
+
theme: {
|
|
98
|
+
colors: {
|
|
99
|
+
brand: <span class="str">'#67e8f9'</span>,
|
|
100
|
+
},
|
|
101
|
+
},
|
|
102
|
+
tailwindPlugins: [require(<span class="str">'@tailwindcss/forms'</span>)],
|
|
103
|
+
});</code></pre>
|
|
104
|
+
|
|
105
|
+
<h3>Disabling specific plugins</h3>
|
|
106
|
+
<pre><code><span class="kw">export default</span> createPreset({
|
|
107
|
+
import: <span class="kw">false</span>,
|
|
108
|
+
nested: <span class="kw">false</span>,
|
|
109
|
+
presetEnv: <span class="kw">false</span>,
|
|
110
|
+
autoprefixer: <span class="kw">false</span>,
|
|
111
|
+
});</code></pre>
|
|
112
|
+
|
|
113
|
+
<h3>Always minify (even in dev)</h3>
|
|
114
|
+
<pre><code><span class="kw">export default</span> createPreset({ minify: <span class="kw">true</span> });</code></pre>
|
|
115
|
+
|
|
116
|
+
<h3>Appending custom PostCSS plugins</h3>
|
|
117
|
+
<pre><code><span class="kw">export default</span> createPreset({
|
|
118
|
+
plugins: [
|
|
119
|
+
[<span class="str">'my-postcss-plugin'</span>, { foo: <span class="num">1</span> }],
|
|
120
|
+
<span class="str">'another-plugin'</span>,
|
|
121
|
+
],
|
|
122
|
+
});</code></pre>
|
|
123
|
+
|
|
124
|
+
<h2>Tailwind config</h2>
|
|
125
|
+
<p>Each app keeps its own <code>tailwind.config.js</code>. The preset only injects
|
|
126
|
+
<code>content</code> paths and the plugin chain — theme extensions and Tailwind
|
|
127
|
+
plugins stay in your <code>tailwind.config.js</code>.</p>
|
|
128
|
+
<pre><code><span class="com">// tailwind.config.js (default scaffolded)</span>
|
|
129
|
+
<span class="kw">export default</span> {
|
|
130
|
+
content: [<span class="str">'./index.html'</span>, <span class="str">'./src/**/*.{ts,tsx}'</span>],
|
|
131
|
+
theme: { extend: {} },
|
|
132
|
+
plugins: [],
|
|
133
|
+
};</code></pre>
|
|
134
|
+
|
|
135
|
+
<h2>theme.css — Design tokens</h2>
|
|
136
|
+
<p>Import the framework-wide design tokens with a single <code>@import</code> at the top
|
|
137
|
+
of your <code>index.css</code>:</p>
|
|
138
|
+
<pre><code><span class="com">/* src/index.css */</span>
|
|
139
|
+
@<span class="kw">import</span> <span class="str">'@bhooai/nexus-postcss/theme.css'</span>;
|
|
140
|
+
|
|
141
|
+
@tailwind base;
|
|
142
|
+
@tailwind components;
|
|
143
|
+
@tailwind utilities;</code></pre>
|
|
144
|
+
|
|
145
|
+
<h3>Nexus tokens (<code>--nexus-*</code>)</h3>
|
|
146
|
+
<table>
|
|
147
|
+
<thead><tr><th>Token</th><th>Default</th><th>Use</th></tr></thead>
|
|
148
|
+
<tbody>
|
|
149
|
+
<tr><td><code>--nexus-bg</code></td><td><code>#050817</code></td><td>App background</td></tr>
|
|
150
|
+
<tr><td><code>--nexus-bg-alt</code></td><td><code>#0b0d1a</code></td><td>Alternate surface</td></tr>
|
|
151
|
+
<tr><td><code>--nexus-ink</code></td><td><code>#eef6ff</code></td><td>Primary text</td></tr>
|
|
152
|
+
<tr><td><code>--nexus-muted</code></td><td><code>#8496ad</code></td><td>Secondary text</td></tr>
|
|
153
|
+
<tr><td><code>--nexus-surface</code></td><td><code>rgba(10,24,45,.78)</code></td><td>Glass surface background</td></tr>
|
|
154
|
+
<tr><td><code>--nexus-surface-strong</code></td><td><code>rgba(8,25,48,.68)</code></td><td>Stronger surface</td></tr>
|
|
155
|
+
<tr><td><code>--nexus-border</code></td><td><code>rgba(125,174,235,.2)</code></td><td>Default border</td></tr>
|
|
156
|
+
<tr><td><code>--nexus-border-bright</code></td><td><code>rgba(112,168,228,.17)</code></td><td>Brighter border</td></tr>
|
|
157
|
+
<tr><td><code>--nexus-accent</code></td><td><code>#67e8f9</code></td><td>Accent color (links, highlights)</td></tr>
|
|
158
|
+
<tr><td><code>--nexus-accent-soft</code></td><td><code>rgba(103,232,249,.08)</code></td><td>Soft accent background</td></tr>
|
|
159
|
+
<tr><td><code>--nexus-blue</code></td><td><code>rgba(38,130,225,.55)</code></td><td>Blue gradient stop</td></tr>
|
|
160
|
+
<tr><td><code>--nexus-violet</code></td><td><code>rgba(90,67,183,.45)</code></td><td>Violet gradient stop</td></tr>
|
|
161
|
+
<tr><td><code>--nexus-pink</code></td><td><code>#f43f5e</code></td><td>Danger / error accent</td></tr>
|
|
162
|
+
<tr><td><code>--nexus-emerald</code></td><td><code>#34d399</code></td><td>Success / online indicator</td></tr>
|
|
163
|
+
<tr><td><code>--nexus-radius</code></td><td><code>0.7rem</code></td><td>Default border radius</td></tr>
|
|
164
|
+
<tr><td><code>--nexus-radius-lg</code></td><td><code>1rem</code></td><td>Large border radius</td></tr>
|
|
165
|
+
<tr><td><code>--nexus-shell-width</code></td><td><code>1280px</code></td><td>Max content width</td></tr>
|
|
166
|
+
<tr><td><code>--nexus-mesh</code></td><td>3× <code>radial-gradient(...)</code></td><td>Ambient mesh background</td></tr>
|
|
167
|
+
<tr><td><code>--nexus-mesh-opacity</code></td><td><code>0.27</code></td><td>Mesh overlay opacity</td></tr>
|
|
168
|
+
<tr><td><code>--nexus-selection</code></td><td><code>rgba(129,140,248,.35)</code></td><td>Text selection color</td></tr>
|
|
169
|
+
<tr><td><code>--nexus-scrollbar</code></td><td><code>rgba(255,255,255,.18)</code></td><td>Scrollbar track</td></tr>
|
|
170
|
+
<tr><td><code>--nexus-scrollbar-thumb</code></td><td><code>rgba(255,255,255,.14)</code></td><td>Scrollbar thumb</td></tr>
|
|
171
|
+
</tbody>
|
|
172
|
+
</table>
|
|
173
|
+
|
|
174
|
+
<h3>Admin aliases (<code>--admin-*</code>)</h3>
|
|
175
|
+
<p>For backwards compatibility, all 15 <code>--admin-*</code> tokens are aliased to their
|
|
176
|
+
<code>--nexus-*</code> equivalents. Existing admin CSS using <code>var(--admin-bg)</code>
|
|
177
|
+
works without changes.</p>
|
|
178
|
+
<table>
|
|
179
|
+
<thead><tr><th>Admin token</th><th>Maps to</th></tr></thead>
|
|
180
|
+
<tbody>
|
|
181
|
+
<tr><td><code>--admin-bg</code></td><td><code>var(--nexus-bg)</code></td></tr>
|
|
182
|
+
<tr><td><code>--admin-ink</code></td><td><code>var(--nexus-ink)</code></td></tr>
|
|
183
|
+
<tr><td><code>--admin-muted</code></td><td><code>var(--nexus-muted)</code></td></tr>
|
|
184
|
+
<tr><td><code>--admin-surface</code></td><td><code>var(--nexus-surface)</code></td></tr>
|
|
185
|
+
<tr><td><code>--admin-surface-strong</code></td><td><code>var(--nexus-surface-strong)</code></td></tr>
|
|
186
|
+
<tr><td><code>--admin-border</code></td><td><code>var(--nexus-border)</code></td></tr>
|
|
187
|
+
<tr><td><code>--admin-border-bright</code></td><td><code>var(--nexus-border-bright)</code></td></tr>
|
|
188
|
+
<tr><td><code>--admin-blue</code></td><td><code>var(--nexus-blue)</code></td></tr>
|
|
189
|
+
<tr><td><code>--admin-violet</code></td><td><code>var(--nexus-violet)</code></td></tr>
|
|
190
|
+
<tr><td><code>--admin-pink</code></td><td><code>var(--nexus-pink)</code></td></tr>
|
|
191
|
+
<tr><td><code>--admin-radius</code></td><td><code>var(--nexus-radius)</code></td></tr>
|
|
192
|
+
<tr><td><code>--admin-shell-width</code></td><td><code>var(--nexus-shell-width)</code></td></tr>
|
|
193
|
+
<tr><td><code>--admin-mesh</code></td><td><code>var(--nexus-mesh)</code></td></tr>
|
|
194
|
+
<tr><td><code>--admin-mesh-opacity</code></td><td><code>var(--nexus-mesh-opacity)</code></td></tr>
|
|
195
|
+
</tbody>
|
|
196
|
+
</table>
|
|
197
|
+
|
|
198
|
+
<h3>Retheming</h3>
|
|
199
|
+
<p>Override any token in your own <code>:root</code> block:</p>
|
|
200
|
+
<pre><code><span class="com">/* src/index.css */</span>
|
|
201
|
+
@<span class="kw">import</span> <span class="str">'@bhooai/nexus-postcss/theme.css'</span>;
|
|
202
|
+
|
|
203
|
+
:root {
|
|
204
|
+
--nexus-accent: <span class="str">#ff6b6b</span>; <span class="com">/* retheme the accent color */</span>
|
|
205
|
+
--nexus-bg: <span class="str">#1a1a2e</span>; <span class="com">/* change the background */</span>
|
|
206
|
+
}</code></pre>
|
|
207
|
+
|
|
208
|
+
<h2>Example CSS classes</h2>
|
|
209
|
+
<p>The scaffolded <code>index.css</code> ships with three example classes built from
|
|
210
|
+
Nexus tokens:</p>
|
|
211
|
+
<pre><code><span class="com">/* Frosted-glass card */</span>
|
|
212
|
+
.nexus-card {
|
|
213
|
+
background: <span class="kw">var</span>(--nexus-surface);
|
|
214
|
+
border: <span class="num">1</span>px solid <span class="kw">var</span>(--nexus-border);
|
|
215
|
+
border-radius: <span class="kw">var</span>(--nexus-radius);
|
|
216
|
+
color: <span class="kw">var</span>(--nexus-ink);
|
|
217
|
+
padding: <span class="num">1.5</span>rem;
|
|
218
|
+
backdrop-filter: blur(<span class="num">20</span>px);
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
<span class="com">/* Ambient mesh background */</span>
|
|
222
|
+
.nexus-mesh-bg {
|
|
223
|
+
background: <span class="kw">var</span>(--nexus-mesh), <span class="kw">var</span>(--nexus-bg);
|
|
224
|
+
background-attachment: fixed;
|
|
225
|
+
min-height: <span class="num">100</span>vh;
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
<span class="com">/* Accent-colored link */</span>
|
|
229
|
+
.nexus-link {
|
|
230
|
+
color: <span class="kw">var</span>(--nexus-accent);
|
|
231
|
+
text-decoration: none;
|
|
232
|
+
}</code></pre>
|
|
233
|
+
|
|
234
|
+
<h2>License</h2>
|
|
235
|
+
<p>All preset dependencies are MIT-licensed: <code>tailwindcss</code>,
|
|
236
|
+
<code>postcss</code>, <code>autoprefixer</code>, <code>cssnano</code>,
|
|
237
|
+
<code>postcss-import</code>, <code>postcss-nested</code>, <code>postcss-preset-env</code>.</p>
|
|
238
|
+
</main>
|
|
239
|
+
<script src="../assets/docs.js"></script>
|
|
240
|
+
</body>
|
|
241
|
+
</html>
|
package/docs/assets/nav.js
CHANGED
|
@@ -13,6 +13,7 @@ export const NAV = [
|
|
|
13
13
|
{ label: "Getting Started", file: "getting-started.html", tag: "how to run install" },
|
|
14
14
|
{ label: "Architecture", file: "architecture.html", tag: "how it's made" },
|
|
15
15
|
{ label: "Examples", file: "examples.html", tag: "recipes snippets code" },
|
|
16
|
+
{ label: "Troubleshooting", file: "troubleshooting.html", tag: "errors fix debug solve troubleshoot" },
|
|
16
17
|
],
|
|
17
18
|
},
|
|
18
19
|
{
|
|
@@ -28,6 +29,7 @@ export const NAV = [
|
|
|
28
29
|
{ label: "MongoDB CRUD", file: "guides/guide-mongodb.html", tag: "mongodb crud schema model query populate transaction" },
|
|
29
30
|
{ label: "GraphQL API", file: "guides/guide-graphql.html", tag: "graphql subgraph gateway subscription federation" },
|
|
30
31
|
{ label: "Cluster Setup", file: "guides/guide-cluster.html", tag: "cluster master slave node agent link load balancer" },
|
|
32
|
+
{ label: "Frontend Styling", file: "guides/guide-frontend-styling.html", tag: "frontend css tailwind postcss theme tokens styling" },
|
|
31
33
|
{ label: "Postman API Testing", file: "learn/14-postman-testing.html", tag: "postman testing api cluster link csrf" },
|
|
32
34
|
],
|
|
33
35
|
},
|
|
@@ -50,6 +52,7 @@ export const NAV = [
|
|
|
50
52
|
{ label: "Cluster", file: "api/cluster.html", pkg: "nexus-cluster", tag: "mesh nodes registry load balancer autoscaler" },
|
|
51
53
|
{ label: "Admin Client", file: "api/admin.html", pkg: "admin", tag: "admin react client login config env users roles metrics preflight lint payments databases ai cluster supervisor" },
|
|
52
54
|
{ label: "Safe Goto", file: "api/safe-goto.html", pkg: "nexus-safe-goto", tag: "external link dialog safe goto noopener noreferrer" },
|
|
55
|
+
{ label: "PostCSS Preset", file: "api/postcss.html", pkg: "nexus-postcss", tag: "postcss tailwind css preset theme tokens createpreset" },
|
|
53
56
|
{ label: "CLI", file: "api/cli.html", pkg: "nexus-cli", tag: "init wizard dev doctor uninstall pysetup supervisor" },
|
|
54
57
|
{ label: "HTTP Endpoints", file: "api/http-endpoints.html", tag: "http rest api endpoints routes get post put delete" },
|
|
55
58
|
{ label: "WebSockets", file: "api/websockets.html", tag: "websocket ws realtime graphql subscription" },
|
|
@@ -129,7 +129,24 @@ npm run doctor
|
|
|
129
129
|
npm run dev</code></pre>
|
|
130
130
|
<p>Run <code>npx nexus init .</code> after the first <code>npm install</code>; <code>npm init</code> only
|
|
131
131
|
creates the project <code>package.json</code>. The second install picks up generated frontend/admin
|
|
132
|
-
|
|
132
|
+
dependencies. The generated project owns the <code>doctor</code> and <code>dev</code> scripts.</p>
|
|
133
|
+
|
|
134
|
+
<h2>Frontend styling</h2>
|
|
135
|
+
<p>Scaffolded frontends ship with Tailwind CSS and a framework-owned PostCSS preset
|
|
136
|
+
(<code>@bhooai/nexus-postcss</code>). The <code>postcss.config.js</code> loads the
|
|
137
|
+
entire plugin chain — Tailwind, nesting, autoprefixing, minification — with one line:</p>
|
|
138
|
+
<pre><code><span class="kw">import</span> { createPreset } <span class="kw">from</span> <span class="str">'@bhooai/nexus-postcss'</span>;
|
|
139
|
+
<span class="kw">export default</span> createPreset();</code></pre>
|
|
140
|
+
<p>A design-token stylesheet (<code>theme.css</code>) provides 22 CSS custom properties
|
|
141
|
+
(<code>--nexus-bg</code>, <code>--nexus-ink</code>, <code>--nexus-accent</code>, etc.)
|
|
142
|
+
for a consistent dark theme baseline. Import it at the top of your
|
|
143
|
+
<code>index.css</code>:</p>
|
|
144
|
+
<pre><code>@<span class="kw">import</span> <span class="str">'@bhooai/nexus-postcss/theme.css'</span>;
|
|
145
|
+
@tailwind base;
|
|
146
|
+
@tailwind components;
|
|
147
|
+
@tailwind utilities;</code></pre>
|
|
148
|
+
<p>See the <a href="guides/guide-frontend-styling.html">Frontend Styling guide</a> and the
|
|
149
|
+
<a href="api/postcss.html">PostCSS API reference</a> for full documentation.</p>
|
|
133
150
|
|
|
134
151
|
<div class="foot">BhooAI Nexus · Getting Started</div>
|
|
135
152
|
</main>
|