Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,3 +95,7 @@ Fumadocs MDX uses `async: true`, so individual documents are compiled into page-
## Worker types

`worker-configuration.d.ts` is generated locally by `wrangler types` and is intentionally **not tracked**. `pnpm typecheck` regenerates it before React Router types and the TypeScript compiler run; run `pnpm exec wrangler types` separately after changing bindings if editor types need refreshing. `opencode.json` is also ignored as machine-specific OpenCode configuration. The `DOCS_ENV` value is used server-side to keep staging out of search indexes.

## Design system

The shared tokens, fonts and base styles in `src/app.css` are synchronized from [the platform design system](https://github.com/0xbuffdev/platform/blob/16241087830ddd0c96ae7dd7ba81023cd8892365/packages/ui/src/styles/app.css). Keep the Fumadocs adapter, local source detection and documentation-specific rules when updating that snapshot. The documentation application does not import the platform's private workspace packages.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@
"build:staging": "node scripts/build-env.mjs staging"
},
"dependencies": {
"@fontsource-variable/dm-sans": "^5.3.0",
"@fontsource-variable/jetbrains-mono": "^5.3.0",
"@fontsource-variable/geist": "^5.3.0",
"@fontsource-variable/geist-mono": "^5.3.0",
"@fontsource-variable/orbitron": "^5.3.0",
"@react-router/serve": "^8",
"@types/mdx": "^2.0.14",
Expand Down
16 changes: 8 additions & 8 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions public/manifest.webmanifest
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
"start_url": "/",
"scope": "/",
"display": "standalone",
"background_color": "#14120f",
"theme_color": "#14120f",
"background_color": "#0a0a0a",
"theme_color": "#0a0a0a",
"icons": [
{
"src": "/icon-192.png",
Expand Down
37 changes: 37 additions & 0 deletions scripts/theme.test.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
import assert from "node:assert/strict";
import { readFile } from "node:fs/promises";
import test from "node:test";

const css = await readFile("src/app.css", "utf8");
const pkg = JSON.parse(await readFile("package.json", "utf8"));
const lock = await readFile("pnpm-lock.yaml", "utf8");

test("documentation uses the platform fonts and separate brand color", () => {
for (const name of ["geist", "geist-mono", "orbitron"]) {
assert.ok(pkg.dependencies["@fontsource-variable/" + name]);
assert.ok(css.includes('@import "@fontsource-variable/' + name + '";'));
assert.ok(lock.includes("'@fontsource-variable/" + name + "@5.3.0'"));
}
assert.doesNotMatch(css, /DM Sans|JetBrains Mono|--brand-primary/);
assert.doesNotMatch(lock, /@fontsource-variable\/(dm-sans|jetbrains-mono)/);
assert.match(css, /--font-sans:\s*'Geist Variable'/);
assert.match(css, /--font-mono:\s*'Geist Mono Variable'/);
assert.match(css, /--color-brand-orange:\s*var\(--brand-orange\)/);
assert.match(css, /--radius:\s*0\.375rem/);
});

test("Fumadocs uses platform surfaces and semantic colors in both themes", () => {
for (const [selector, background, primary, brand] of [
[":root", "#fafafa", "#171717", "#c2410c"],
[".dark", "#0a0a0a", "#ededed", "#ff7148"],
]) {
const blocks = [...css.matchAll(/(:root|\.dark)\s*\{([^}]+)\}/g)]
.filter((match) => match[1] === selector).map((match) => match[2]).join("\n");
assert.ok(blocks.includes("--background: " + background + ";"));
assert.ok(blocks.includes("--primary: " + primary + ";"));
assert.ok(blocks.includes("--brand-orange: " + brand + ";"));
for (const token of ["background", "foreground", "primary", "primary-foreground", "border", "ring"]) {
assert.ok(blocks.includes("--color-fd-" + token + ": var(--" + token + ");"));
}
}
});
Loading
Loading