Skip to content

Open-source manufacturing ERP, MES and QMS. Quoting, MRP, inventory, shop floor, quality and lot/serial traceability on one Postgres schema, with a REST API and MCP server. Self-host or use Carbon Cloud.

feat: selfhosting documentation (#929)

Sid945208c0ecbc
diff --git a/.claude/rules/contrib-deploying-swarm.md b/.claude/rules/contrib-deploying-swarm.md
new file mode 100644
index 0000000000..a18436389f
--- /dev/null
+++ b/.claude/rules/contrib-deploying-swarm.md
@@ -0,0 +1,79 @@
+---
+description: Self-hosted single-VPS deployment — Docker Swarm + Caddy stack under contrib/deploying/simple-docker-caddy. Swarm secrets, full Supabase data plane, the alternative to the SST/AWS cloud path.
+paths:
+ - "contrib/deploying/**"
+---
+
+# Self-host: single-VPS Docker Swarm + Caddy (`contrib/deploying/simple-docker-caddy`)
+
+Self-host the whole stack (ERP + MES + full Supabase data plane + Redis + Inngest)
+on **one Linux VPS** as a single-node Docker **Swarm** (`docker stack deploy`),
+behind an auto-HTTPS Caddy proxy. The community/self-host alternative to the
+managed SST/AWS path (see [sst-deployment-infrastructure.md](sst-deployment-infrastructure.md)).
+Both build from the same root `Dockerfile` (`--build-arg APP=erp|mes`).
+
+This **replaced** the old `docker-compose.prod.yml` + `deploy/prod/` compose stack
+(deleted) and the root `scripts/gen-supabase-keys.mjs` (moved into the example).
+
+## Files (all under `contrib/deploying/simple-docker-caddy/`)
+- `stack.yml` — the Swarm stack. NOT `docker compose up`-able: `build:`,
+ `depends_on`, `profiles`, `restart:` are intentionally absent (Swarm ignores
+ them). Uses `deploy:` (replicas/resources/update_config/restart_policy), top-level
+ `secrets: external: true`, an `attachable` overlay `internal`, YAML anchors
+ (`*shim`, `*restart`, `*app-deploy`).
+- `deploy.sh` — lifecycle: `init` (swarm init + create secrets + `.env`), `build`
+ (host build of erp/mes, skipped when `CARBON_REGISTRY` set), `deploy`
+ (`docker stack deploy`), `up` (build+deploy+migrate+roll apps), `migrate`,
+ `secret <name>` (stdin), `status`, `logs <svc>`, `down [--volumes]`.
+- `bin/secrets-entrypoint.sh` — the linchpin. Used as `entrypoint:` on every
+ secret-consuming service; substitutes `__SECRET_NAME__` placeholders in env with
+ the contents of `/run/secrets/<secret_name>` (awk literal subst — safe for `/ + = &`),
+ then `exec "$@"`. This is how Swarm secret *files* feed images that only read env
+ vars (incl. Postgres DSNs that embed the password). POSIX sh + awk; verified to
+ run as non-root (`supabase`, `ubuntu`) in the pinned images.
+- `Caddyfile` — `{$ERP_HOST}`→erp:3000, `{$MES_HOST}`→mes:3000, `{$SUPABASE_HOST}`→kong:8000,
+ + security headers/compression via a `(common)` snippet; optional `{$STUDIO_HOST}`
+ block behind `basic_auth` (commented; Studio is internal-only by default).
+- `postgres/01-roles.sh` — Supabase role passwords from `POSTGRES_PASSWORD` (`*.sh`
+ so it reads env; same as the old deploy/prod one).
+- `postgres/02-performance.sh` — first-init tuning via `ALTER SYSTEM` (max_connections,
+ shared_buffers, work_mem, effective_cache_size…) from `CARBON_PG_*` env +
+ `pg_stat_statements`. `shared_preload_libraries=pg_stat_statements` is a server
+ flag in the postgres `command:` (can't be set by ALTER SYSTEM at runtime).
+- `scripts/gen-supabase-keys.mjs` — Supabase JWT trio (jwt_secret + anon/service_role
+ signed with it). Consumed by `deploy.sh init`.
+- `scripts/harden.sh` — UFW (SSH+80+443 only), fail2ban, swap, unattended-upgrades.
+- `scripts/backup.sh` — `pg_dump` (password from the in-container secret) + storage
+ volume tarball.
+- `.env.example` — NON-secret config only (hosts/urls, `CARBON_REPO`, image tags,
+ pg tuning, toggles). Secrets are never here.
+
+## Secrets (9, all `external: true` — created by `deploy.sh init`)
+`postgres_password`, `session_secret`, `inngest_signing_key` (plain hex — self-host
+Inngest rejects the `signkey-` prefix), `inngest_event_key`, the trio `jwt_secret`/
+`anon_key`/`service_role_key` (minted together), and operator-supplied
+`resend_api_key` + `smtp_password` (seeded with placeholders so the stack deploys;
+ERP crashes on boot with an empty RESEND key).
+
+## Key facts / gotchas
+- **Single-node only.** Config files + edge functions are bind-mounted from
+ `${CARBON_REPO}` (the repo must be on the host; images also built from it). The
+ stack bind-mounts repo paths it doesn't duplicate: `packages/dev/docker/kong.yml`,
+ `packages/dev/docker/edge-main`, `packages/database/supabase/functions`,
+ `packages/database/src`. Multi-node → registry images + Swarm `configs` + shared storage.
+- **Image launch argv is preserved** when overriding `entrypoint` to the shim — each
+ service's `command:` is the image's real ENTRYPOINT+CMD (captured via
+ `docker image inspect`), e.g. realtime = `/usr/bin/tini -s -g -- /app/run.sh /app/bin/server`,
+ storage/meta/studio = `docker-entrypoint.sh node …`, postgres adds the tuning flags.
+- **Ordering** isn't via `depends_on` (Swarm ignores it). `deploy.sh up` deploys all,
+ waits for postgres+storage healthy, runs `migrate` as an ephemeral
+ `--mode replicated-job` service on `${STACK_NAME}_internal` (reads the password
+ from `/run/secrets/postgres_password`, `PGSSLMODE=disable`), then `--force` rolls erp/mes.
+- **Postgres has no TLS** → `SUPABASE_DB_URL` keeps `?sslmode=disable`; migrate sets `PGSSLMODE=disable`.
+- **Only caddy publishes** (80/443 + 443/udp for HTTP/3). Studio unpublished.
+- **Registry mode**: set `CARBON_REGISTRY` + image tags; `build` no-ops, `deploy`
+ resolves images from the registry.
+
+## Verify after editing
+`docker stack config -c stack.yml` (with `.env` sourced) must parse with no leftover
+`${...}` and the `__SECRET__` placeholders intact (resolved at runtime by the shim).
diff --git a/.claude/rules/dev-shared-redis.md b/.claude/rules/dev-shared-redis.md
index 6016d65190..63100c81ba 100644
--- a/.claude/rules/dev-shared-redis.md
+++ b/.claude/rules/dev-shared-redis.md
@@ -70,10 +70,11 @@ Two patterns: the shared `redis` client (caching / TTL state) and the
## Prod (for contrast)
-`docker-compose.prod.yml` defines a real `redis` service (`redis:7-alpine`,
-`profiles: ["data"]`, no published host port — reachable internally at
-`redis:6379`). `.env.production.example` sets `REDIS_URL=redis://redis:6379`;
-managed deployments override with an external URL.
+The self-hosted Swarm stack (`contrib/deploying/simple-docker-caddy/stack.yml`,
+see [contrib-deployment-swarm.md](contrib-deployment-swarm.md)) runs a real `redis`
+service (`redis:7-alpine`, `redis-server --appendonly yes`, no published host port
+— reachable internally at `redis:6379`); the apps set `REDIS_URL=redis://redis:6379`.
+Managed/cloud deployments override `REDIS_URL` with an external URL.
## Gotchas
diff --git a/.claude/rules/environment-configuration.md b/.claude/rules/environment-configuration.md
index 0ed1438e1c..1f72b30306 100644
--- a/.claude/rules/environment-configuration.md
+++ b/.claude/rules/environment-configuration.md
@@ -42,8 +42,9 @@ keys listed in `getBrowserEnv()` are exposed client-side.
"Do not edit by hand". Holds per-worktree ports, portless `*.dev` URLs,
dev Supabase keys, Redis/Inngest dev settings, `DEV_BYPASS_EMAIL`. Vite /
React Router auto-load it on top of `.env`, with `.env.local` overriding.
-- `.env.production.example` — template for the prod docker-compose env
- (copy to `.env.production`, used with `docker-compose.prod.yml`).
+- Self-hosting? The Swarm stack does **not** use a prod `.env` for secrets — it
+ uses Docker Swarm secrets + non-secret `contrib/deploying/simple-docker-caddy/.env`.
+ See [contrib-deployment-swarm.md](contrib-deployment-swarm.md).
- `scripts/setup-env-files.ts` symlinks the root `.env` (and `.env.local` if
present) into `apps/*` and packages `database`, `jobs`, `kv`.
diff --git a/.claude/rules/production-docker-compose.md b/.claude/rules/production-docker-compose.md
deleted file mode 100644
index 1dd8b8fdc7..0000000000
--- a/.claude/rules/production-docker-compose.md
+++ /dev/null
@@ -1,119 +0,0 @@
----
-description: Self-hosted production Docker Compose stack (apps + Supabase data plane + Redis + Inngest) and the deploy/prod/deploy.sh helper
-paths:
- - "deploy/**"
- - "docker-compose.prod.yml"
- - "Dockerfile"
- - "scripts/gen-supabase-keys.mjs"
----
-
-# Production Docker Compose (self-hosted stack)
-
-Single-host self-hosted deployment: ERP + MES + full Supabase data plane + Redis
-+ Inngest behind an auto-HTTPS Caddy proxy. Alternative to the SST/AWS path. Can
-also run **apps-only** against managed backends (omit the `data` profile).
-
-Note: the `.github/workflows/deploy.yml` "Deploy" job uses Pulumi + AWS ECR (the
-managed/cloud path), NOT this compose stack. It only shares the root `Dockerfile`.
-
-## Files (verified locations)
-- `docker-compose.prod.yml` (repo root) — the stack, 15 services
-- `.env.production.example` (repo root) — env template; copy to `.env.production` (gitignored)
-- `scripts/gen-supabase-keys.mjs` — zero-dep generator for the Supabase key trio
- (`SUPABASE_JWT_SECRET` + `anon`/`service_role` JWTs signed with it, HS256)
-- `Dockerfile` (repo root) — single shared app image, `ARG APP` (re-declared per
- stage), built with `--build-arg APP=erp|mes`. Stages: `deps` → `build`
- (`pnpm run build:${APP}`) → `runner` (node:22-slim, installs curl for healthcheck)
-- `deploy/prod/deploy.sh` — wrapper script (see below)
-- `deploy/prod/Caddyfile` — reverse proxy, 3 hostnames (`ERP_HOST` → erp:3000,
- `MES_HOST` → mes:3000, `SUPABASE_HOST` → kong:8000); ACME email from `ACME_EMAIL`
-- `deploy/prod/postgres/01-roles.sh` — role bootstrap. A `*.sh` (not `.sql`) so it
- reads `${POSTGRES_PASSWORD}` from env and `ALTER USER … WITH PASSWORD` on
- supabase_admin / supabase_auth_admin / supabase_storage_admin / authenticator;
- grants anon+authenticated+service_role to authenticator; creates `_realtime`
- schema. Mounted into `/docker-entrypoint-initdb.d` (runs once per fresh pgdata)
-- `deploy/prod/README.md` — operator runbook
-
-## Services (15)
-- **Apps (always on, no profile):** `erp`, `mes` (both build from root Dockerfile,
- image `carbon/{app}:latest`, expose 3000, `/health` healthcheck via curl),
- `caddy` (only published service — 80/443; `depends_on` erp+mes)
-- **`migrate`** — one-shot, `data` profile. `depends_on` postgres + storage healthy
-- **Data plane (`data` profile):** `postgres`, `gotrue`, `postgrest`, `realtime`,
- `storage`, `meta`, `studio`, `kong`, `edge-runtime`, `redis`, `inngest`
-
-`postgres` carries network alias `db`; `realtime` carries alias `realtime-dev`.
-Only `caddy` (80/443) and `studio` (`127.0.0.1:${STUDIO_PORT:-3900}` loopback
-only) publish ports — everything else stays on the internal network.
-
-Apps have **no `depends_on`** on data-plane services (keeps apps-only mode valid);
-boot order is enforced by `deploy.sh` / the README, not compose deps.
-
-## Reused from dev stack (bind-mounted, not copied)
-`packages/dev/docker/kong.yml` (→ kong), `packages/dev/docker/edge-main/`
-(→ edge-runtime main service), `packages/database/supabase/functions` +
-`packages/database/src` (→ edge-runtime). The dev compose itself now lives at
-`packages/dev/docker/docker-compose.dev.yml` (recently moved from repo root).
-
-## deploy/prod/deploy.sh (defensive bash, `set -euo pipefail`)
-Always runs `docker compose -f docker-compose.prod.yml --env-file .env.production`
-from repo root. Subcommands:
-- **`init [--force]`** — `cp .env.production.example .env.production`, then
- `upsert_env` (awk-based, GNU/BSD-portable) the generated values: Supabase key
- trio from `gen-supabase-keys.mjs`, `POSTGRES_PASSWORD` (`openssl rand -hex 24`),
- `SESSION_SECRET` (hex 32), `INNGEST_SIGNING_KEY` (hex 32), `INNGEST_EVENT_KEY`
- (hex 16), and `SUPABASE_DB_URL=postgresql://postgres:<pw>@postgres:5432/postgres?sslmode=disable`.
- Then warns to hand-edit `*_HOST`/`*_URL` + `ACME_EMAIL` + `RESEND_API_KEY` + SMTP.
-- **`up`** — ordered boot:
- 1. `dc build erp mes`
- 2. `dc --profile data up -d --wait postgres storage`
- 3. `dc --profile data run --rm migrate`
- 4. `dc --profile data up -d gotrue postgrest realtime meta studio kong edge-runtime redis inngest`
- 5. `dc up -d erp mes caddy`
-- **`migrate`** — re-run steps 2–3 only (postgres+storage wait, then migrate)
-- **`down [--volumes]`** — `down` (add `--volumes` to wipe all data)
-- **`status`** — `ps`; **`logs [service]`** — `logs -f`
-
-## Boot order (critical)
-postgres + storage → `migrate` → rest of data plane → apps. `storage-api` creates
-the `storage.*` schema on boot and an early migration `INSERT`s into
-`storage.buckets`, so `migrate` gates on **storage healthy** (storage has a
-`/status` node-fetch healthcheck) as well as postgres healthy.
-
-## Migration mechanism
-`migrate` runs the `carbon/erp:latest` image, cwd `/repo/packages/database`:
-`pnpm exec supabase migration up --include-all --db-url postgresql://supabase_admin:${POSTGRES_PASSWORD}@postgres:5432/postgres`.
-Mirrors the dev migration flow.
-
-## Gotchas
-- **postgres runs ssl=off.** The supabase CLI (pgx) only honors disable reliably
- via `PGSSLMODE=disable` env — the `?sslmode=disable` URL param is flaky. The
- `migrate` service sets `PGSSLMODE=disable` and **deliberately does NOT** load
- `.env.production` (env_file's `SUPABASE_DB_URL` would override `--db-url`).
-- **App DB client (node-postgres) DOES honor** `?sslmode=disable` in
- `SUPABASE_DB_URL` — keep it for self-host.
-- **ERP requires a non-empty `RESEND_API_KEY`.** `packages/lib/src/resend.server.ts`
- runs `new Resend(process.env.RESEND_API_KEY!)` at module load, so ERP crashes on
- boot if empty. Use a real key or a placeholder. MES has no such requirement.
-- **`INNGEST_SIGNING_KEY` must be plain even-length hex** (`openssl rand -hex 32`);
- the self-hosted inngest server rejects the `signkey-…` prefix. `deploy.sh init`
- generates plain hex. (The README's step-1 line suggesting `signkey-prod-<hex>`
- is internally inconsistent with deploy.sh and its own Notes section — trust the
- plain-hex form.)
-- **gotrue** `GOTRUE_EXTERNAL_{GOOGLE,AZURE}_ENABLED` are driven by
- `${GOOGLE_AUTH_ENABLED:-false}` / `${AZURE_AUTH_ENABLED:-false}` (must be
- `true`/`false`, never empty).
-- **studio** may report `unhealthy` (its image healthcheck expects the omitted
- Supabase analytics service); the UI still works. Reach it only via SSH tunnel
- to the loopback port.
-
-## App env hard-requirements (`packages/env/src/index.ts`)
-`getEnv(name)` with no options object defaults `isRequired: true` and throws
-`"${name} is not set"` if empty; passing an options object usually opts out. Bare
-(required) exports include `SUPABASE_SERVICE_ROLE_KEY`, `SESSION_SECRET`. Several
-others (`SUPABASE_DB_URL`, `REDIS_URL`, `INNGEST_SIGNING_KEY`) pass options.
-`RESEND_API_KEY` is read directly from `process.env` (not via `getEnv`).
-
-## /health
-`apps/{erp,mes}/app/routes/_public+/health.tsx` — used by the compose healthchecks
-(`curl -fsS http://localhost:3000/health`).
diff --git a/.claude/rules/sst-deployment-infrastructure.md b/.claude/rules/sst-deployment-infrastructure.md
index 1f8525850d..fb6a37ab71 100644
--- a/.claude/rules/sst-deployment-infrastructure.md
+++ b/.claude/rules/sst-deployment-infrastructure.md
@@ -1,5 +1,5 @@
---
-description: SST + AWS ECS production deployment path (sst.config.ts, ECR-built Docker images, CI workspace fan-out). The managed/cloud alternative to the self-hosted docker-compose.prod stack.
+description: SST + AWS ECS production deployment path (sst.config.ts, ECR-built Docker images, CI workspace fan-out). The managed/cloud alternative to the self-hosted Swarm stack.
paths:
- "sst.config.ts"
- "ci/**"
@@ -10,9 +10,9 @@ paths:
# SST / AWS ECS Deployment (managed cloud path)
SST is **still used** — it is the managed, multi-tenant cloud deployment path.
-The newer self-hosted `docker-compose.prod.yml` stack (see
-`production-docker-compose.md`) is a separate, alternative deployment, not a
-replacement. Both build from the same root `Dockerfile`.
+The self-hosted single-VPS Docker **Swarm** stack (see
+[contrib-deployment-swarm.md](contrib-deployment-swarm.md)) is a separate,
+alternative deployment, not a replacement. Both build from the same root `Dockerfile`.
## What SST deploys (`sst.config.ts`)
- App `carbon`, `home: "aws"`, region from `process.env.AWS_REGION` (no hardcoded
@@ -77,8 +77,8 @@ Triggers on push to `main` touching `apps/erp/**`, `apps/mes/**`, `packages/**`
## Migrations are a separate CI step
SST deploy does **not** run DB migrations. Migrations live in
`ci/src/migrations.ts` (script `ci:migrations`), a separate workspace fan-out over
-the `workspaces` table. (The self-host path uses the `migrate` compose service
-instead — see `production-docker-compose.md`.)
+the `workspaces` table. (The self-host path runs migrations as an ephemeral Swarm
+job instead — see [contrib-deployment-swarm.md](contrib-deployment-swarm.md).)
## Env vars passed to the services (`sst.config.ts` `environment`)
Both services get Supabase (`SUPABASE_URL`/`ANON_KEY`/`SERVICE_ROLE_KEY`/`JWT_SECRET`/
diff --git a/.dockerignore b/.dockerignore
index 589f4272d3..fb9513b198 100644
--- a/.dockerignore
+++ b/.dockerignore
@@ -1,9 +1,79 @@
+# Docker build-context excludes. Docker only reads the root .dockerignore (nested
+# ones are ignored), so everything that should stay out of the image lives here.
+# Merged + deduplicated from .gitignore plus Docker-specific entries.
-# sst
+# VCS / CI / project meta
+.git
+.github
+.husky
+
+# Dependencies & build output
+node_modules
+.turbo
+.cache
+dist
+dist-ssr
+build
+public/build
+public/dist
+server/dist
+.output
+.next
+.source
+.react-router
+.vercel
+.trigger
.sst
-llm
+*.tsbuildinfo
+api/index.js*
+api/_assets*
+vite.config.ts.timestamp*
+
+# Generated (rebuilt during the image build)
+packages/locale/locales/**/*.mjs
+docs/lib/api-data.generated.ts
+docs/lib/tools-data.generated.ts
+
+# Env / secrets — never bake into an image
+.env
+.envrc
+.env.local
+.env*.local
+.env.dev
+.env.development.local
+.env.test.local
+.env.prod
+.env.production
+.env.production.local
+packages/database/.env
+packages/database/supabase/seed.sql
+**/secrets/
+*.secret
+
+# Editor / tooling / agent scratch
.vscode
-.claude
.cursor
-examples
-docs
\ No newline at end of file
+.windsurf
+.idea
+.claude
+.claude-flow
+.superpowers
+.carbon-worktree
+.mcp.json
+opencode.json
+.pr-review
+
+# Rust / C++ (cad-engine) build artifacts
+**/target/
+**/*.rs.bk
+**/pkg/
+**/build/
+
+# Not needed inside the image
+docs
+contrib
+llm
+
+# OS / logs
+.DS_Store
+*.log
diff --git a/.gitignore b/.gitignore
index 8c47366bfc..331847332c 100644
--- a/.gitignore
+++ b/.gitignore
@@ -42,16 +42,12 @@ scripts/test-get-stripe-customer.ts
packages/database/.env
packages/database/supabase/seed.sql
-.vercel
.env*.local
-.react-router
-
# Rust
**/target/
**/*.rs.bk
**/pkg/
-**/pkg/
# C++ (cad-engine)
**/build/
diff --git a/biome.jsonc b/biome.jsonc
index e915483cec..ec8c472bd0 100644
--- a/biome.jsonc
+++ b/biome.jsonc
@@ -13,7 +13,7 @@
"!**/mcp*/lib/server.ts",
"**/*.json",
"!**/mcp*/lib/tool-metadata.json",
- "examples/**/*"
+ "contrib/building/examples/**/*"
]
},
"formatter": { "enabled": true, "indentStyle": "space", "indentWidth": 2 },
diff --git a/contrib/README.md b/contrib/README.md
new file mode 100644
index 0000000000..a908a772e2
--- /dev/null
+++ b/contrib/README.md
@@ -0,0 +1,13 @@
+# contrib
+
+Community-contributed, optional extras for Carbon — deployment recipes, examples,
+and tooling that live alongside the codebase but aren't part of the core apps.
+
+These are reference setups: read them, copy them, adapt them to your environment.
+They are not load-bearing for development (`crbn up`) or the managed cloud build.
+
+## Deployment
+
+| Recipe | What it does |
+|---|---|
+| [`deployment/simple-docker-caddy`](deployment/simple-docker-caddy) | Self-host the full stack (ERP + MES + Supabase + Redis + Inngest) on a **single Linux VPS** with a single-node **Docker Swarm** and an auto-HTTPS **Caddy** reverse proxy. Swarm secrets, host hardening, backups included. |
diff --git a/examples/README.md b/contrib/building/examples/README.md
similarity index 100%
rename from examples/README.md
rename to contrib/building/examples/README.md
diff --git a/examples/quote-configurator/.env b/contrib/building/examples/quote-configurator/.env
similarity index 100%
rename from examples/quote-configurator/.env
rename to contrib/building/examples/quote-configurator/.env
diff --git a/examples/quote-configurator/.eslintrc.mjs b/contrib/building/examples/quote-configurator/.eslintrc.mjs
similarity index 100%
rename from examples/quote-configurator/.eslintrc.mjs
rename to contrib/building/examples/quote-configurator/.eslintrc.mjs
diff --git a/examples/quote-configurator/.gitignore b/contrib/building/examples/quote-configurator/.gitignore
similarity index 100%
rename from examples/quote-configurator/.gitignore
rename to contrib/building/examples/quote-configurator/.gitignore
diff --git a/examples/quote-configurator/README.md b/contrib/building/examples/quote-configurator/README.md
similarity index 100%
rename from examples/quote-configurator/README.md
rename to contrib/building/examples/quote-configurator/README.md
diff --git a/examples/quote-configurator/app/components/ModelUpload.tsx b/contrib/building/examples/quote-configurator/app/components/ModelUpload.tsx
similarity index 100%
rename from examples/quote-configurator/app/components/ModelUpload.tsx
rename to contrib/building/examples/quote-configurator/app/components/ModelUpload.tsx
diff --git a/examples/quote-configurator/app/config.ts b/contrib/building/examples/quote-configurator/app/config.ts
similarity index 100%
rename from examples/quote-configurator/app/config.ts
rename to contrib/building/examples/quote-configurator/app/config.ts
diff --git a/examples/quote-configurator/app/entry.client.tsx b/contrib/building/examples/quote-configurator/app/entry.client.tsx
similarity index 100%
rename from examples/quote-configurator/app/entry.client.tsx
rename to contrib/building/examples/quote-configurator/app/entry.client.tsx
diff --git a/examples/quote-configurator/app/entry.server.tsx b/contrib/building/examples/quote-configurator/app/entry.server.tsx
similarity index 100%
rename from examples/quote-configurator/app/entry.server.tsx
rename to contrib/building/examples/quote-configurator/app/entry.server.tsx
diff --git a/examples/quote-configurator/app/lib/carbon.server.ts b/contrib/building/examples/quote-configurator/app/lib/carbon.server.ts
similarity index 100%
rename from examples/quote-configurator/app/lib/carbon.server.ts
rename to contrib/building/examples/quote-configurator/app/lib/carbon.server.ts
diff --git a/examples/quote-configurator/app/root.tsx b/contrib/building/examples/quote-configurator/app/root.tsx
similarity index 100%
rename from examples/quote-configurator/app/root.tsx
rename to contrib/building/examples/quote-configurator/app/root.tsx
diff --git a/examples/quote-configurator/app/routes.ts b/contrib/building/examples/quote-configurator/app/routes.ts
similarity index 100%
rename from examples/quote-configurator/app/routes.ts
rename to contrib/building/examples/quote-configurator/app/routes.ts
diff --git a/examples/quote-configurator/app/routes/_index.tsx b/contrib/building/examples/quote-configurator/app/routes/_index.tsx
similarity index 100%
rename from examples/quote-configurator/app/routes/_index.tsx
rename to contrib/building/examples/quote-configurator/app/routes/_index.tsx
diff --git a/examples/quote-configurator/app/styles/tailwind.css b/contrib/building/examples/quote-configurator/app/styles/tailwind.css
similarity index 100%
rename from examples/quote-configurator/app/styles/tailwind.css
rename to contrib/building/examples/quote-configurator/app/styles/tailwind.css
diff --git a/examples/quote-configurator/env.d.ts b/contrib/building/examples/quote-configurator/env.d.ts
similarity index 100%
rename from examples/quote-configurator/env.d.ts
rename to contrib/building/examples/quote-configurator/env.d.ts
diff --git a/examples/quote-configurator/package.json b/contrib/building/examples/quote-configurator/package.json
similarity index 100%
rename from examples/quote-configurator/package.json
rename to contrib/building/examples/quote-configurator/package.json
diff --git a/examples/quote-configurator/public/android-chrome-192x192.png b/contrib/building/examples/quote-configurator/public/android-chrome-192x192.png
similarity index 100%
rename from examples/quote-configurator/public/android-chrome-192x192.png
rename to contrib/building/examples/quote-configurator/public/android-chrome-192x192.png
diff --git a/examples/quote-configurator/public/android-chrome-512x512.png b/contrib/building/examples/quote-configurator/public/android-chrome-512x512.png
similarity index 100%
rename from examples/quote-configurator/public/android-chrome-512x512.png
rename to contrib/building/examples/quote-configurator/public/android-chrome-512x512.png
diff --git a/examples/quote-configurator/public/apple-touch-icon.png b/contrib/building/examples/quote-configurator/public/apple-touch-icon.png
similarity index 100%
rename from examples/quote-configurator/public/apple-touch-icon.png
rename to contrib/building/examples/quote-configurator/public/apple-touch-icon.png
diff --git a/examples/quote-configurator/public/carbon-mark-dark.svg b/contrib/building/examples/quote-configurator/public/carbon-mark-dark.svg
similarity index 100%
rename from examples/quote-configurator/public/carbon-mark-dark.svg
rename to contrib/building/examples/quote-configurator/public/carbon-mark-dark.svg
diff --git a/examples/quote-configurator/public/carbon-mark-light.svg b/contrib/building/examples/quote-configurator/public/carbon-mark-light.svg
similarity index 100%
rename from examples/quote-configurator/public/carbon-mark-light.svg
rename to contrib/building/examples/quote-configurator/public/carbon-mark-light.svg
diff --git a/examples/quote-configurator/public/carbon-word-dark.svg b/contrib/building/examples/quote-configurator/public/carbon-word-dark.svg
similarity index 100%
rename from examples/quote-configurator/public/carbon-word-dark.svg
rename to contrib/building/examples/quote-configurator/public/carbon-word-dark.svg
diff --git a/examples/quote-configurator/public/carbon-word-light.svg b/contrib/building/examples/quote-configurator/public/carbon-word-light.svg
similarity index 100%
rename from examples/quote-configurator/public/carbon-word-light.svg
rename to contrib/building/examples/quote-configurator/public/carbon-word-light.svg
diff --git a/examples/quote-configurator/public/favicon-16x16.png b/contrib/building/examples/quote-configurator/public/favicon-16x16.png
similarity index 100%
rename from examples/quote-configurator/public/favicon-16x16.png
rename to contrib/building/examples/quote-configurator/public/favicon-16x16.png
diff --git a/examples/quote-configurator/public/favicon-32x32.png b/contrib/building/examples/quote-configurator/public/favicon-32x32.png
similarity index 100%
rename from examples/quote-configurator/public/favicon-32x32.png
rename to contrib/building/examples/quote-configurator/public/favicon-32x32.png
diff --git a/examples/quote-configurator/public/favicon.ico b/contrib/building/examples/quote-configurator/public/favicon.ico
similarity index 100%
rename from examples/quote-configurator/public/favicon.ico
rename to contrib/building/examples/quote-configurator/public/favicon.ico
diff --git a/examples/quote-configurator/public/favicon.svg b/contrib/building/examples/quote-configurator/public/favicon.svg
similarity index 100%
rename from examples/quote-configurator/public/favicon.svg
rename to contrib/building/examples/quote-configurator/public/favicon.svg
diff --git a/examples/quote-configurator/public/grid.svg b/contrib/building/examples/quote-configurator/public/grid.svg
similarity index 100%
rename from examples/quote-configurator/public/grid.svg
rename to contrib/building/examples/quote-configurator/public/grid.svg
diff --git a/examples/quote-configurator/public/serviceWorker.js b/contrib/building/examples/quote-configurator/public/serviceWorker.js
similarity index 100%
rename from examples/quote-configurator/public/serviceWorker.js
rename to contrib/building/examples/quote-configurator/public/serviceWorker.js
diff --git a/examples/quote-configurator/public/site.webmanifest b/contrib/building/examples/quote-configurator/public/site.webmanifest
similarity index 100%
rename from examples/quote-configurator/public/site.webmanifest
rename to contrib/building/examples/quote-configurator/public/site.webmanifest
diff --git a/examples/quote-configurator/react-router.config.ts b/contrib/building/examples/quote-configurator/react-router.config.ts
similarity index 100%
rename from examples/quote-configurator/react-router.config.ts
rename to contrib/building/examples/quote-configurator/react-router.config.ts
diff --git a/examples/quote-configurator/sst-env.d.ts b/contrib/building/examples/quote-configurator/sst-env.d.ts
similarity index 72%
rename from examples/quote-configurator/sst-env.d.ts
rename to contrib/building/examples/quote-configurator/sst-env.d.ts
index 8dab95c6d9..c7e2ebf5d3 100644
--- a/examples/quote-configurator/sst-env.d.ts
+++ b/contrib/building/examples/quote-configurator/sst-env.d.ts
@@ -3,7 +3,7 @@
/* deno-fmt-ignore-file */
-/// <reference path="../../sst-env.d.ts" />
+/// <reference path="../../../../sst-env.d.ts" />
import "sst";
export {};
diff --git a/examples/quote-configurator/tsconfig.json b/contrib/building/examples/quote-configurator/tsconfig.json
similarity index 85%
rename from examples/quote-configurator/tsconfig.json
rename to contrib/building/examples/quote-configurator/tsconfig.json
index 1fd01a1b9a..2b22fdfcc9 100644
--- a/examples/quote-configurator/tsconfig.json
+++ b/contrib/building/examples/quote-configurator/tsconfig.json
@@ -3,8 +3,7 @@
"env.d.ts",
"**/*.ts",
"**/*.tsx",
- "app/modules/documents/documents.service.ts",
- "../carbon/app/components/Breadcrumb.tsx"
+ "app/modules/documents/documents.service.ts"
],
"compilerOptions": {
"lib": ["dom", "dom.iterable", "ESNext"],
diff --git a/examples/quote-configurator/vite.config.ts b/contrib/building/examples/quote-configurator/vite.config.ts
similarity index 100%
rename from examples/quote-configurator/vite.config.ts
rename to contrib/building/examples/quote-configurator/vite.config.ts
diff --git a/examples/upload-3d-model/.env b/contrib/building/examples/upload-3d-model/.env
similarity index 100%
rename from examples/upload-3d-model/.env
rename to contrib/building/examples/upload-3d-model/.env
diff --git a/examples/upload-3d-model/.eslintrc.mjs b/contrib/building/examples/upload-3d-model/.eslintrc.mjs
similarity index 100%
rename from examples/upload-3d-model/.eslintrc.mjs
rename to contrib/building/examples/upload-3d-model/.eslintrc.mjs
diff --git a/examples/upload-3d-model/.gitignore b/contrib/building/examples/upload-3d-model/.gitignore
similarity index 100%
rename from examples/upload-3d-model/.gitignore
rename to contrib/building/examples/upload-3d-model/.gitignore
diff --git a/examples/upload-3d-model/README.md b/contrib/building/examples/upload-3d-model/README.md
similarity index 100%
rename from examples/upload-3d-model/README.md
rename to contrib/building/examples/upload-3d-model/README.md
diff --git a/examples/upload-3d-model/app/components/ModelUpload.tsx b/contrib/building/examples/upload-3d-model/app/components/ModelUpload.tsx
similarity index 100%
rename from examples/upload-3d-model/app/components/ModelUpload.tsx
rename to contrib/building/examples/upload-3d-model/app/components/ModelUpload.tsx
diff --git a/examples/upload-3d-model/app/config.ts b/contrib/building/examples/upload-3d-model/app/config.ts
similarity index 100%
rename from examples/upload-3d-model/app/config.ts
rename to contrib/building/examples/upload-3d-model/app/config.ts
diff --git a/examples/upload-3d-model/app/entry.client.tsx b/contrib/building/examples/upload-3d-model/app/entry.client.tsx
similarity index 100%
rename from examples/upload-3d-model/app/entry.client.tsx
rename to contrib/building/examples/upload-3d-model/app/entry.client.tsx
diff --git a/examples/upload-3d-model/app/entry.server.tsx b/contrib/building/examples/upload-3d-model/app/entry.server.tsx
similarity index 100%
rename from examples/upload-3d-model/app/entry.server.tsx
rename to contrib/building/examples/upload-3d-model/app/entry.server.tsx
diff --git a/examples/upload-3d-model/app/lib/carbon.server.ts b/contrib/building/examples/upload-3d-model/app/lib/carbon.server.ts
similarity index 100%
rename from examples/upload-3d-model/app/lib/carbon.server.ts
rename to contrib/building/examples/upload-3d-model/app/lib/carbon.server.ts
diff --git a/examples/upload-3d-model/app/root.tsx b/contrib/building/examples/upload-3d-model/app/root.tsx
similarity index 100%
rename from examples/upload-3d-model/app/root.tsx
rename to contrib/building/examples/upload-3d-model/app/root.tsx
diff --git a/examples/upload-3d-model/app/routes.ts b/contrib/building/examples/upload-3d-model/app/routes.ts
similarity index 100%
rename from examples/upload-3d-model/app/routes.ts
rename to contrib/building/examples/upload-3d-model/app/routes.ts
diff --git a/examples/upload-3d-model/app/routes/_index.tsx b/contrib/building/examples/upload-3d-model/app/routes/_index.tsx
similarity index 100%
rename from examples/upload-3d-model/app/routes/_index.tsx
rename to contrib/building/examples/upload-3d-model/app/routes/_index.tsx
diff --git a/examples/upload-3d-model/app/styles/tailwind.css b/contrib/building/examples/upload-3d-model/app/styles/tailwind.css
similarity index 100%
rename from examples/upload-3d-model/app/styles/tailwind.css
rename to contrib/building/examples/upload-3d-model/app/styles/tailwind.css
diff --git a/examples/upload-3d-model/env.d.ts b/contrib/building/examples/upload-3d-model/env.d.ts
similarity index 100%
rename from examples/upload-3d-model/env.d.ts
rename to contrib/building/examples/upload-3d-model/env.d.ts
diff --git a/examples/upload-3d-model/package.json b/contrib/building/examples/upload-3d-model/package.json
similarity index 100%
rename from examples/upload-3d-model/package.json
rename to contrib/building/examples/upload-3d-model/package.json
diff --git a/examples/upload-3d-model/public/android-chrome-192x192.png b/contrib/building/examples/upload-3d-model/public/android-chrome-192x192.png
similarity index 100%
rename from examples/upload-3d-model/public/android-chrome-192x192.png
rename to contrib/building/examples/upload-3d-model/public/android-chrome-192x192.png
diff --git a/examples/upload-3d-model/public/android-chrome-512x512.png b/contrib/building/examples/upload-3d-model/public/android-chrome-512x512.png
similarity index 100%
rename from examples/upload-3d-model/public/android-chrome-512x512.png
rename to contrib/building/examples/upload-3d-model/public/android-chrome-512x512.png
diff --git a/examples/upload-3d-model/public/apple-touch-icon.png b/contrib/building/examples/upload-3d-model/public/apple-touch-icon.png
similarity index 100%
rename from examples/upload-3d-model/public/apple-touch-icon.png
rename to contrib/building/examples/upload-3d-model/public/apple-touch-icon.png
diff --git a/examples/upload-3d-model/public/carbon-mark-dark.svg b/contrib/building/examples/upload-3d-model/public/carbon-mark-dark.svg
similarity index 100%
rename from examples/upload-3d-model/public/carbon-mark-dark.svg
rename to contrib/building/examples/upload-3d-model/public/carbon-mark-dark.svg
diff --git a/examples/upload-3d-model/public/carbon-mark-light.svg b/contrib/building/examples/upload-3d-model/public/carbon-mark-light.svg
similarity index 100%
rename from examples/upload-3d-model/public/carbon-mark-light.svg
rename to contrib/building/examples/upload-3d-model/public/carbon-mark-light.svg
diff --git a/examples/upload-3d-model/public/carbon-word-dark.svg b/contrib/building/examples/upload-3d-model/public/carbon-word-dark.svg
similarity index 100%
rename from examples/upload-3d-model/public/carbon-word-dark.svg
rename to contrib/building/examples/upload-3d-model/public/carbon-word-dark.svg
diff --git a/examples/upload-3d-model/public/carbon-word-light.svg b/contrib/building/examples/upload-3d-model/public/carbon-word-light.svg
similarity index 100%
rename from examples/upload-3d-model/public/carbon-word-light.svg
rename to contrib/building/examples/upload-3d-model/public/carbon-word-light.svg
diff --git a/examples/upload-3d-model/public/favicon-16x16.png b/contrib/building/examples/upload-3d-model/public/favicon-16x16.png
similarity index 100%
rename from examples/upload-3d-model/public/favicon-16x16.png
rename to contrib/building/examples/upload-3d-model/public/favicon-16x16.png
diff --git a/examples/upload-3d-model/public/favicon-32x32.png b/contrib/building/examples/upload-3d-model/public/favicon-32x32.png
similarity index 100%
rename from examples/upload-3d-model/public/favicon-32x32.png
rename to contrib/building/examples/upload-3d-model/public/favicon-32x32.png
diff --git a/examples/upload-3d-model/public/favicon.ico b/contrib/building/examples/upload-3d-model/public/favicon.ico
similarity index 100%
rename from examples/upload-3d-model/public/favicon.ico
rename to contrib/building/examples/upload-3d-model/public/favicon.ico
diff --git a/examples/upload-3d-model/public/favicon.svg b/contrib/building/examples/upload-3d-model/public/favicon.svg
similarity index 100%
rename from examples/upload-3d-model/public/favicon.svg
rename to contrib/building/examples/upload-3d-model/public/favicon.svg
diff --git a/examples/upload-3d-model/public/grid.svg b/contrib/building/examples/upload-3d-model/public/grid.svg
similarity index 100%
rename from examples/upload-3d-model/public/grid.svg
rename to contrib/building/examples/upload-3d-model/public/grid.svg
diff --git a/examples/upload-3d-model/public/serviceWorker.js b/contrib/building/examples/upload-3d-model/public/serviceWorker.js
similarity index 100%
rename from examples/upload-3d-model/public/serviceWorker.js
rename to contrib/building/examples/upload-3d-model/public/serviceWorker.js
diff --git a/examples/upload-3d-model/public/site copy.webmanifest b/contrib/building/examples/upload-3d-model/public/site copy.webmanifest
similarity index 100%
rename from examples/upload-3d-model/public/site copy.webmanifest
rename to contrib/building/examples/upload-3d-model/public/site copy.webmanifest
diff --git a/examples/upload-3d-model/public/site.webmanifest b/contrib/building/examples/upload-3d-model/public/site.webmanifest
similarity index 100%
rename from examples/upload-3d-model/public/site.webmanifest
rename to contrib/building/examples/upload-3d-model/public/site.webmanifest
diff --git a/examples/upload-3d-model/react-router.config.ts b/contrib/building/examples/upload-3d-model/react-router.config.ts
similarity index 100%
rename from examples/upload-3d-model/react-router.config.ts
rename to contrib/building/examples/upload-3d-model/react-router.config.ts
diff --git a/examples/upload-3d-model/sst-env.d.ts b/contrib/building/examples/upload-3d-model/sst-env.d.ts
similarity index 72%
rename from examples/upload-3d-model/sst-env.d.ts
rename to contrib/building/examples/upload-3d-model/sst-env.d.ts
index 8dab95c6d9..c7e2ebf5d3 100644
--- a/examples/upload-3d-model/sst-env.d.ts
+++ b/contrib/building/examples/upload-3d-model/sst-env.d.ts
@@ -3,7 +3,7 @@
/* deno-fmt-ignore-file */
-/// <reference path="../../sst-env.d.ts" />
+/// <reference path="../../../../sst-env.d.ts" />
import "sst";
export {};
diff --git a/examples/upload-3d-model/tsconfig.json b/contrib/building/examples/upload-3d-model/tsconfig.json
similarity index 85%
rename from examples/upload-3d-model/tsconfig.json
rename to contrib/building/examples/upload-3d-model/tsconfig.json
index 1fd01a1b9a..2b22fdfcc9 100644
--- a/examples/upload-3d-model/tsconfig.json
+++ b/contrib/building/examples/upload-3d-model/tsconfig.json
@@ -3,8 +3,7 @@
"env.d.ts",
"**/*.ts",
"**/*.tsx",
- "app/modules/documents/documents.service.ts",
- "../carbon/app/components/Breadcrumb.tsx"
+ "app/modules/documents/documents.service.ts"
],
"compilerOptions": {
"lib": ["dom", "dom.iterable", "ESNext"],
diff --git a/examples/upload-3d-model/vite.config.ts b/contrib/building/examples/upload-3d-model/vite.config.ts
similarity index 100%
rename from examples/upload-3d-model/vite.config.ts
rename to contrib/building/examples/upload-3d-model/vite.config.ts
diff --git a/contrib/deploying/simple-docker-caddy/.env.example b/contrib/deploying/simple-docker-caddy/.env.example
new file mode 100644
index 0000000000..c7d1582cbd
--- /dev/null
+++ b/contrib/deploying/simple-docker-caddy/.env.example
@@ -0,0 +1,83 @@
+###############################################################################
+# Carbon Swarm stack — NON-SECRET configuration.
+#
+# Copy to `.env` and fill in. `deploy.sh` sources this and exports it so
+# `docker stack deploy` can interpolate ${VARS} in stack.yml. Secrets do NOT live
+# here — they are Docker Swarm secrets created by `deploy.sh init` (see README).
+###############################################################################
+
+# Absolute path to the Carbon repo checkout on this VPS. Config files and edge
+# functions are bind-mounted from here, and the app images are built from it.
+CARBON_REPO=/opt/carbon
+
+# Swarm stack name (prefix for services/networks/volumes).
+STACK_NAME=carbon
+
+# ── Hostnames (must have DNS A/AAAA records pointing at this VPS) ─────────────
+DOMAIN=example.com
+ERP_HOST=erp.example.com
+MES_HOST=mes.example.com
+SUPABASE_HOST=api.example.com
+# Optional Supabase Studio host — only if you uncomment the studio block in the
+# Caddyfile. Leave blank to keep Studio internal-only (recommended).
+STUDIO_HOST=
+
+# Public URLs (https:// + the hosts above). Used by the apps and GoTrue.
+ERP_URL=https://erp.example.com
+MES_URL=https://mes.example.com
+SUPABASE_URL=https://api.example.com
+
+# Email for Let's Encrypt / ACME registration.
+
+# ── App config ───────────────────────────────────────────────────────────────
+CARBON_EDITION=community
+RESEND_DOMAIN=example.com
+
+# ── Container images ─────────────────────────────────────────────────────────
+# Default: build locally on the VPS (`deploy.sh build`) tagging carbon/<app>:latest.
+# To pull prebuilt images instead, set CARBON_REGISTRY and the tags, and run
+# `deploy.sh build` will skip building when CARBON_REGISTRY is set.
+CARBON_REGISTRY=
+CARBON_IMAGE_ERP=carbon/erp:latest
+CARBON_IMAGE_MES=carbon/mes:latest
+
+# ── Outbound email (GoTrue auth: invites, magic links) ───────────────────────
+# The SMTP password is a Docker secret (`smtp_password`), not set here.
+GOTRUE_SMTP_HOST=
+GOTRUE_SMTP_PORT=587
+GOTRUE_SMTP_USER=
+GOTRUE_SMTP_SENDER_NAME=Carbon
+GOTRUE_DISABLE_SIGNUP=true
+
+# ── OAuth (optional; leave disabled unless configured) ───────────────────────
+GOOGLE_AUTH_ENABLED=false
+SUPABASE_AUTH_EXTERNAL_GOOGLE_CLIENT_ID=
+SUPABASE_AUTH_EXTERNAL_GOOGLE_CLIENT_SECRET=
+SUPABASE_AUTH_EXTERNAL_GOOGLE_REDIRECT_URI=
+AZURE_AUTH_ENABLED=false
+SUPABASE_AUTH_EXTERNAL_AZURE_CLIENT_ID=
+SUPABASE_AUTH_EXTERNAL_AZURE_CLIENT_SECRET=
+SUPABASE_AUTH_EXTERNAL_AZURE_REDIRECT_URI=
+
+# ── Supabase Studio ──────────────────────────────────────────────────────────
+# Set to 0 to not run the admin UI at all.
+STUDIO_REPLICAS=1
+
+# ── Postgres tuning (size to your VPS; see postgres/02-performance.sh) ────────
+# Rules of thumb: shared_buffers ~25% RAM, effective_cache_size ~50-75% RAM,
+# work_mem * max_connections under ~25% RAM. Defaults suit a ~4 GB host.
+PG_MEMORY_LIMIT=2048M
+PG_MAX_CONNECTIONS=100
+PG_SHARED_BUFFERS=512MB
+PG_EFFECTIVE_CACHE_SIZE=1536MB
+PG_WORK_MEM=8MB
+PG_MAINTENANCE_WORK_MEM=128MB
+
+# ── Realtime (internal keys; override for extra hygiene) ──────────────────────
+REALTIME_SECRET_KEY_BASE=
+REALTIME_DB_ENC_KEY=
+
+# ── Edge functions ───────────────────────────────────────────────────────────
+EDGE_VERIFY_JWT=false
diff --git a/contrib/deploying/simple-docker-caddy/.gitignore b/contrib/deploying/simple-docker-caddy/.gitignore
new file mode 100644
index 0000000000..8bc8e1eeb7
--- /dev/null
+++ b/contrib/deploying/simple-docker-caddy/.gitignore
@@ -0,0 +1,9 @@
+# Local, filled-in config — never commit.
+.env
+
+# Any local secret material staged before `docker secret create`.
+secrets/
+*.secret
+
+# Local backups produced by scripts/backup.sh.
+backups/
diff --git a/contrib/deploying/simple-docker-caddy/Caddyfile b/contrib/deploying/simple-docker-caddy/Caddyfile
new file mode 100644
index 0000000000..696bb17fb7
--- /dev/null
+++ b/contrib/deploying/simple-docker-caddy/Caddyfile
@@ -0,0 +1,60 @@
+# Carbon — production reverse proxy (Caddy v2). Automatic HTTPS via Let's Encrypt.
+# Hostnames + ACME email are read from the container environment ({$VAR}), set in
+# the `caddy` service in stack.yml. https://caddyserver.com/docs/caddyfile
+#
+# DNS A/AAAA records for each host must point at this VPS and :80/:443 must be
+# reachable for the ACME challenge.
+
+{
+ email {$ACME_EMAIL}
+ # Trust the Swarm ingress network so client IPs in logs/rate-limits are real.
+ servers {
+ trusted_proxies static private_ranges
+ }
+}
+
+# Reusable hardening + compression for every site.
+(common) {
+ encode zstd gzip
+ header {
+ # HSTS (1 year). Remove if you serve sub-domains without HTTPS.
+ Strict-Transport-Security "max-age=31536000; includeSubDomains"
+ X-Content-Type-Options "nosniff"
+ Referrer-Policy "strict-origin-when-cross-origin"
+ # Caddy sets its own; don't leak the version.
+ -Server
+ }
+}
+
+# ─────────────────────────────── ERP ────────────────────────────────────────
+{$ERP_HOST} {
+ import common
+ reverse_proxy erp:3000
+}
+
+# ─────────────────────────────── MES ────────────────────────────────────────
+{$MES_HOST} {
+ import common
+ reverse_proxy mes:3000
+}
+
+# ─────────── Supabase API gateway (kong): auth, REST, storage, realtime, fns ──
+# Realtime uses WebSockets — Caddy's reverse_proxy upgrades them transparently.
+{$SUPABASE_HOST} {
+ import common
+ reverse_proxy kong:8000
+}
+
+# ───────────────────── Supabase Studio (DB admin UI) — OPTIONAL ──────────────
+# Studio has no auth of its own. Keep it OFF by default; reach the database via
+# `ssh` + `docker exec ... psql`. If you must expose it, set STUDIO_HOST in .env,
+# generate a bcrypt hash with `docker run --rm caddy:2-alpine caddy hash-password`,
+# paste it below, and uncomment this block. Prefer also restricting by source IP.
+#
+# {$STUDIO_HOST} {
+# import common
+# basic_auth {
+# admin <PASTE_BCRYPT_HASH_HERE>
+# }
+# reverse_proxy studio:3000
+# }
diff --git a/contrib/deploying/simple-docker-caddy/README.md b/contrib/deploying/simple-docker-caddy/README.md
new file mode 100644
index 0000000000..d2879657f3
--- /dev/null
+++ b/contrib/deploying/simple-docker-caddy/README.md
@@ -0,0 +1,34 @@
+# Carbon on a single VPS — Docker Swarm + Caddy
+
+Self-host the full Carbon stack (ERP + MES + Supabase + Redis + Inngest) on **one
+Linux VPS** as a single-node [Docker Swarm](https://docs.docker.com/engine/swarm/)
+behind an automatic-HTTPS [Caddy](https://caddyserver.com/docs/) reverse proxy.
+Secrets are real Docker Swarm secrets; only ports 80/443 are exposed.
+
+## 📖 Full guide → [docs.carbon.ms/docs/platform/self-hosting/docker-caddy](https://docs.carbon.ms/docs/platform/self-hosting/docker-caddy)
+
+Prerequisites, step-by-step install, how secrets work, operations, and the
+production checklist all live in the docs. Quick version:
+
+```bash
+sudo ./scripts/harden.sh # firewall, fail2ban, swap (optional, recommended)
+./deploy.sh init # swarm init + generate Docker secrets + .env
+$EDITOR .env # hosts, URLs, ACME email, SMTP
+./deploy.sh up # build + deploy + migrate
+./deploy.sh status
+```
+
+## Files
+
+| File | Purpose |
+|---|---|
+| `stack.yml` | The Swarm stack (all services, secrets, volumes, overlay network). |
+| `deploy.sh` | Lifecycle: `init` / `build` / `deploy` / `up` / `migrate` / `secret` / `status` / `logs` / `down`. |
+| `Caddyfile` | Reverse proxy: erp/mes/api + security headers; optional Studio behind basic-auth. |
+| `bin/secrets-entrypoint.sh` | Injects Swarm secrets into env (`__SECRET__` placeholders) for each service. |
+| `postgres/01-roles.sh` | Supabase role bootstrap. |
+| `postgres/02-performance.sh` | Postgres tuning + `pg_stat_statements`. |
+| `scripts/gen-supabase-keys.mjs` | Generates the Supabase JWT key trio. |
+| `scripts/harden.sh` | Host hardening (UFW, fail2ban, swap, unattended-upgrades). |
+| `scripts/backup.sh` | Postgres dump + storage volume archive. |
+| `.env.example` | Non-secret configuration template. |
diff --git a/contrib/deploying/simple-docker-caddy/bin/secrets-entrypoint.sh b/contrib/deploying/simple-docker-caddy/bin/secrets-entrypoint.sh
new file mode 100755
index 0000000000..d2602e2bcd
--- /dev/null
+++ b/contrib/deploying/simple-docker-caddy/bin/secrets-entrypoint.sh
@@ -0,0 +1,67 @@
+#!/bin/sh
+# Carbon — Docker Swarm secrets shim.
+#
+# Docker Swarm delivers secrets as files under /run/secrets/<name>, but the
+# Supabase images (and the Carbon apps) only read configuration from environment
+# variables — several of them Postgres connection strings that *embed* the
+# password. This shim bridges the two: for every environment variable whose value
+# contains a `__SECRET_NAME__` placeholder, it substitutes the literal contents of
+# the matching /run/secrets/<secret_name> file, then exec()s the original
+# container command unchanged.
+#
+# Example:
+# secret file : /run/secrets/postgres_password -> "s3cr3t"
+# env in stack: PGRST_DB_URI=postgres://authenticator:__POSTGRES_PASSWORD__@postgres:5432/postgres
+# env at exec : PGRST_DB_URI=postgres://authenticator:s3cr3t@postgres:5432/postgres
+#
+# Placeholder = the secret's file name, upper-cased, wrapped in double underscores
+# (`postgres_password` -> `__POSTGRES_PASSWORD__`). Substitution is *literal*
+# (awk index/substr, not regex), so secret values may safely contain / + = & \ etc.
+# Assumption: secret values are single-line (everything deploy.sh generates is).
+#
+# Used as `entrypoint:` on every service that consumes a secret. POSIX sh + awk
+# only — verified present in all pinned images.
+set -eu
+
+SECRETS_DIR="${CARBON_SECRETS_DIR:-/run/secrets}"
+
+if [ -d "$SECRETS_DIR" ]; then
+ # Emit `export NAME='value'` lines for each env var that had a placeholder
+ # resolved, then eval them into this shell before exec.
+ eval "$(
+ awk -v dir="$SECRETS_DIR" '
+ function shquote(s, q) { q = sprintf("%c", 39); gsub(q, q "\\" q q, s); return q s q }
+ BEGIN {
+ # Load secrets: UPPER_CASE(filename) -> first line of file.
+ cmd = "ls -1 " dir " 2>/dev/null"
+ while ((cmd | getline fn) > 0) {
+ path = dir "/" fn
+ val = ""
+ if ((getline line < path) > 0) val = line
+ close(path)
+ key = toupper(fn)
+ gsub(/[^A-Z0-9_]/, "_", key)
+ secret[key] = val
+ }
+ close(cmd)
+
+ # Substitute __KEY__ placeholders in every environment variable.
+ for (name in ENVIRON) {
+ v = ENVIRON[name]
+ if (v !~ /__[A-Z0-9_]+__/) continue
+ out = ""; rest = v
+ while (match(rest, /__[A-Z0-9_]+__/)) {
+ ph = substr(rest, RSTART, RLENGTH)
+ k = substr(ph, 3, length(ph) - 4)
+ rep = (k in secret) ? secret[k] : ph
+ out = out substr(rest, 1, RSTART - 1) rep
+ rest = substr(rest, RSTART + RLENGTH)
+ }
+ print "export " name "=" shquote(out rest)
+ }
+ }
+ '
+ )"
+fi
+
+exec "$@"
diff --git a/contrib/deploying/simple-docker-caddy/deploy.sh b/contrib/deploying/simple-docker-caddy/deploy.sh
new file mode 100755
index 0000000000..5c0eaa7381
--- /dev/null
+++ b/contrib/deploying/simple-docker-caddy/deploy.sh
@@ -0,0 +1,246 @@
+#!/usr/bin/env bash
+#
+# Carbon — single-VPS Docker Swarm deploy helper.
+#
+# Wraps the Swarm stack: bootstraps secrets, builds the app images, deploys the
+# stack, and runs DB migrations in the correct order. See README.md.
+#
+# Usage:
+# ./deploy.sh init [--force] # swarm init + create Docker secrets + .env
+# ./deploy.sh build # build erp+mes images on this host
+# ./deploy.sh deploy # docker stack deploy
+# ./deploy.sh up # build + deploy + wait + migrate (one shot)
+# ./deploy.sh migrate # (re)apply DB migrations only
+# ./deploy.sh secret <name> # create/rotate one secret from stdin
+# ./deploy.sh status # services + tasks
+# ./deploy.sh logs <service> # follow a service's logs (e.g. erp, caddy)
+# ./deploy.sh down [--volumes] # remove the stack (--volumes also wipes data)
+#
+set -euo pipefail
+
+readonly SCRIPT_NAME=$(basename "$0")
+readonly HERE=$(cd "$(dirname "$0")" && pwd)
+readonly STACK_FILE="$HERE/stack.yml"
+readonly ENV_FILE="$HERE/.env"
+readonly ENV_EXAMPLE="$HERE/.env.example"
+
+# Secrets generated by `init` (value auto-created) vs. supplied by the operator.
+readonly GENERATED_SECRETS="postgres_password session_secret inngest_signing_key inngest_event_key"
+readonly TRIO_SECRETS="jwt_secret anon_key service_role_key"
+readonly SUPPLIED_SECRETS="resend_api_key smtp_password"
+
+log() { printf '\033[0;36m[%s]\033[0m %s\n' "$(date '+%H:%M:%S')" "$*"; }
+warn() { printf '\033[0;33m[warn]\033[0m %s\n' "$*" >&2; }
+error() { printf '\033[0;31m[error]\033[0m %s\n' "$*" >&2; exit 1; }
+
+require_cmds() {
+ local missing=()
+ for c in "$@"; do command -v "$c" >/dev/null 2>&1 || missing+=("$c"); done
+ [ ${#missing[@]} -eq 0 ] || error "missing required command(s): ${missing[*]}"
+}
+
+load_env() {
+ [ -f "$ENV_FILE" ] || error ".env not found — run '$SCRIPT_NAME init' first"
+ set -a; . "$ENV_FILE"; set +a
+ : "${CARBON_REPO:?CARBON_REPO must be set in .env}"
+ : "${STACK_NAME:?STACK_NAME must be set in .env}"
+ [ -f "$CARBON_REPO/Dockerfile" ] || error "CARBON_REPO=$CARBON_REPO is not a Carbon checkout (no Dockerfile)"
+}
+
+swarm_active() { [ "$(docker info --format '{{.Swarm.LocalNodeState}}' 2>/dev/null)" = "active" ]; }
+secret_exists() { docker secret inspect "$1" >/dev/null 2>&1; }
+create_secret() { printf '%s' "$2" | docker secret create "$1" - >/dev/null && log "secret '$1' created"; }
+
+# ── init ──────────────────────────────────────────────────────────────────────
+cmd_init() {
+ require_cmds docker node openssl
+ local force=0; [ "${1:-}" = "--force" ] && force=1
+
+ swarm_active || { log "Initializing Docker Swarm"; docker swarm init >/dev/null; }
+
+ if [ ! -f "$ENV_FILE" ]; then
+ log "Creating .env from .env.example — edit it before deploying"
+ cp "$ENV_EXAMPLE" "$ENV_FILE"
+ fi
+
+ # Bind-mounted scripts must be executable on the host.
+ chmod +x "$HERE/bin/secrets-entrypoint.sh" "$HERE/postgres/"*.sh
+
+ log "Creating Docker secrets (skipping any that already exist)"
+ local s
+ for s in $GENERATED_SECRETS; do
+ if secret_exists "$s" && [ "$force" -ne 1 ]; then log "secret '$s' exists — skip"; continue; fi
+ secret_exists "$s" && docker secret rm "$s" >/dev/null
+ case "$s" in
+ postgres_password) create_secret "$s" "$(openssl rand -hex 24)" ;;
+ session_secret) create_secret "$s" "$(openssl rand -hex 32)" ;;
+ # Inngest self-host rejects the signkey- prefix — plain hex only.
+ inngest_signing_key) create_secret "$s" "$(openssl rand -hex 32)" ;;
+ inngest_event_key) create_secret "$s" "$(openssl rand -hex 16)" ;;
+ esac
+ done
+
+ # Supabase key trio — must be minted together (anon/service signed by jwt_secret).
+ if secret_exists jwt_secret && [ "$force" -ne 1 ]; then
+ log "secret 'jwt_secret' exists — skipping Supabase trio"
+ else
+ log "Generating Supabase key trio"
+ local trio jwt anon svc
+ trio=$(node "$HERE/scripts/gen-supabase-keys.mjs")
+ jwt=$(printf '%s\n' "$trio" | sed -n 's/^SUPABASE_JWT_SECRET=//p')
+ anon=$(printf '%s\n' "$trio" | sed -n 's/^SUPABASE_ANON_KEY=//p')
+ svc=$(printf '%s\n' "$trio" | sed -n 's/^SUPABASE_SERVICE_ROLE_KEY=//p')
+ for s in jwt_secret anon_key service_role_key; do secret_exists "$s" && docker secret rm "$s" >/dev/null; done
+ create_secret jwt_secret "$jwt"
+ create_secret anon_key "$anon"
+ create_secret service_role_key "$svc"
+ fi
+
+ # Operator-supplied secrets — placeholders so the stack deploys; replace later.
+ # ERP crashes on boot with an empty RESEND_API_KEY, so seed a non-empty value.
+ for s in $SUPPLIED_SECRETS; do
+ secret_exists "$s" && continue
+ case "$s" in
+ resend_api_key) create_secret "$s" "re_placeholder_change_me" ;;
+ smtp_password) create_secret "$s" "change_me" ;;
+ esac
+ done
+
+ log "Secrets ready."
+ warn "Next:"
+ warn " 1. Edit $ENV_FILE — set CARBON_REPO, the *_HOST/*_URL, ACME_EMAIL, SMTP."
+ warn " 2. Set real secrets: $SCRIPT_NAME secret resend_api_key (then smtp_password)"
+ warn " 3. $SCRIPT_NAME up"
+}
+
+# ── build ──────────────────────────────────────────────────────────────────────
+cmd_build() {
+ require_cmds docker; load_env
+ if [ -n "${CARBON_REGISTRY:-}" ]; then
+ log "CARBON_REGISTRY set — skipping local build (images pulled from registry on deploy)"
+ return 0
+ fi
+ log "Building erp image ($CARBON_IMAGE_ERP) — needs ~8 GB RAM (NODE_OPTIONS)"
+ docker build --build-arg APP=erp -t "$CARBON_IMAGE_ERP" "$CARBON_REPO"
+ log "Building mes image ($CARBON_IMAGE_MES)"
+ docker build --build-arg APP=mes -t "$CARBON_IMAGE_MES" "$CARBON_REPO"
+}
+
+# ── deploy ─────────────────────────────────────────────────────────────────────
+cmd_deploy() {
+ require_cmds docker; load_env
+ swarm_active || error "swarm not active — run '$SCRIPT_NAME init'"
+ log "Deploying stack '$STACK_NAME'"
+ # --resolve-image never: use the locally built tags as-is for the no-registry path.
+ local resolve=never; [ -n "${CARBON_REGISTRY:-}" ] && resolve=always
+ docker stack deploy --detach=true --resolve-image "$resolve" -c "$STACK_FILE" "$STACK_NAME"
+}
+
+# Wait until a service has a healthy (or, if no healthcheck, running) task.
+wait_healthy() {
+ local svc="$1" timeout="${2:-180}" name="${STACK_NAME}_$1" waited=0
+ log "Waiting for $name to be healthy (timeout ${timeout}s)"
+ while [ "$waited" -lt "$timeout" ]; do
+ if docker ps --filter "name=$name" --filter health=healthy --format '{{.Names}}' | grep -q .; then
+ log "$name healthy"; return 0
+ fi
+ sleep 5; waited=$((waited + 5))
+ done
+ error "$name not healthy after ${timeout}s — check '$SCRIPT_NAME logs $svc'"
+}
+
+# ── migrate (ephemeral run-once job on the stack network) ───────────────────────
+cmd_migrate() {
+ require_cmds docker; load_env
+ wait_healthy postgres 180
+ wait_healthy storage 180
+ local job="${STACK_NAME}_migrate"
+ docker service rm "$job" >/dev/null 2>&1 || true
+ log "Running migrations (supabase migration up)"
+ docker service create \
+ --name "$job" \
+ --mode replicated-job \
+ --detach=false \
+ --network "${STACK_NAME}_internal" \
+ --secret postgres_password \
+ --restart-condition on-failure \
+ --restart-max-attempts 30 \
+ --env PGSSLMODE=disable \
+ --workdir /repo/packages/database \
+ "$CARBON_IMAGE_ERP" \
+ sh -c 'pnpm exec supabase migration up --include-all \
+ --db-url "postgresql://supabase_admin:$(cat /run/secrets/postgres_password)@postgres:5432/postgres"'
+ docker service rm "$job" >/dev/null 2>&1 || true
+ log "Migrations applied"
+}
+
+# ── up (build + deploy + migrate + roll apps) ───────────────────────────────────
+cmd_up() {
+ cmd_build
+ cmd_deploy
+ cmd_migrate
+ load_env
+ log "Rolling apps now that the schema exists"
+ docker service update --force --detach=true "${STACK_NAME}_erp" >/dev/null
+ docker service update --force --detach=true "${STACK_NAME}_mes" >/dev/null
+ log "Stack up. Check: $SCRIPT_NAME status"
+}
+
+# ── secret (create or rotate one secret from stdin) ─────────────────────────────
+cmd_secret() {
+ require_cmds docker
+ local name="${1:?usage: $SCRIPT_NAME secret <name> (value read from stdin)}"
+ local val; val=$(cat)
+ [ -n "$val" ] || error "empty value on stdin"
+ if secret_exists "$name"; then
+ warn "secret '$name' exists. Rotating requires services to re-read it:"
+ warn " $SCRIPT_NAME down && $SCRIPT_NAME secret $name && $SCRIPT_NAME up"
+ docker secret rm "$name" >/dev/null 2>&1 || error "secret '$name' is in use — bring the stack down first"
+ fi
+ create_secret "$name" "$val"
+}
+
+cmd_status() {
+ load_env
+ docker stack services "$STACK_NAME"
+ echo
+ docker stack ps "$STACK_NAME" --no-trunc --filter desired-state=running
+}
+
+cmd_logs() {
+ load_env
+ local svc="${1:?usage: $SCRIPT_NAME logs <service>}"
+ docker service logs -f --tail 200 "${STACK_NAME}_${svc}"
+}
+
+cmd_down() {
+ require_cmds docker; load_env
+ log "Removing stack '$STACK_NAME'"
+ docker stack rm "$STACK_NAME"
+ if [ "${1:-}" = "--volumes" ]; then
+ warn "Waiting for tasks to stop, then deleting volumes (DATA LOSS)"
+ sleep 10
+ docker volume ls -q --filter "name=${STACK_NAME}_" | xargs -r docker volume rm
+ fi
+}
+
+usage() { sed -n '10,28p' "$0" | sed 's/^# \{0,1\}//'; exit "${1:-0}"; }
+
+main() {
+ local sub="${1:-}"; [ $# -gt 0 ] && shift || true
+ case "$sub" in
+ init) cmd_init "$@" ;;
+ build) cmd_build "$@" ;;
+ deploy) cmd_deploy "$@" ;;
+ up) cmd_up "$@" ;;
+ migrate) cmd_migrate "$@" ;;
+ secret) cmd_secret "$@" ;;
+ status) cmd_status "$@" ;;
+ logs) cmd_logs "$@" ;;
+ down) cmd_down "$@" ;;
+ -h|--help|help|"") usage 0 ;;
+ *) error "unknown command: $sub (try '$SCRIPT_NAME --help')" ;;
+ esac
+}
+
+main "$@"
diff --git a/deploy/prod/postgres/01-roles.sh b/contrib/deploying/simple-docker-caddy/postgres/01-roles.sh
similarity index 70%
rename from deploy/prod/postgres/01-roles.sh
rename to contrib/deploying/simple-docker-caddy/postgres/01-roles.sh
index 5e2d415aef..94928811e1 100755
--- a/deploy/prod/postgres/01-roles.sh
+++ b/contrib/deploying/simple-docker-caddy/postgres/01-roles.sh
@@ -2,10 +2,9 @@
# Production role bootstrap for the self-hosted Supabase postgres.
#
# Runs once, during first-init of a fresh pgdata volume
-# (/docker-entrypoint-initdb.d). Unlike the dev init.sql — which hardcodes the
-# password 'postgres' — this is a *.sh script so it can read ${POSTGRES_PASSWORD}
-# from the environment and set every Supabase service role to it. Mirrors
-# packages/dev/docker/init.sql otherwise.
+# (/docker-entrypoint-initdb.d). A *.sh script (not *.sql) so it can read
+# ${POSTGRES_PASSWORD} from the environment and set every Supabase service role
+# to it. Mirrors packages/dev/docker/init.sql, which hardcodes 'postgres' for dev.
set -euo pipefail
psql -v ON_ERROR_STOP=1 --username "$POSTGRES_USER" --dbname "$POSTGRES_DB" <<-EOSQL
diff --git a/contrib/deploying/simple-docker-caddy/postgres/02-performance.sh b/contrib/deploying/simple-docker-caddy/postgres/02-performance.sh
new file mode 100755
index 0000000000..eea061f9dd
--- /dev/null
+++ b/contrib/deploying/simple-docker-caddy/postgres/02-performance.sh
@@ -0,0 +1,41 @@
+#!/bin/bash
+# Production Postgres tuning for the self-hosted Supabase database.
+#
+# Runs once on first-init of a fresh pgdata volume. Settings are written with
+# ALTER SYSTEM (-> postgresql.auto.conf) and take effect when the entrypoint
+# restarts Postgres at the end of initialization. Sizing knobs come from the
+# CARBON_PG_* env (set in stack.yml from PG_* in .env); tune them to your VPS.
+#
+# Guidance (Supabase Postgres best practices):
+# - max_connections: keep modest (100-200). The app pools client-side and a
+# connection costs 1-3 MB. Raising this blindly exhausts memory.
+# - shared_buffers ~= 25% of RAM
+# - effective_cache_size ~= 50-75% of RAM (a planner hint, not an allocation)
+# - work_mem * max_connections should stay under ~25% of RAM
+# - pg_stat_statements: top-N slow/frequent query visibility (preloaded via the
+# shared_preload_libraries server flag in stack.yml's postgres command).
+set -euo pipefail
+
+MAX_CONNECTIONS="${CARBON_PG_MAX_CONNECTIONS:-100}"
+SHARED_BUFFERS="${CARBON_PG_SHARED_BUFFERS:-512MB}"
+EFFECTIVE_CACHE_SIZE="${CARBON_PG_EFFECTIVE_CACHE_SIZE:-1536MB}"
+WORK_MEM="${CARBON_PG_WORK_MEM:-8MB}"
+MAINTENANCE_WORK_MEM="${CARBON_PG_MAINTENANCE_WORK_MEM:-128MB}"
+
+psql -v ON_ERROR_STOP=1 --username "$POSTGRES_USER" --dbname "$POSTGRES_DB" <<-EOSQL
+ ALTER SYSTEM SET max_connections = '${MAX_CONNECTIONS}';
+ ALTER SYSTEM SET shared_buffers = '${SHARED_BUFFERS}';
+ ALTER SYSTEM SET effective_cache_size = '${EFFECTIVE_CACHE_SIZE}';
+ ALTER SYSTEM SET work_mem = '${WORK_MEM}';
+ ALTER SYSTEM SET maintenance_work_mem = '${MAINTENANCE_WORK_MEM}';
+
+ -- SSD-friendly planner defaults.
+ ALTER SYSTEM SET random_page_cost = '1.1';
+ ALTER SYSTEM SET effective_io_concurrency = '200';
+
+ -- Query visibility. pg_stat_statements is preloaded via the postgres command
+ -- flag (shared_preload_libraries) in stack.yml.
+ ALTER SYSTEM SET track_io_timing = 'on';
+ ALTER SYSTEM SET pg_stat_statements.track = 'all';
+ CREATE EXTENSION IF NOT EXISTS pg_stat_statements;
+EOSQL
diff --git a/contrib/deploying/simple-docker-caddy/scripts/backup.sh b/contrib/deploying/simple-docker-caddy/scripts/backup.sh
new file mode 100755
index 0000000000..19b965c2e3
--- /dev/null
+++ b/contrib/deploying/simple-docker-caddy/scripts/backup.sh
@@ -0,0 +1,42 @@
+#!/usr/bin/env bash
+# Back up the Carbon Swarm stack: a Postgres logical dump + the storage volume.
+#
+# ./scripts/backup.sh # -> ./backups/carbon-<timestamp>/
+# BACKUP_DIR=/mnt/backups ./scripts/backup.sh
+#
+# Restore (DB): gunzip -c db.sql.gz | docker exec -i <pg> psql -U postgres postgres
+# Restore (storage): untar into the `<stack>_storage` volume with a helper container.
+#
+# Run from cron for regular backups, and ship ./backups offsite (S3/Spaces/rclone)
+# — a local copy on the same droplet is not a backup. For point-in-time recovery,
+# also enable provider volume snapshots of the data volume.
+set -euo pipefail
+
+cd "$(dirname "$0")/.."
+[ -f .env ] && set -a && . ./.env && set +a
+
+STACK_NAME="${STACK_NAME:-carbon}"
+TS="$(date +%Y%m%d-%H%M%S)"
+BACKUP_DIR="${BACKUP_DIR:-./backups}/carbon-${TS}"
+mkdir -p "$BACKUP_DIR"
+
+log() { printf '\033[0;36m[backup]\033[0m %s\n' "$*"; }
+
+# ── Postgres logical dump (password read from the in-container secret) ────────
+PG_CID="$(docker ps -q -f "name=${STACK_NAME}_postgres" | head -1)"
+[ -n "$PG_CID" ] || { echo "postgres task not running"; exit 1; }
+
+log "Dumping database -> db.sql.gz"
+docker exec "$PG_CID" sh -c \
+ 'PGPASSWORD="$(cat /run/secrets/postgres_password)" pg_dump -U postgres -Fp postgres' \
+ | gzip >"$BACKUP_DIR/db.sql.gz"
+
+# ── Storage objects (Supabase file backend) ──────────────────────────────────
+log "Archiving storage volume -> storage.tar.gz"
+docker run --rm \
+ -v "${STACK_NAME}_storage:/data:ro" \
+ -v "$(cd "$BACKUP_DIR" && pwd):/out" \
+ alpine:3 sh -c 'tar czf /out/storage.tar.gz -C /data .'
+
+log "Backup complete: $BACKUP_DIR"
+ls -lh "$BACKUP_DIR"
diff --git a/scripts/gen-supabase-keys.mjs b/contrib/deploying/simple-docker-caddy/scripts/gen-supabase-keys.mjs
similarity index 69%
rename from scripts/gen-supabase-keys.mjs
rename to contrib/deploying/simple-docker-caddy/scripts/gen-supabase-keys.mjs
index 8924a82e6a..aff666599a 100755
--- a/scripts/gen-supabase-keys.mjs
+++ b/contrib/deploying/simple-docker-caddy/scripts/gen-supabase-keys.mjs
@@ -1,12 +1,14 @@
#!/usr/bin/env node
-// Generate the Supabase self-host key trio for docker-compose.prod.yml.
+// Generate the Supabase self-host key trio for the Carbon Swarm stack.
//
-// SUPABASE_JWT_SECRET — HMAC secret every Supabase service signs/verifies with
-// SUPABASE_ANON_KEY — JWT(role=anon) signed with that secret
-// SUPABASE_SERVICE_ROLE_KEY — JWT(role=service_role) signed with that secret
+// SUPABASE_JWT_SECRET — HMAC secret every Supabase service signs/verifies with
+// SUPABASE_ANON_KEY — JWT(role=anon) signed with that secret
+// SUPABASE_SERVICE_ROLE_KEY — JWT(role=service_role) signed with that secret
//
-// The anon/service_role keys MUST be signed with the printed JWT secret — paste
-// all three into .env.production together. Re-running mints a fresh set.
+// The anon/service_role keys MUST be signed with the printed JWT secret — the
+// three are a matched set. `deploy.sh init` consumes this output to create the
+// `jwt_secret`, `anon_key`, and `service_role_key` Docker secrets together.
+// Re-running mints a fresh, incompatible set.
//
// Usage: node scripts/gen-supabase-keys.mjs
// Zero dependencies (Node built-in crypto only).
diff --git a/contrib/deploying/simple-docker-caddy/scripts/harden.sh b/contrib/deploying/simple-docker-caddy/scripts/harden.sh
new file mode 100755
index 0000000000..09b2339ef5
--- /dev/null
+++ b/contrib/deploying/simple-docker-caddy/scripts/harden.sh
@@ -0,0 +1,65 @@
+#!/usr/bin/env bash
+# Baseline VPS hardening for a single-node Carbon Swarm host (Ubuntu/Debian).
+#
+# Idempotent. Run once as root on a fresh droplet BEFORE deploying:
+# sudo ./scripts/harden.sh
+#
+# Does: firewall (allow SSH/HTTP/HTTPS only), fail2ban, a swapfile if none, and
+# unattended security upgrades. Mirrors the hardening in DigitalOcean's
+# supabase-on-do reference. Review each step for your environment.
+set -euo pipefail
+
+[ "$(id -u)" -eq 0 ] || { echo "run as root (sudo $0)"; exit 1; }
+
+SWAP_SIZE="${SWAP_SIZE:-2G}"
+SSH_PORT="${SSH_PORT:-22}"
+
+log() { printf '\033[0;36m[harden]\033[0m %s\n' "$*"; }
+
+# ── Firewall: default-deny inbound, allow SSH + the two Caddy ports only ──────
+log "Configuring UFW firewall"
+export DEBIAN_FRONTEND=noninteractive
+apt-get -y update
+apt-get -y install ufw fail2ban unattended-upgrades
+
+ufw --force reset
+ufw default deny incoming
+ufw default allow outgoing
+ufw allow "${SSH_PORT}/tcp" comment 'SSH'
+ufw allow 80/tcp comment 'HTTP (ACME + redirect)'
+ufw allow 443/tcp comment 'HTTPS'
+ufw allow 443/udp comment 'HTTP/3'
+ufw --force enable
+log "UFW enabled. Docker publishes via the host firewall; only 80/443 are public."
+
+# ── fail2ban: protect SSH from brute force ───────────────────────────────────
+log "Enabling fail2ban (sshd jail)"
+cat >/etc/fail2ban/jail.d/carbon.conf <<-EOF
+ [sshd]
+ enabled = true
+ port = ${SSH_PORT}
+ maxretry = 5
+ bantime = 1h
+EOF
+systemctl enable --now fail2ban
+systemctl restart fail2ban
+
+# ── Swap: give a small VPS headroom (app builds + Postgres) ───────────────────
+if ! swapon --show | grep -q .; then
+ log "Creating ${SWAP_SIZE} swapfile"
+ fallocate -l "$SWAP_SIZE" /swapfile || dd if=/dev/zero of=/swapfile bs=1M count=2048
+ chmod 600 /swapfile
+ mkswap /swapfile
+ swapon /swapfile
+ grep -q '^/swapfile' /etc/fstab || echo '/swapfile none swap sw 0 0' >>/etc/fstab
+ sysctl -w vm.swappiness=10
+ grep -q '^vm.swappiness' /etc/sysctl.conf || echo 'vm.swappiness=10' >>/etc/sysctl.conf
+else
+ log "Swap already present — skipping"
+fi
+
+# ── Automatic security updates ───────────────────────────────────────────────
+log "Enabling unattended-upgrades"
+dpkg-reconfigure -f noninteractive unattended-upgrades
+
+log "Done. Reminder: SSH key-only auth + a non-root sudo user are recommended."
diff --git a/contrib/deploying/simple-docker-caddy/stack.yml b/contrib/deploying/simple-docker-caddy/stack.yml
new file mode 100644
index 0000000000..b108648f04
--- /dev/null
+++ b/contrib/deploying/simple-docker-caddy/stack.yml
@@ -0,0 +1,581 @@
+###############################################################################
+# Carbon — single-VPS Docker Swarm stack (ERP + MES + Supabase + Redis + Inngest)
+# behind an auto-HTTPS Caddy reverse proxy.
+#
+# Deploy with `./deploy.sh up` (see README.md). Do NOT `docker compose up` this
+# file — it is a Swarm stack (`docker stack deploy`). `build:`, `depends_on`,
+# `profiles:` and `restart:` are intentionally absent: Swarm ignores them.
+#
+# Config files are bind-mounted from the repo checkout ($CARBON_REPO) — this
+# example is single-node and expects the Carbon repo present on the host (it also
+# builds the app images from it). Sensitive values come from Docker Swarm secrets,
+# injected into env via bin/secrets-entrypoint.sh (the `__SECRET__` placeholders).
+#
+# Only `caddy` publishes ports (80/443). Everything else stays on the overlay.
+###############################################################################
+
+x-shim: &shim
+ type: bind
+ source: ${CARBON_REPO}/contrib/deploying/simple-docker-caddy/bin/secrets-entrypoint.sh
+ target: /usr/local/bin/carbon-secrets-entrypoint.sh
+ read_only: true
+
+x-restart: &restart
+ restart_policy:
+ condition: any
+ delay: 5s
+ max_attempts: 0
+
+x-app-deploy: &app-deploy
+ replicas: 1
+ restart_policy:
+ condition: any
+ delay: 5s
+ update_config:
+ parallelism: 1
+ delay: 10s
+ order: start-first
+ failure_action: rollback
+ rollback_config:
+ parallelism: 1
+ order: stop-first
+ resources:
+ limits:
+ memory: 2048M
+ reservations:
+ memory: 512M
+
+services:
+ # ─────────────────────────────── Apps ──────────────────────────────────────
+ erp:
+ image: ${CARBON_IMAGE_ERP:-carbon/erp:latest}
+ entrypoint: ["/usr/local/bin/carbon-secrets-entrypoint.sh"]
+ command: ["pnpm", "run", "start"]
+ networks: [internal]
+ secrets:
+ - postgres_password
+ - jwt_secret
+ - anon_key
+ - service_role_key
+ - session_secret
+ - inngest_signing_key
+ - inngest_event_key
+ - resend_api_key
+ environment:
+ NODE_ENV: production
+ PORT: "3000"
+ CARBON_EDITION: ${CARBON_EDITION:-community}
+ DOMAIN: ${DOMAIN}
+ ERP_URL: ${ERP_URL}
+ MES_URL: ${MES_URL}
+ SUPABASE_URL: ${SUPABASE_URL}
+ SUPABASE_ANON_KEY: __ANON_KEY__
+ SUPABASE_SERVICE_ROLE_KEY: __SERVICE_ROLE_KEY__
+ SUPABASE_JWT_SECRET: __JWT_SECRET__
+ SUPABASE_DB_URL: postgresql://postgres:__POSTGRES_PASSWORD__@postgres:5432/postgres?sslmode=disable
+ REDIS_URL: redis://redis:6379
+ SESSION_SECRET: __SESSION_SECRET__
+ INNGEST_SIGNING_KEY: __INNGEST_SIGNING_KEY__
+ INNGEST_EVENT_KEY: __INNGEST_EVENT_KEY__
+ RESEND_API_KEY: __RESEND_API_KEY__
+ RESEND_DOMAIN: ${RESEND_DOMAIN:-}
+ volumes:
+ - *shim
+ healthcheck:
+ test: ["CMD", "curl", "-fsS", "http://localhost:3000/health"]
+ interval: 15s
+ timeout: 6s
+ retries: 5
+ start_period: 40s
+ deploy: *app-deploy
+
+ mes:
+ image: ${CARBON_IMAGE_MES:-carbon/mes:latest}
+ entrypoint: ["/usr/local/bin/carbon-secrets-entrypoint.sh"]
+ command: ["pnpm", "run", "start"]
+ networks: [internal]
+ secrets:
+ - postgres_password
+ - jwt_secret
+ - anon_key
+ - service_role_key
+ - session_secret
+ - inngest_signing_key
+ - inngest_event_key
+ environment:
+ NODE_ENV: production
+ PORT: "3000"
+ CARBON_EDITION: ${CARBON_EDITION:-community}
+ DOMAIN: ${DOMAIN}
+ ERP_URL: ${ERP_URL}
+ MES_URL: ${MES_URL}
+ SUPABASE_URL: ${SUPABASE_URL}
+ SUPABASE_ANON_KEY: __ANON_KEY__
+ SUPABASE_SERVICE_ROLE_KEY: __SERVICE_ROLE_KEY__
+ SUPABASE_JWT_SECRET: __JWT_SECRET__
+ SUPABASE_DB_URL: postgresql://postgres:__POSTGRES_PASSWORD__@postgres:5432/postgres?sslmode=disable
+ REDIS_URL: redis://redis:6379
+ SESSION_SECRET: __SESSION_SECRET__
+ INNGEST_SIGNING_KEY: __INNGEST_SIGNING_KEY__
+ INNGEST_EVENT_KEY: __INNGEST_EVENT_KEY__
+ volumes:
+ - *shim
+ healthcheck:
+ test: ["CMD", "curl", "-fsS", "http://localhost:3000/health"]
+ interval: 15s
+ timeout: 6s
+ retries: 5
+ start_period: 40s
+ deploy: *app-deploy
+
+ caddy:
+ image: caddy:2-alpine
+ networks: [internal]
+ ports:
+ - target: 80
+ published: 80
+ mode: ingress
+ - target: 443
+ published: 443
+ mode: ingress
+ - target: 443
+ published: 443
+ protocol: udp
+ mode: ingress
+ environment:
+ ERP_HOST: ${ERP_HOST}
+ MES_HOST: ${MES_HOST}
+ SUPABASE_HOST: ${SUPABASE_HOST}
+ STUDIO_HOST: ${STUDIO_HOST:-}
+ ACME_EMAIL: ${ACME_EMAIL}
+ volumes:
+ - type: bind
+ source: ${CARBON_REPO}/contrib/deploying/simple-docker-caddy/Caddyfile
+ target: /etc/caddy/Caddyfile
+ read_only: true
+ - caddy-data:/data
+ - caddy-config:/config
+ healthcheck:
+ test: ["CMD", "wget", "-qO-", "http://localhost:2019/config/"]
+ interval: 20s
+ timeout: 5s
+ retries: 5
+ start_period: 15s
+ deploy:
+ <<: *restart
+ replicas: 1
+ resources:
+ limits:
+ memory: 256M
+
+ # ──────────────────────────── Data plane ───────────────────────────────────
+ postgres:
+ image: supabase/postgres:15.14.1.112
+ entrypoint: ["/usr/local/bin/carbon-secrets-entrypoint.sh"]
+ # Original entrypoint+cmd, plus production tuning. shared_preload_libraries
+ # must be a server flag (it cannot be set via ALTER SYSTEM at runtime).
+ command:
+ - docker-entrypoint.sh
+ - postgres
+ - -c
+ - config_file=/etc/postgresql/postgresql.conf
+ - -c
+ - shared_preload_libraries=pg_stat_statements
+ networks:
+ internal:
+ aliases: [db]
+ secrets:
+ - postgres_password
+ - jwt_secret
+ environment:
+ POSTGRES_HOST: /var/run/postgresql
+ POSTGRES_PORT: "5432"
+ PGPORT: "5432"
+ POSTGRES_DB: postgres
+ PGDATABASE: postgres
+ POSTGRES_PASSWORD: __POSTGRES_PASSWORD__
+ PGPASSWORD: __POSTGRES_PASSWORD__
+ JWT_SECRET: __JWT_SECRET__
+ JWT_EXP: "3600"
+ # Performance knobs consumed by 02-performance.sh (ALTER SYSTEM) on first init.
+ CARBON_PG_MAX_CONNECTIONS: ${PG_MAX_CONNECTIONS:-100}
+ CARBON_PG_SHARED_BUFFERS: ${PG_SHARED_BUFFERS:-512MB}
+ CARBON_PG_EFFECTIVE_CACHE_SIZE: ${PG_EFFECTIVE_CACHE_SIZE:-1536MB}
+ CARBON_PG_WORK_MEM: ${PG_WORK_MEM:-8MB}
+ CARBON_PG_MAINTENANCE_WORK_MEM: ${PG_MAINTENANCE_WORK_MEM:-128MB}
+ volumes:
+ - *shim
+ - pgdata:/var/lib/postgresql/data
+ - pgconfig:/etc/postgresql-custom
+ - type: bind
+ source: ${CARBON_REPO}/contrib/deploying/simple-docker-caddy/postgres/01-roles.sh
+ target: /docker-entrypoint-initdb.d/zz-carbon-01-roles.sh
+ read_only: true
+ - type: bind
+ source: ${CARBON_REPO}/contrib/deploying/simple-docker-caddy/postgres/02-performance.sh
+ target: /docker-entrypoint-initdb.d/zz-carbon-02-performance.sh
+ read_only: true
+ healthcheck:
+ test: ["CMD", "pg_isready", "-U", "postgres", "-h", "localhost"]
+ interval: 5s
+ timeout: 5s
+ retries: 20
+ deploy:
+ <<: *restart
+ replicas: 1
+ resources:
+ limits:
+ memory: ${PG_MEMORY_LIMIT:-2048M}
+ reservations:
+ memory: 512M
+
+ gotrue:
+ image: supabase/gotrue:v2.189.0
+ entrypoint: ["/usr/local/bin/carbon-secrets-entrypoint.sh"]
+ command: ["auth"]
+ networks: [internal]
+ secrets:
+ - postgres_password
+ - jwt_secret
+ - smtp_password
+ environment:
+ GOTRUE_API_HOST: 0.0.0.0
+ GOTRUE_API_PORT: "9999"
+ API_EXTERNAL_URL: ${SUPABASE_URL}
+ GOTRUE_DB_DRIVER: postgres
+ GOTRUE_DB_DATABASE_URL: postgres://supabase_auth_admin:__POSTGRES_PASSWORD__@postgres:5432/postgres
+ GOTRUE_SITE_URL: ${ERP_URL}
+ GOTRUE_URI_ALLOW_LIST: ${ERP_URL},${MES_URL}
+ GOTRUE_DISABLE_SIGNUP: ${GOTRUE_DISABLE_SIGNUP:-true}
+ GOTRUE_JWT_SECRET: __JWT_SECRET__
+ GOTRUE_JWT_EXP: "3600"
+ GOTRUE_JWT_DEFAULT_GROUP_NAME: authenticated
+ GOTRUE_JWT_ADMIN_ROLES: service_role
+ GOTRUE_JWT_AUD: authenticated
+ GOTRUE_EXTERNAL_EMAIL_ENABLED: "true"
+ GOTRUE_MAILER_AUTOCONFIRM: "false"
+ GOTRUE_SMTP_HOST: ${GOTRUE_SMTP_HOST:-}
+ GOTRUE_SMTP_PORT: ${GOTRUE_SMTP_PORT:-587}
+ GOTRUE_SMTP_USER: ${GOTRUE_SMTP_USER:-}
+ GOTRUE_SMTP_PASS: __SMTP_PASSWORD__
+ GOTRUE_SMTP_ADMIN_EMAIL: ${GOTRUE_SMTP_ADMIN_EMAIL:-}
+ GOTRUE_SMTP_SENDER_NAME: ${GOTRUE_SMTP_SENDER_NAME:-Carbon}
+ GOTRUE_EXTERNAL_GOOGLE_ENABLED: ${GOOGLE_AUTH_ENABLED:-false}
+ GOTRUE_EXTERNAL_GOOGLE_CLIENT_ID: ${SUPABASE_AUTH_EXTERNAL_GOOGLE_CLIENT_ID:-}
+ GOTRUE_EXTERNAL_GOOGLE_SECRET: ${SUPABASE_AUTH_EXTERNAL_GOOGLE_CLIENT_SECRET:-}
+ GOTRUE_EXTERNAL_GOOGLE_REDIRECT_URI: ${SUPABASE_AUTH_EXTERNAL_GOOGLE_REDIRECT_URI:-}
+ GOTRUE_EXTERNAL_AZURE_ENABLED: ${AZURE_AUTH_ENABLED:-false}
+ GOTRUE_EXTERNAL_AZURE_CLIENT_ID: ${SUPABASE_AUTH_EXTERNAL_AZURE_CLIENT_ID:-}
+ GOTRUE_EXTERNAL_AZURE_SECRET: ${SUPABASE_AUTH_EXTERNAL_AZURE_CLIENT_SECRET:-}
+ GOTRUE_EXTERNAL_AZURE_REDIRECT_URI: ${SUPABASE_AUTH_EXTERNAL_AZURE_REDIRECT_URI:-}
+ GOTRUE_MAILER_TEMPLATES_MAGIC_LINK: ${ERP_URL}/templates/magic-link.html
+ GOTRUE_MAILER_TEMPLATES_INVITE: ${ERP_URL}/templates/invite.html
+ volumes:
+ - *shim
+ deploy:
+ <<: *restart
+ replicas: 1
+ resources:
+ limits:
+ memory: 256M
+
+ postgrest:
+ image: postgrest/postgrest:v13.0.8
+ entrypoint: ["/usr/local/bin/carbon-secrets-entrypoint.sh"]
+ command: ["postgrest"]
+ networks: [internal]
+ secrets:
+ - postgres_password
+ - jwt_secret
+ environment:
+ PGRST_DB_URI: postgres://authenticator:__POSTGRES_PASSWORD__@postgres:5432/postgres
+ PGRST_DB_SCHEMAS: public,storage,graphql_public
+ PGRST_DB_ANON_ROLE: anon
+ PGRST_JWT_SECRET: __JWT_SECRET__
+ PGRST_DB_USE_LEGACY_GUCS: "false"
+ PGRST_APP_SETTINGS_JWT_SECRET: __JWT_SECRET__
+ PGRST_APP_SETTINGS_JWT_EXP: "3600"
+ volumes:
+ - *shim
+ deploy:
+ <<: *restart
+ replicas: 1
+ resources:
+ limits:
+ memory: 512M
+
+ realtime:
+ image: supabase/realtime:v2.89.0
+ entrypoint: ["/usr/local/bin/carbon-secrets-entrypoint.sh"]
+ command: ["/usr/bin/tini", "-s", "-g", "--", "/app/run.sh", "/app/bin/server"]
+ networks:
+ internal:
+ aliases: [realtime-dev]
+ secrets:
+ - postgres_password
+ - jwt_secret
+ environment:
+ PORT: "4000"
+ DB_HOST: postgres
+ DB_PORT: "5432"
+ DB_USER: supabase_admin
+ DB_PASSWORD: __POSTGRES_PASSWORD__
+ DB_NAME: postgres
+ DB_AFTER_CONNECT_QUERY: "SET search_path TO _realtime"
+ DB_ENC_KEY: ${REALTIME_DB_ENC_KEY:-supabaserealtime}
+ API_JWT_SECRET: __JWT_SECRET__
+ METRICS_JWT_SECRET: __JWT_SECRET__
+ SECRET_KEY_BASE: ${REALTIME_SECRET_KEY_BASE:-UpNVntn3cDxHJpq99YMc1T1AQgQpc8kfYTuRgBiYa15BLrx8etQoXz3gZv1/u2oq}
+ APP_NAME: realtime
+ ERL_AFLAGS: -proto_dist inet_tcp
+ DNS_NODES: "''"
+ RLIMIT_NOFILE: "10000"
+ SEED_SELF_HOST: "true"
+ RUN_JANITOR: "true"
+ DISABLE_HEALTHCHECK_LOGGING: "true"
+ volumes:
+ - *shim
+ deploy:
+ <<: *restart
+ replicas: 1
+ resources:
+ limits:
+ memory: 512M
+
+ storage:
+ image: supabase/storage-api:v1.58.4
+ entrypoint: ["/usr/local/bin/carbon-secrets-entrypoint.sh"]
+ command: ["docker-entrypoint.sh", "node", "dist/start/server.js"]
+ networks: [internal]
+ secrets:
+ - postgres_password
+ - jwt_secret
+ - anon_key
+ - service_role_key
+ environment:
+ ANON_KEY: __ANON_KEY__
+ SERVICE_KEY: __SERVICE_ROLE_KEY__
+ POSTGREST_URL: http://postgrest:3000
+ PGRST_JWT_SECRET: __JWT_SECRET__
+ DATABASE_URL: postgres://supabase_storage_admin:__POSTGRES_PASSWORD__@postgres:5432/postgres
+ FILE_SIZE_LIMIT: "52428800"
+ STORAGE_BACKEND: file
+ FILE_STORAGE_BACKEND_PATH: /var/lib/storage
+ TENANT_ID: stub
+ REGION: stub
+ GLOBAL_S3_BUCKET: stub
+ ENABLE_IMAGE_TRANSFORMATION: "false"
+ volumes:
+ - *shim
+ - storage:/var/lib/storage
+ healthcheck:
+ test:
+ - CMD
+ - node
+ - -e
+ - "fetch('http://localhost:5000/status').then(r=>process.exit(r.ok?0:1)).catch(()=>process.exit(1))"
+ interval: 5s
+ timeout: 5s
+ retries: 30
+ deploy:
+ <<: *restart
+ replicas: 1
+ resources:
+ limits:
+ memory: 512M
+
+ meta:
+ image: supabase/postgres-meta:v0.96.5
+ entrypoint: ["/usr/local/bin/carbon-secrets-entrypoint.sh"]
+ command: ["docker-entrypoint.sh", "node", "dist/server/server.js"]
+ networks: [internal]
+ secrets:
+ - postgres_password
+ environment:
+ PG_META_PORT: "8080"
+ PG_META_DB_HOST: postgres
+ PG_META_DB_PORT: "5432"
+ PG_META_DB_NAME: postgres
+ PG_META_DB_USER: supabase_admin
+ PG_META_DB_PASSWORD: __POSTGRES_PASSWORD__
+ volumes:
+ - *shim
+ deploy:
+ <<: *restart
+ replicas: 1
+ resources:
+ limits:
+ memory: 256M
+
+ studio:
+ image: supabase/studio:2026.04.28-sha-89d08a2
+ entrypoint: ["/usr/local/bin/carbon-secrets-entrypoint.sh"]
+ command: ["docker-entrypoint.sh", "node", "apps/studio/server.js"]
+ networks: [internal]
+ secrets:
+ - postgres_password
+ - anon_key
+ - service_role_key
+ environment:
+ STUDIO_PG_META_URL: http://meta:8080
+ POSTGRES_PASSWORD: __POSTGRES_PASSWORD__
+ DEFAULT_ORGANIZATION_NAME: Carbon
+ DEFAULT_PROJECT_NAME: Carbon
+ SUPABASE_URL: http://kong:8000
+ SUPABASE_PUBLIC_URL: ${SUPABASE_URL}
+ SUPABASE_ANON_KEY: __ANON_KEY__
+ SUPABASE_SERVICE_KEY: __SERVICE_ROLE_KEY__
+ volumes:
+ - *shim
+ # Internal admin UI. Not published. Reach it via the optional studio.* route
+ # in the Caddyfile (behind basic_auth) or an SSH tunnel — never expose openly.
+ deploy:
+ <<: *restart
+ replicas: ${STUDIO_REPLICAS:-1}
+ resources:
+ limits:
+ memory: 512M
+
+ edge-runtime:
+ image: supabase/edge-runtime:v1.74.0
+ entrypoint: ["/usr/local/bin/carbon-secrets-entrypoint.sh"]
+ command: ["edge-runtime", "start", "--main-service", "/home/deno/main"]
+ networks: [internal]
+ secrets:
+ - postgres_password
+ - jwt_secret
+ - anon_key
+ - service_role_key
+ environment:
+ JWT_SECRET: __JWT_SECRET__
+ SUPABASE_URL: http://kong:8000
+ SUPABASE_ANON_KEY: __ANON_KEY__
+ SUPABASE_SERVICE_ROLE_KEY: __SERVICE_ROLE_KEY__
+ SUPABASE_DB_URL: postgresql://postgres:__POSTGRES_PASSWORD__@postgres:5432/postgres
+ VERIFY_JWT: ${EDGE_VERIFY_JWT:-false}
+ volumes:
+ - *shim
+ - type: bind
+ source: ${CARBON_REPO}/packages/database/supabase/functions
+ target: /home/deno/functions
+ read_only: true
+ - type: bind
+ source: ${CARBON_REPO}/packages/database/src
+ target: /home/src
+ read_only: true
+ - type: bind
+ source: ${CARBON_REPO}/packages/dev/docker/edge-main
+ target: /home/deno/main
+ read_only: true
+ deploy:
+ <<: *restart
+ replicas: 1
+ resources:
+ limits:
+ memory: 512M
+
+ kong:
+ image: kong:2.8.1
+ networks: [internal]
+ environment:
+ KONG_DATABASE: "off"
+ KONG_DECLARATIVE_CONFIG: /home/kong/kong.yml
+ KONG_DNS_ORDER: LAST,A,CNAME
+ KONG_PLUGINS: request-transformer,cors,key-auth,acl,basic-auth
+ volumes:
+ - type: bind
+ source: ${CARBON_REPO}/packages/dev/docker/kong.yml
+ target: /home/kong/kong.yml
+ read_only: true
+ healthcheck:
+ test: ["CMD", "kong", "health"]
+ interval: 15s
+ timeout: 5s
+ retries: 10
+ deploy:
+ <<: *restart
+ replicas: 1
+ resources:
+ limits:
+ memory: 512M
+
+ redis:
+ image: redis:7-alpine
+ command: ["redis-server", "--appendonly", "yes"]
+ networks: [internal]
+ volumes:
+ - redis-data:/data
+ healthcheck:
+ test: ["CMD", "redis-cli", "ping"]
+ interval: 5s
+ timeout: 3s
+ retries: 5
+ deploy:
+ <<: *restart
+ replicas: 1
+ resources:
+ limits:
+ memory: 512M
+
+ inngest:
+ image: inngest/inngest:v1.19.4
+ entrypoint: ["/usr/local/bin/carbon-secrets-entrypoint.sh"]
+ command:
+ - inngest
+ - start
+ - --sqlite-dir
+ - /data
+ - --sdk-url
+ - http://erp:3000/api/inngest
+ - --sdk-url
+ - http://mes:3000/api/inngest
+ networks: [internal]
+ secrets:
+ - inngest_signing_key
+ - inngest_event_key
+ environment:
+ INNGEST_EVENT_KEY: __INNGEST_EVENT_KEY__
+ INNGEST_SIGNING_KEY: __INNGEST_SIGNING_KEY__
+ volumes:
+ - *shim
+ - inngest:/data
+ deploy:
+ <<: *restart
+ replicas: 1
+ resources:
+ limits:
+ memory: 512M
+
+networks:
+ internal:
+ driver: overlay
+ attachable: true
+
+volumes:
+ pgdata:
+ pgconfig:
+ storage:
+ inngest:
+ redis-data:
+ caddy-data:
+ caddy-config:
+
+secrets:
+ postgres_password:
+ external: true
+ jwt_secret:
+ external: true
+ anon_key:
+ external: true
+ service_role_key:
+ external: true
+ session_secret:
+ external: true
+ inngest_signing_key:
+ external: true
+ inngest_event_key:
+ external: true
+ resend_api_key:
+ external: true
+ smtp_password:
+ external: true
diff --git a/deploy/prod/Caddyfile b/deploy/prod/Caddyfile
deleted file mode 100644
index 67f26d5842..0000000000
--- a/deploy/prod/Caddyfile
+++ /dev/null
@@ -1,22 +0,0 @@
-# Carbon production reverse proxy. Auto-HTTPS via Let's Encrypt.
-# Hostnames + ACME email come from the compose environment (envsubst-style
-# {$VAR} placeholders, resolved by Caddy at load from container env).
-
-{
- email {$ACME_EMAIL}
-}
-
-# ERP
-{$ERP_HOST} {
- reverse_proxy erp:3000
-}
-
-# MES
-{$MES_HOST} {
- reverse_proxy mes:3000
-}
-
-# Supabase API gateway (kong) — browser-facing: auth, REST, storage, realtime ws, functions
-{$SUPABASE_HOST} {
- reverse_proxy kong:8000
-}
diff --git a/deploy/prod/README.md b/deploy/prod/README.md
deleted file mode 100644
index 3a2aec1a6b..0000000000
--- a/deploy/prod/README.md
+++ /dev/null
@@ -1,138 +0,0 @@
-# Carbon — production Docker Compose
-
-Self-host the whole Carbon stack (ERP + MES + Supabase + Redis + Inngest) on a
-single host behind an auto-HTTPS reverse proxy. Or run **apps-only** against
-managed backends.
-
-Files:
-- [`docker-compose.prod.yml`](../../docker-compose.prod.yml) — the stack
-- [`.env.production.example`](../../.env.production.example) — env template
-- [`scripts/gen-supabase-keys.mjs`](../../scripts/gen-supabase-keys.mjs) — key generator
-- `Caddyfile` — reverse proxy (3 hostnames)
-- `postgres/01-roles.sh` — Supabase role bootstrap (parameterized password)
-
-The unified app image is built from the repo-root [`Dockerfile`](../../Dockerfile)
-via `--build-arg APP=erp|mes`.
-
-## Quick start (`deploy.sh`)
-
-`deploy/prod/deploy.sh` wraps everything below — env generation + ordered boot:
-
-```bash
-deploy/prod/deploy.sh init # create .env.production (keys + random secrets)
-# edit .env.production: set the *_HOST/*_URL, ACME_EMAIL, RESEND_API_KEY, SMTP
-deploy/prod/deploy.sh up # build + boot (postgres+storage → migrate → rest → apps)
-deploy/prod/deploy.sh status # docker compose ps
-deploy/prod/deploy.sh logs caddy
-deploy/prod/deploy.sh migrate # re-apply migrations after an update
-deploy/prod/deploy.sh down # stop (add --volumes to wipe data)
-```
-
-`init` fills `SUPABASE_*` keys, `POSTGRES_PASSWORD`, `SESSION_SECRET`,
-`INNGEST_*`, and `SUPABASE_DB_URL` automatically; you only edit hostnames + the
-third-party secrets it warns about. The manual steps below are the same flow if
-you'd rather run compose yourself.
-
-## Prerequisites
-
-- A host with Docker + Compose v2.
-- DNS A-records for `ERP_HOST`, `MES_HOST`, `SUPABASE_HOST` pointing at the host
- (Caddy needs them reachable on :80/:443 for Let's Encrypt).
-
-## 1. Configure
-
-```bash
-cp .env.production.example .env.production
-node scripts/gen-supabase-keys.mjs # paste the 3 SUPABASE_* lines in
-openssl rand -hex 32 # -> SESSION_SECRET
-openssl rand -hex 24 # -> POSTGRES_PASSWORD
-```
-
-Then in `.env.production`:
-- Set `ERP_HOST` / `MES_HOST` / `SUPABASE_HOST` + matching `*_URL` and `ACME_EMAIL`.
-- Set `POSTGRES_PASSWORD`, and put the **same** password into `SUPABASE_DB_URL`
- (`env_file` does not expand `${...}`).
-- Set `INNGEST_SIGNING_KEY` (`signkey-prod-<hex>`) and `INNGEST_EVENT_KEY`.
-- Fill SMTP so Auth can send invites/magic links.
-
-`docker compose` reads `.env.production` via `--env-file` (below). To shorten the
-commands, `export COMPOSE_FILE=docker-compose.prod.yml` and
-`alias dc='docker compose --env-file .env.production'`.
-
-## 2. Bring up the data plane (self-host)
-
-Order matters: `storage` must be up before `migrate` — storage-api creates the
-`storage.*` schema on boot and an early migration writes into `storage.buckets`.
-The `migrate` service already `depends_on` postgres + storage healthchecks, so
-the one command below sequences correctly:
-
-```bash
-dc --profile data up -d postgres storage # postgres + storage bootstrap
-dc --profile data run --rm migrate # ~750 migrations (gated on storage healthy)
-dc --profile data up -d # gotrue, kong, redis, inngest, …
-```
-
-Sanity check the schema:
-
-```bash
-dc --profile data exec postgres psql -U postgres -c '\dt public.*' | head
-```
-
-Seed an initial company/admin (optional):
-
-```bash
-dc --profile data run --rm \
- -e SUPABASE_URL=http://kong:8000 \
- -w /repo/packages/database migrate \
- sh -c "pnpm db:seed"
-```
-
-## 3. Bring up the apps
-
-```bash
-dc up -d --build erp mes caddy
-dc logs -f caddy # watch cert issuance
-curl -fsS https://$ERP_HOST/health # -> 200 JSON
-curl -fsS https://$MES_HOST/health # -> 200 JSON
-dc logs inngest # both apps synced
-```
-
-## Managed backends (apps-only)
-
-Skip the `data` profile. In `.env.production` point `SUPABASE_URL` /
-`SUPABASE_ANON_KEY` / `SUPABASE_SERVICE_ROLE_KEY` / `SUPABASE_DB_URL` /
-`REDIS_URL` / `INNGEST_*` at your managed services, then:
-
-```bash
-dc up -d --build erp mes caddy
-```
-
-Apply migrations against the managed DB with your existing
-`supabase db push` flow (see `packages/database`).
-
-## Operating
-
-- **Studio** (DB admin) is bound to `127.0.0.1:${STUDIO_PORT:-3900}` only —
- reach it with `ssh -L 3900:localhost:3900 host`.
-- **Postgres / Kong are not published** — only Caddy's 80/443 are public.
-- **Updates**: `dc up -d --build erp mes` rebuilds + rolls the apps; run
- `dc --profile data run --rm migrate` first if the release adds migrations.
-- **Backups**: snapshot the `pgdata` and `storage` volumes.
-
-## Notes
-
-- **ERP requires `RESEND_API_KEY`** — it builds the Resend client at boot and
- crashes if empty. Use a real key or a non-empty placeholder. MES has no such
- requirement.
-- **`INNGEST_SIGNING_KEY` must be plain hex** (`openssl rand -hex 32`); the
- self-hosted inngest server rejects the `signkey-…` prefixed form.
-- **`SUPABASE_DB_URL` needs `?sslmode=disable`** for the self-hosted postgres
- (it runs without TLS). The `migrate` one-shot sets `PGSSLMODE=disable` for the
- same reason (the supabase CLI honors the env var reliably, the URL param not).
-- **`studio` may report `unhealthy`** — its image healthcheck expects the
- Supabase analytics service, which this stack omits. The UI still works; ignore
- it or drop the `studio` service if unwanted.
-- `VERIFY_JWT=false` on edge-runtime mirrors dev; Kong fronts the functions.
- Tighten to `true` if you call functions only with valid JWTs.
-- `realtime` `SECRET_KEY_BASE` / `DB_ENC_KEY` are internal-only; override
- `REALTIME_SECRET_KEY_BASE` in env for extra hygiene.
diff --git a/deploy/prod/deploy.sh b/deploy/prod/deploy.sh
deleted file mode 100755
index c5ee0dd556..0000000000
--- a/deploy/prod/deploy.sh
+++ /dev/null
@@ -1,169 +0,0 @@
-#!/usr/bin/env bash
-#
-# Carbon production deploy helper.
-#
-# Wraps the self-hosted docker-compose stack: generates the env file (with the
-# Supabase key trio + random secrets) and brings the stack up in the correct
-# order (postgres+storage -> migrate -> rest -> apps). See deploy/prod/README.md.
-#
-# Usage:
-# deploy/prod/deploy.sh init [--force] # create .env.production from template
-# deploy/prod/deploy.sh up # build + boot the full stack
-# deploy/prod/deploy.sh migrate # (re)apply DB migrations only
-# deploy/prod/deploy.sh down [--volumes] # stop the stack
-# deploy/prod/deploy.sh status # docker compose ps
-# deploy/prod/deploy.sh logs [service] # follow logs
-#
-set -euo pipefail
-
-readonly SCRIPT_NAME=$(basename "$0")
-readonly ROOT=$(cd "$(dirname "$0")/../.." && pwd)
-readonly COMPOSE_FILE="docker-compose.prod.yml"
-readonly ENV_FILE=".env.production"
-readonly ENV_EXAMPLE=".env.production.example"
-
-# ── output ───────────────────────────────────────────────────────────────────
-log() { printf '\033[0;36m[%s]\033[0m %s\n' "$(date '+%H:%M:%S')" "$*"; }
-warn() { printf '\033[0;33m[warn]\033[0m %s\n' "$*" >&2; }
-error() { printf '\033[0;31m[error]\033[0m %s\n' "$*" >&2; exit 1; }
-
-# ── compose wrapper (always run from repo root, with the env file) ────────────
-dc() { (cd "$ROOT" && docker compose -f "$COMPOSE_FILE" --env-file "$ENV_FILE" "$@"); }
-
-usage() {
- sed -n '3,16p' "$0" | sed 's/^# \{0,1\}//'
- exit "${1:-0}"
-}
-
-require_cmds() {
- local missing=()
- for c in "$@"; do command -v "$c" >/dev/null 2>&1 || missing+=("$c"); done
- [ ${#missing[@]} -eq 0 ] || error "missing required command(s): ${missing[*]}"
-}
-
-require_env_file() {
- [ -f "$ROOT/$ENV_FILE" ] || error "$ENV_FILE not found — run '$SCRIPT_NAME init' first"
-}
-
-# Set or replace KEY=VALUE in the env file (portable: awk + temp file, no
-# in-place sed flag differences across GNU/BSD). VALUE is written verbatim.
-upsert_env() {
- local key=$1 val=$2 file="$ROOT/$ENV_FILE" tmp
- tmp=$(mktemp)
- if grep -q "^${key}=" "$file"; then
- awk -v k="$key" -v v="$val" '
- $0 ~ "^" k "=" { print k "=" v; done=1; next }
- { print }
- ' "$file" >"$tmp"
- else
- cp "$file" "$tmp"
- printf '%s=%s\n' "$key" "$val" >>"$tmp"
- fi
- mv "$tmp" "$file"
-}
-
-# ── commands ──────────────────────────────────────────────────────────────────
-cmd_init() {
- require_cmds node openssl
- local force=0
- [ "${1:-}" = "--force" ] && force=1
-
- if [ -f "$ROOT/$ENV_FILE" ] && [ "$force" -ne 1 ]; then
- error "$ENV_FILE already exists (pass --force to overwrite)"
- fi
- [ -f "$ROOT/$ENV_EXAMPLE" ] || error "$ENV_EXAMPLE missing"
-
- log "Creating $ENV_FILE from template"
- cp "$ROOT/$ENV_EXAMPLE" "$ROOT/$ENV_FILE"
-
- log "Generating Supabase key trio"
- # gen-supabase-keys.mjs prints KEY=VALUE lines (jwt secret, anon, service).
- while IFS='=' read -r k v; do
- case "$k" in
- SUPABASE_JWT_SECRET|SUPABASE_ANON_KEY|SUPABASE_SERVICE_ROLE_KEY)
- upsert_env "$k" "$v" ;;
- esac
- done < <(node "$ROOT/scripts/gen-supabase-keys.mjs")
-
- log "Generating random secrets"
- local pg_pass session inngest_sign inngest_event
- pg_pass=$(openssl rand -hex 24)
- session=$(openssl rand -hex 32)
- inngest_sign=$(openssl rand -hex 32) # plain hex — inngest server rejects signkey- prefix
- inngest_event=$(openssl rand -hex 16)
-
- upsert_env POSTGRES_PASSWORD "$pg_pass"
- upsert_env SESSION_SECRET "$session"
- upsert_env INNGEST_SIGNING_KEY "$inngest_sign"
- upsert_env INNGEST_EVENT_KEY "$inngest_event"
- # Self-host postgres has no TLS; password must match POSTGRES_PASSWORD.
- upsert_env SUPABASE_DB_URL "postgresql://postgres:${pg_pass}@postgres:5432/postgres?sslmode=disable"
-
- log "$ENV_FILE created."
- warn "Before 'up', edit $ENV_FILE and set:"
- warn " ERP_HOST / MES_HOST / SUPABASE_HOST + matching *_URL + ACME_EMAIL"
- warn " RESEND_API_KEY (ERP fails to boot if empty — use a real key or placeholder)"
- warn " GOTRUE_SMTP_* (so Auth can send invites / magic links)"
-}
-
-cmd_up() {
- require_cmds docker
- require_env_file
-
- log "Building app images (erp, mes)"
- dc build erp mes
-
- log "Starting postgres + storage (waiting for healthy)"
- dc --profile data up -d --wait postgres storage
-
- log "Applying database migrations"
- dc --profile data run --rm migrate
-
- log "Starting remaining data-plane services"
- dc --profile data up -d \
- gotrue postgrest realtime meta studio kong edge-runtime redis inngest
-
- log "Starting apps + reverse proxy"
- dc up -d erp mes caddy
-
- log "Stack up. Check status: $SCRIPT_NAME status"
-}
-
-cmd_migrate() {
- require_cmds docker
- require_env_file
- dc --profile data up -d --wait postgres storage
- dc --profile data run --rm migrate
-}
-
-cmd_down() {
- require_cmds docker
- require_env_file
- if [ "${1:-}" = "--volumes" ]; then
- warn "Tearing down stack AND deleting volumes (data loss)"
- dc --profile data down -v --remove-orphans
- else
- dc --profile data down
- fi
-}
-
-cmd_status() { require_env_file; dc --profile data ps; }
-cmd_logs() { require_env_file; dc --profile data logs -f "${@:-}"; }
-
-# ── dispatch ──────────────────────────────────────────────────────────────────
-main() {
- local sub="${1:-}"
- [ $# -gt 0 ] && shift || true
- case "$sub" in
- init) cmd_init "$@" ;;
- up) cmd_up "$@" ;;
- migrate) cmd_migrate "$@" ;;
- down) cmd_down "$@" ;;
- status) cmd_status "$@" ;;
- logs) cmd_logs "$@" ;;
- -h|--help|help|"") usage 0 ;;
- *) error "unknown command: $sub (try '$SCRIPT_NAME --help')" ;;
- esac
-}
-
-main "$@"
diff --git a/docker-compose.prod.yml b/docker-compose.prod.yml
deleted file mode 100644
index b47ae19215..0000000000
--- a/docker-compose.prod.yml
+++ /dev/null
@@ -1,390 +0,0 @@
-###############################################################################
-# Carbon — production stack. Self-host everything on one host, or run apps-only
-# against managed backends.
-#
-# cp .env.production.example .env.production # then fill it in
-# node scripts/gen-supabase-keys.mjs # paste the 3 keys
-#
-# Self-host (full data plane):
-# docker compose -f docker-compose.prod.yml --env-file .env.production \
-# --profile data up -d postgres
-# docker compose ... --profile data run --rm migrate # apply schema
-# docker compose ... --profile data up -d # rest of data plane
-# docker compose ... up -d # erp + mes + caddy
-#
-# Managed backends: skip --profile data, set SUPABASE_*/REDIS_URL/INNGEST_* to
-# your external services, then `docker compose ... up -d`.
-#
-# Only caddy is published (80/443). Everything else stays on the internal net.
-###############################################################################
-
-name: carbon
-
-x-app-env: &app-env
- env_file:
- - .env.production
-
-services:
- # ─────────────────────────── Apps (always on) ──────────────────────────────
- erp:
- <<: *app-env
- build:
- context: .
- dockerfile: Dockerfile
- args:
- APP: erp
- image: carbon/erp:latest
- restart: unless-stopped
- environment:
- PORT: 3000
- NODE_ENV: production
- expose:
- - "3000"
- healthcheck:
- test: ["CMD", "curl", "-fsS", "http://localhost:3000/health"]
- interval: 15s
- timeout: 6s
- retries: 5
- start_period: 30s
-
- mes:
- <<: *app-env
- build:
- context: .
- dockerfile: Dockerfile
- args:
- APP: mes
- image: carbon/mes:latest
- restart: unless-stopped
- environment:
- PORT: 3000
- NODE_ENV: production
- expose:
- - "3000"
- healthcheck:
- test: ["CMD", "curl", "-fsS", "http://localhost:3000/health"]
- interval: 15s
- timeout: 6s
- retries: 5
- start_period: 30s
-
- caddy:
- image: caddy:2-alpine
- restart: unless-stopped
- depends_on:
- - erp
- - mes
- ports:
- - "80:80"
- - "443:443"
- environment:
- ERP_HOST: ${ERP_HOST}
- MES_HOST: ${MES_HOST}
- SUPABASE_HOST: ${SUPABASE_HOST}
- ACME_EMAIL: ${ACME_EMAIL}
- volumes:
- - ./deploy/prod/Caddyfile:/etc/caddy/Caddyfile:ro
- - caddy-data:/data
- - caddy-config:/config
-
- # ──────────────── Schema migrations (one-shot, self-host) ───────────────────
- # NOTE: deliberately does NOT load .env.production — env_file would inject
- # SUPABASE_DB_URL and the supabase CLI would use it over --db-url. Postgres
- # runs with ssl=off, and the CLI (pgx) only honors disable reliably via
- # PGSSLMODE (the ?sslmode=disable URL param is flaky). Storage must be up
- # first: an early migration INSERTs into storage.buckets, which storage-api
- # creates on boot (mirrors waitForStorageReady in dev).
- migrate:
- image: carbon/erp:latest
- profiles: ["data"]
- restart: "no"
- depends_on:
- postgres:
- condition: service_healthy
- storage:
- condition: service_healthy
- environment:
- PGSSLMODE: disable
- working_dir: /repo/packages/database
- command:
- - sh
- - -c
- - >
- pnpm exec supabase migration up --include-all
- --db-url postgresql://supabase_admin:${POSTGRES_PASSWORD}@postgres:5432/postgres
-
- # ──────────────────────── Data plane (--profile data) ───────────────────────
- postgres:
- image: supabase/postgres:15.14.1.112
- profiles: ["data"]
- restart: unless-stopped
- networks:
- default:
- aliases:
- - db
- environment:
- POSTGRES_HOST: /var/run/postgresql
- POSTGRES_PORT: 5432
- PGPORT: 5432
- POSTGRES_DB: postgres
- PGDATABASE: postgres
- POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
- PGPASSWORD: ${POSTGRES_PASSWORD}
- JWT_SECRET: ${SUPABASE_JWT_SECRET}
- JWT_EXP: 3600
- volumes:
- - pgdata:/var/lib/postgresql/data
- - pgconfig:/etc/postgresql-custom
- - ./deploy/prod/postgres/01-roles.sh:/docker-entrypoint-initdb.d/zz-carbon-roles.sh:ro
- command:
- - postgres
- - -c
- - config_file=/etc/postgresql/postgresql.conf
- healthcheck:
- test: ["CMD", "pg_isready", "-U", "postgres", "-h", "localhost"]
- interval: 5s
- timeout: 5s
- retries: 20
-
- gotrue:
- image: supabase/gotrue:v2.189.0
- profiles: ["data"]
- restart: unless-stopped
- depends_on:
- postgres:
- condition: service_healthy
- environment:
- GOTRUE_API_HOST: 0.0.0.0
- GOTRUE_API_PORT: 9999
- API_EXTERNAL_URL: ${SUPABASE_URL}
- GOTRUE_DB_DRIVER: postgres
- GOTRUE_DB_DATABASE_URL: postgres://supabase_auth_admin:${POSTGRES_PASSWORD}@postgres:5432/postgres
- GOTRUE_SITE_URL: ${ERP_URL}
- GOTRUE_URI_ALLOW_LIST: ${ERP_URL},${MES_URL}
- GOTRUE_DISABLE_SIGNUP: "true"
- GOTRUE_JWT_SECRET: ${SUPABASE_JWT_SECRET}
- GOTRUE_JWT_EXP: 3600
- GOTRUE_JWT_DEFAULT_GROUP_NAME: authenticated
- GOTRUE_JWT_ADMIN_ROLES: service_role
- GOTRUE_JWT_AUD: authenticated
- GOTRUE_EXTERNAL_EMAIL_ENABLED: "true"
- GOTRUE_MAILER_AUTOCONFIRM: "false"
- GOTRUE_SMTP_HOST: ${GOTRUE_SMTP_HOST}
- GOTRUE_SMTP_PORT: ${GOTRUE_SMTP_PORT}
- GOTRUE_SMTP_USER: ${GOTRUE_SMTP_USER}
- GOTRUE_SMTP_PASS: ${GOTRUE_SMTP_PASS}
- GOTRUE_SMTP_ADMIN_EMAIL: ${GOTRUE_SMTP_ADMIN_EMAIL}
- GOTRUE_SMTP_SENDER_NAME: Carbon
- GOTRUE_EXTERNAL_GOOGLE_ENABLED: ${GOOGLE_AUTH_ENABLED:-false}
- GOTRUE_EXTERNAL_GOOGLE_CLIENT_ID: ${SUPABASE_AUTH_EXTERNAL_GOOGLE_CLIENT_ID:-}
- GOTRUE_EXTERNAL_GOOGLE_SECRET: ${SUPABASE_AUTH_EXTERNAL_GOOGLE_CLIENT_SECRET:-}
- GOTRUE_EXTERNAL_GOOGLE_REDIRECT_URI: ${SUPABASE_AUTH_EXTERNAL_GOOGLE_REDIRECT_URI:-}
- GOTRUE_EXTERNAL_AZURE_ENABLED: ${AZURE_AUTH_ENABLED:-false}
- GOTRUE_EXTERNAL_AZURE_CLIENT_ID: ${SUPABASE_AUTH_EXTERNAL_AZURE_CLIENT_ID:-}
- GOTRUE_EXTERNAL_AZURE_SECRET: ${SUPABASE_AUTH_EXTERNAL_AZURE_CLIENT_SECRET:-}
- GOTRUE_EXTERNAL_AZURE_REDIRECT_URI: ${SUPABASE_AUTH_EXTERNAL_AZURE_REDIRECT_URI:-}
- GOTRUE_MAILER_TEMPLATES_MAGIC_LINK: ${ERP_URL}/templates/magic-link.html
- GOTRUE_MAILER_TEMPLATES_INVITE: ${ERP_URL}/templates/invite.html
-
- postgrest:
- image: postgrest/postgrest:v13.0.8
- profiles: ["data"]
- restart: unless-stopped
- depends_on:
- postgres:
- condition: service_healthy
- environment:
- PGRST_DB_URI: postgres://authenticator:${POSTGRES_PASSWORD}@postgres:5432/postgres
- PGRST_DB_SCHEMAS: public,storage,graphql_public
- PGRST_DB_ANON_ROLE: anon
- PGRST_JWT_SECRET: ${SUPABASE_JWT_SECRET}
- PGRST_DB_USE_LEGACY_GUCS: "false"
- PGRST_APP_SETTINGS_JWT_SECRET: ${SUPABASE_JWT_SECRET}
- PGRST_APP_SETTINGS_JWT_EXP: 3600
-
- realtime:
- image: supabase/realtime:v2.89.0
- profiles: ["data"]
- restart: unless-stopped
- depends_on:
- postgres:
- condition: service_healthy
- networks:
- default:
- aliases:
- - realtime-dev
- environment:
- PORT: 4000
- DB_HOST: postgres
- DB_PORT: 5432
- DB_USER: supabase_admin
- DB_PASSWORD: ${POSTGRES_PASSWORD}
- DB_NAME: postgres
- DB_AFTER_CONNECT_QUERY: 'SET search_path TO _realtime'
- DB_ENC_KEY: supabaserealtime
- API_JWT_SECRET: ${SUPABASE_JWT_SECRET}
- METRICS_JWT_SECRET: ${SUPABASE_JWT_SECRET}
- SECRET_KEY_BASE: ${REALTIME_SECRET_KEY_BASE:-UpNVntn3cDxHJpq99YMc1T1AQgQpc8kfYTuRgBiYa15BLrx8etQoXz3gZv1/u2oq}
- APP_NAME: realtime
- ERL_AFLAGS: -proto_dist inet_tcp
- DNS_NODES: "''"
- RLIMIT_NOFILE: "10000"
- SEED_SELF_HOST: "true"
- RUN_JANITOR: "true"
- DISABLE_HEALTHCHECK_LOGGING: "true"
-
- storage:
- image: supabase/storage-api:v1.58.4
- profiles: ["data"]
- restart: unless-stopped
- depends_on:
- postgres:
- condition: service_healthy
- environment:
- ANON_KEY: ${SUPABASE_ANON_KEY}
- SERVICE_KEY: ${SUPABASE_SERVICE_ROLE_KEY}
- POSTGREST_URL: http://postgrest:3000
- PGRST_JWT_SECRET: ${SUPABASE_JWT_SECRET}
- DATABASE_URL: postgres://supabase_storage_admin:${POSTGRES_PASSWORD}@postgres:5432/postgres
- FILE_SIZE_LIMIT: 52428800
- STORAGE_BACKEND: file
- FILE_STORAGE_BACKEND_PATH: /var/lib/storage
- TENANT_ID: stub
- REGION: stub
- GLOBAL_S3_BUCKET: stub
- ENABLE_IMAGE_TRANSFORMATION: "false"
- volumes:
- - storage:/var/lib/storage:z
- healthcheck:
- test:
- - CMD
- - node
- - -e
- - "fetch('http://localhost:5000/status').then(r=>process.exit(r.ok?0:1)).catch(()=>process.exit(1))"
- interval: 5s
- timeout: 5s
- retries: 30
-
- meta:
- image: supabase/postgres-meta:v0.96.5
- profiles: ["data"]
- restart: unless-stopped
- depends_on:
- postgres:
- condition: service_healthy
- environment:
- PG_META_PORT: 8080
- PG_META_DB_HOST: postgres
- PG_META_DB_PORT: 5432
- PG_META_DB_NAME: postgres
- PG_META_DB_USER: supabase_admin
- PG_META_DB_PASSWORD: ${POSTGRES_PASSWORD}
-
- studio:
- image: supabase/studio:2026.04.28-sha-89d08a2
- profiles: ["data"]
- restart: unless-stopped
- depends_on:
- meta:
- condition: service_started
- # Local-only admin UI — reach via SSH tunnel, never published publicly.
- ports:
- - "127.0.0.1:${STUDIO_PORT:-3900}:3000"
- environment:
- STUDIO_PG_META_URL: http://meta:8080
- POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
- DEFAULT_ORGANIZATION_NAME: Carbon
- DEFAULT_PROJECT_NAME: Carbon
- SUPABASE_URL: http://kong:8000
- SUPABASE_PUBLIC_URL: ${SUPABASE_URL}
- SUPABASE_ANON_KEY: ${SUPABASE_ANON_KEY}
- SUPABASE_SERVICE_KEY: ${SUPABASE_SERVICE_ROLE_KEY}
-
- edge-runtime:
- image: supabase/edge-runtime:v1.74.0
- profiles: ["data"]
- restart: unless-stopped
- depends_on:
- postgres:
- condition: service_healthy
- environment:
- JWT_SECRET: ${SUPABASE_JWT_SECRET}
- SUPABASE_URL: http://kong:8000
- SUPABASE_ANON_KEY: ${SUPABASE_ANON_KEY}
- SUPABASE_SERVICE_ROLE_KEY: ${SUPABASE_SERVICE_ROLE_KEY}
- SUPABASE_DB_URL: postgresql://postgres:${POSTGRES_PASSWORD}@postgres:5432/postgres
- VERIFY_JWT: "false"
- volumes:
- - ./packages/database/supabase/functions:/home/deno/functions:ro
- - ./packages/database/src:/home/src:ro
- - ./packages/dev/docker/edge-main:/home/deno/main:ro
- command:
- - start
- - --main-service
- - /home/deno/main
-
- kong:
- image: kong:2.8.1
- profiles: ["data"]
- restart: unless-stopped
- depends_on:
- - gotrue
- - postgrest
- - realtime
- - storage
- - meta
- - edge-runtime
- expose:
- - "8000"
- environment:
- KONG_DATABASE: "off"
- KONG_DECLARATIVE_CONFIG: /home/kong/kong.yml
- KONG_DNS_ORDER: LAST,A,CNAME
- KONG_PLUGINS: request-transformer,cors,key-auth,acl,basic-auth
- volumes:
- - ./packages/dev/docker/kong.yml:/home/kong/kong.yml:ro
-
- redis:
- image: redis:7-alpine
- profiles: ["data"]
- restart: unless-stopped
- command: redis-server --appendonly yes
- volumes:
- - redis-data:/data
- healthcheck:
- test: ["CMD", "redis-cli", "ping"]
- interval: 5s
- timeout: 3s
- retries: 5
-
- inngest:
- image: inngest/inngest:v1.19.4
- profiles: ["data"]
- restart: unless-stopped
- environment:
- INNGEST_EVENT_KEY: ${INNGEST_EVENT_KEY}
- INNGEST_SIGNING_KEY: ${INNGEST_SIGNING_KEY}
- # Self-hosted server. Discovers both apps over the internal network; sqlite
- # state persisted to the volume.
- command:
- - inngest
- - start
- - --sqlite-dir
- - /data
- - --sdk-url
- - http://erp:3000/api/inngest
- - --sdk-url
- - http://mes:3000/api/inngest
- expose:
- - "8288"
- volumes:
- - inngest:/data
-
-volumes:
- pgdata:
- pgconfig:
- storage:
- inngest:
- redis-data:
- caddy-data:
- caddy-config:
diff --git a/docs/app/api-reference/[module]/[resource]/page.tsx b/docs/app/api-reference/[module]/[resource]/page.tsx
index 12abcadd3a..1f55bf0285 100644
--- a/docs/app/api-reference/[module]/[resource]/page.tsx
+++ b/docs/app/api-reference/[module]/[resource]/page.tsx
@@ -31,14 +31,14 @@ export default async function ResourcePage(props: Params) {
const { module: mod, resource: r } = found;
return (
- <div className="max-w-[1180px]">
+ <div className="max-w-295">
<Breadcrumb
items={[{ label: "API", href: "/api-reference" }, { label: mod.name }]}
/>
- <h1 className="m-0 mt-[8px] text-[34px] font-[560] leading-[120%] text-[#262323]">
+ <h1 className="m-0 mt-2 text-ed-32 font-semi leading-[120%] text-ed-ink">
{r.name}
</h1>
- <p className="m-0 mt-[12px] max-w-[640px] text-[16.5px] leading-[160%] text-[rgba(38,35,35,0.8)]">
+ <p className="m-0 mt-3 max-w-160 text-ed-16 leading-[160%] text-ed-ink/80">
{r.description}
</p>
<BaseUrl path={r.endpoints[0]?.path ?? ""} />
diff --git a/docs/app/api-reference/authentication/page.tsx b/docs/app/api-reference/authentication/page.tsx
index 674ddc8344..869c1866bb 100644
--- a/docs/app/api-reference/authentication/page.tsx
+++ b/docs/app/api-reference/authentication/page.tsx
@@ -37,15 +37,15 @@ function Row({
}) {
return (
<div
- className="grid border-t border-[#E3E3DF] first:border-t-0"
+ className="grid border-t border-ed-warm-300 first:border-t-0"
style={{ gridTemplateColumns: cols }}
>
{cells.map((c, i) => (
<div
key={i}
- className={`px-[12px] py-[9px] text-[14px] leading-[150%] ${
- head ? "font-[560] text-[#262323]" : "text-[rgba(38,35,35,0.82)]"
- } ${i > 0 ? "border-l border-[#E3E3DF]" : ""}`}
+ className={`px-3 py-[9px] text-ed-14 leading-normal ${
+ head ? "font-semi text-ed-ink" : "text-ed-ink/82"
+ } ${i > 0 ? "border-l border-ed-warm-300" : ""}`}
>
{c}
</div>
@@ -56,7 +56,7 @@ function Row({
function Table({ children }: { children: ReactNode }) {
return (
- <div className="my-[18px] overflow-hidden rounded-[10px] border border-[#E3E3DF]">
+ <div className="my-[18px] overflow-hidden rounded-[10px] border border-ed-warm-300">
{children}
</div>
);
diff --git a/docs/app/api-reference/layout.tsx b/docs/app/api-reference/layout.tsx
index c2effcbb29..a602e4ac5f 100644
--- a/docs/app/api-reference/layout.tsx
+++ b/docs/app/api-reference/layout.tsx
@@ -13,7 +13,7 @@ export default function ApiReferenceLayout({
children: ReactNode;
}) {
return (
- <div className="min-h-screen w-full bg-[#FBFBF9]">
+ <div className="min-h-screen w-full bg-ed-paper">
<MainHeader
active="api"
mobileNav={
@@ -25,16 +25,16 @@ export default function ApiReferenceLayout({
/>
<ApiConfigProvider>
- <div className="mx-auto flex w-full max-w-[1480px] pt-[64px]">
- <aside className="sticky top-[64px] hidden h-[calc(100dvh-64px)] w-[280px] shrink-0 overflow-y-auto border-r border-[#E7E7E3] px-[20px] py-[28px] scrollbar-hidden-until-scroll nav-scroll-fade lg:block">
+ <div className="mx-auto flex w-full max-w-370 pt-16">
+ <aside className="sticky top-16 hidden h-[calc(100dvh-64px)] w-70 shrink-0 overflow-y-auto border-r border-ed-hairline px-5 py-7 scrollbar-hidden-until-scroll nav-scroll-fade lg:block">
<Configurator />
<ApiNav tree={navTree} />
<NavScrollChevron />
</aside>
- <main className="min-w-0 flex-1 px-[24px] pb-[140px] pt-[40px] lg:px-[56px]">
+ <main className="min-w-0 flex-1 px-6 pb-35 pt-10 lg:px-14">
{children}
</main>
- <aside className="hidden w-[232px] shrink-0 px-[28px] pt-[40px] xl:block">
+ <aside className="hidden w-58 shrink-0 px-7 pt-10 xl:block">
<TableOfContents />
</aside>
</div>
diff --git a/docs/app/docs/[[...slug]]/page.tsx b/docs/app/docs/[[...slug]]/page.tsx
index 5e854a7b96..5674270d35 100644
--- a/docs/app/docs/[[...slug]]/page.tsx
+++ b/docs/app/docs/[[...slug]]/page.tsx
@@ -44,7 +44,7 @@ export default async function Page(props: Params) {
const MDX = page.data.body;
return (
- <article className="max-w-[760px]">
+ <article className="max-w-190">
<Breadcrumb
items={[
{ label: "Reference", href: page.slugs.length ? "/docs" : undefined },
@@ -53,12 +53,12 @@ export default async function Page(props: Params) {
: [])
]}
/>
- <div className="mt-[14px] flex flex-wrap items-center gap-x-[14px] gap-y-[8px]">
+ <div className="mt-3.5 flex flex-wrap items-center gap-x-3.5 gap-y-2">
<h1 className="reference-title m-0">{page.data.title}</h1>
{page.data.plan && <PlanBadge plan={page.data.plan} />}
</div>
{page.data.description && (
- <p className="reference-desc m-0 mt-[12px]">{page.data.description}</p>
+ <p className="reference-desc m-0 mt-3">{page.data.description}</p>
)}
<div className="prose mt-[30px]">
<MDX
diff --git a/docs/app/docs/layout.tsx b/docs/app/docs/layout.tsx
index 670459e974..580c538de0 100644
--- a/docs/app/docs/layout.tsx
+++ b/docs/app/docs/layout.tsx
@@ -96,18 +96,18 @@ export default function ReferenceLayout({ children }: { children: ReactNode }) {
);
return (
- <div className="min-h-screen w-full bg-[#FBFBF9]">
+ <div className="min-h-screen w-full bg-ed-paper">
<MainHeader active="reference" mobileNav={<DocsNav tree={tree} />} />
- <div className="mx-auto flex w-full max-w-[1480px] pt-[64px]">
- <aside className="nav-scroll-fade sticky top-[64px] hidden h-[calc(100dvh-64px)] w-[280px] shrink-0 overflow-y-auto border-r border-[#E7E7E3] px-[20px] py-[28px] scrollbar-hidden-until-scroll lg:block">
+ <div className="mx-auto flex w-full max-w-370 pt-16">
+ <aside className="nav-scroll-fade sticky top-16 hidden h-[calc(100dvh-64px)] w-70 shrink-0 overflow-y-auto border-r border-ed-hairline px-5 py-7 scrollbar-hidden-until-scroll lg:block">
<DocsNav tree={tree} />
<NavScrollChevron />
</aside>
- <main className="min-w-0 flex-1 px-[24px] pb-[140px] pt-[40px] lg:px-[56px]">
+ <main className="min-w-0 flex-1 px-6 pb-35 pt-10 lg:px-14">
{children}
</main>
- <aside className="hidden w-[232px] shrink-0 px-[28px] pt-[40px] xl:block">
+ <aside className="hidden w-58 shrink-0 px-7 pt-10 xl:block">
<TableOfContents />
</aside>
</div>
diff --git a/docs/app/global.css b/docs/app/global.css
index f3f87aaa79..b8e79da92f 100644
--- a/docs/app/global.css
+++ b/docs/app/global.css
@@ -111,6 +111,58 @@
--color-ed-header: #f1f1ec; /* table header strip */
--color-ed-inset: #f6f6f1; /* expanded row panel */
--color-ed-row-hover: rgba(38, 35, 35, 0.025); /* row hover */
+
+ /* Long-tail editorial palette (Tier B). Warm-gray ramp consolidates a dozen
+ * near-identical border/surface grays into 5 stops; status + dark-surface +
+ * link families replace one-off hex literals. Light-only, like the set above. */
+ --color-ed-warm-100: #f5f5f2; /* warm-gray ramp: lightest surface … */
+ --color-ed-warm-150: #ecece7;
+ --color-ed-warm-300: #e3e3df;
+ --color-ed-warm-400: #dadad5;
+ --color-ed-warm-500: #d2d2cc; /* … darkest hairline */
+ --color-ed-text-faint: #c9c9c5; /* faint placeholder text */
+ --color-ed-text-muted: #9a9a96; /* muted secondary text */
+ --color-ed-graphite: #4b4b4a; /* mid-gray text (used with opacity) */
+ --color-ed-dark-bg: #1b1b1a; /* inverted/code surfaces */
+ --color-ed-dark-surface: #262624;
+ --color-ed-dark-line: #2a2a28;
+ --color-ed-dark-line-2: #3a3a38;
+ --color-ed-dark-line-3: #4a4a47;
+ --color-ed-green-bg: #e4f8da; /* success / diff-add */
+ --color-ed-green-border: #a8db91;
+ --color-ed-green-text: #4f9140;
+ --color-ed-green-strong: #3f9142;
+ --color-ed-red-bg: #fce8e6; /* error / diff-del */
+ --color-ed-red-border: #f2c0bc;
+ --color-ed-red: #b3261e;
+ --color-ed-red-bright: #e5484d;
+ --color-ed-blue-bg: #dff5ff; /* info / links (pairs with ed-brand) */
+ --color-ed-blue-bg-strong: #b2e7ff;
+ --color-ed-blue-border: #a9daf3;
+ --color-ed-blue-text: #0c6e96;
+ --color-ed-blue-mid: #3583a8;
+ --color-ed-blue-deep: #17729b;
+ --color-ed-brown: #a76451;
+
+ /* Editorial DM Sans weights between Tailwind's normal(400)/medium(500)/semibold(600). */
+ --font-weight-book: 460;
+ --font-weight-demi: 530;
+ --font-weight-semi: 560;
+
+ /* Editorial size ramp (font-size only, no line-height — pairs with explicit leading-*).
+ * Consolidated from a 0.5px-step sprawl into integer steps; named by px. */
+ --text-ed-10: 0.625rem;
+ --text-ed-11: 0.6875rem;
+ --text-ed-12: 0.75rem;
+ --text-ed-13: 0.8125rem;
+ --text-ed-14: 0.875rem;
+ --text-ed-15: 0.9375rem;
+ --text-ed-16: 1rem;
+ --text-ed-18: 1.125rem;
+ --text-ed-20: 1.25rem;
+ --text-ed-24: 1.5rem;
+ --text-ed-32: 2rem;
+ --text-ed-40: 2.5rem;
}
/* Map Fumadocs' own theme variables onto Carbon tokens — one palette everywhere */
diff --git a/docs/app/mcp/layout.tsx b/docs/app/mcp/layout.tsx
index 7b86e668ea..aff38685ce 100644
--- a/docs/app/mcp/layout.tsx
+++ b/docs/app/mcp/layout.tsx
@@ -9,7 +9,7 @@ import { toolsNavTree } from "@/lib/tools-data";
export default function McpLayout({ children }: { children: ReactNode }) {
return (
- <div className="min-h-screen w-full bg-[#FBFBF9]">
+ <div className="min-h-screen w-full bg-ed-paper">
<MainHeader
active="mcp"
mobileNav={
@@ -21,16 +21,16 @@ export default function McpLayout({ children }: { children: ReactNode }) {
/>
<ApiConfigProvider>
- <div className="mx-auto flex w-full max-w-[1480px] pt-[64px]">
- <aside className="sticky top-[64px] hidden h-[calc(100dvh-64px)] w-[280px] shrink-0 overflow-y-auto border-r border-[#E7E7E3] px-[20px] py-[28px] scrollbar-hidden-until-scroll nav-scroll-fade lg:block">
+ <div className="mx-auto flex w-full max-w-370 pt-16">
+ <aside className="sticky top-16 hidden h-[calc(100dvh-64px)] w-70 shrink-0 overflow-y-auto border-r border-ed-hairline px-5 py-7 scrollbar-hidden-until-scroll nav-scroll-fade lg:block">
<Configurator />
<McpNav tools={toolsNavTree} />
<NavScrollChevron />
</aside>
- <main className="min-w-0 flex-1 px-[24px] pb-[140px] pt-[40px] lg:px-[56px]">
+ <main className="min-w-0 flex-1 px-6 pb-35 pt-10 lg:px-14">
{children}
</main>
- <aside className="hidden w-[232px] shrink-0 px-[28px] pt-[40px] xl:block">
+ <aside className="hidden w-58 shrink-0 px-7 pt-10 xl:block">
<TableOfContents />
</aside>
</div>
diff --git a/docs/app/mcp/page.tsx b/docs/app/mcp/page.tsx
index ae043d832d..66f623e0d2 100644
--- a/docs/app/mcp/page.tsx
+++ b/docs/app/mcp/page.tsx
@@ -126,13 +126,13 @@ export default async function McpPage() {
<H2 id="ask">What you can ask</H2>
<P>Once connected, ask in natural language:</P>
- <ul className="m-0 mt-[12px] flex list-none flex-col gap-[8px] p-0">
+ <ul className="m-0 mt-3 flex list-none flex-col gap-2 p-0">
{PROMPTS.map((p) => (
<li
key={p}
- className="flex gap-[10px] text-[15px] leading-[160%] text-[rgba(38,35,35,0.82)]"
+ className="flex gap-2.5 text-ed-15 leading-[160%] text-ed-ink/82"
>
- <span className="mt-[9px] h-[5px] w-[5px] shrink-0 rounded-full bg-[rgba(38,35,35,0.4)]" />
+ <span className="mt-[9px] h-[5px] w-[5px] shrink-0 rounded-full bg-ed-ink/40" />
<span>{p}</span>
</li>
))}
diff --git a/docs/app/mcp/tools/[tool]/page.tsx b/docs/app/mcp/tools/[tool]/page.tsx
index a6471c39e0..5eb32b1cdc 100644
--- a/docs/app/mcp/tools/[tool]/page.tsx
+++ b/docs/app/mcp/tools/[tool]/page.tsx
@@ -26,9 +26,9 @@ export async function generateMetadata(props: Params): Promise<Metadata> {
}
const BADGE: Record<ToolClass, string> = {
- READ: "bg-[#E4F8DA] text-[#3F9142] border-[#A8DB91]",
- WRITE: "bg-[#DFF5FF] text-[#1E84B0] border-[#A9DAF3]",
- DESTRUCTIVE: "bg-[#FCE8E6] text-[#B3261E] border-[#F2C0BC]"
+ READ: "bg-ed-green-bg text-ed-green-strong border-ed-green-border",
+ WRITE: "bg-ed-blue-bg text-ed-brand-ink border-ed-blue-border",
+ DESTRUCTIVE: "bg-ed-red-bg text-ed-red border-ed-red-border"
};
type JsonProp = {
@@ -60,30 +60,30 @@ function Parameters({ schema }: { schema: unknown }) {
if (names.length === 0) return <P>This tool takes no arguments.</P>;
return (
- <div className="mt-[10px] divide-y divide-[#E7E7E3] border-t border-[#E7E7E3]">
+ <div className="mt-2.5 divide-y divide-ed-hairline border-t border-ed-hairline">
{names.map((name) => {
const p = props[name];
return (
<div key={name} className="py-[13px]">
- <div className="flex flex-wrap items-center gap-[8px]">
- <code className="font-[family-name:var(--font-mono)] text-[13.5px] text-[#262323]">
+ <div className="flex flex-wrap items-center gap-2">
+ <code className="font-mono text-ed-13 text-ed-ink">
{name}
</code>
- <span className="font-[family-name:var(--font-mono)] text-[12px] text-[rgba(38,35,35,0.54)]">
+ <span className="font-mono text-ed-12 text-ed-ink/54">
{propType(p)}
</span>
{required.has(name) ? (
- <span className="text-[11px] font-medium text-[#9C7136]">
+ <span className="text-ed-11 font-medium text-ed-amber-text">
required
</span>
) : (
- <span className="text-[11px] font-medium text-[rgba(38,35,35,0.48)]">
+ <span className="text-ed-11 font-medium text-ed-ink/48">
optional
</span>
)}
</div>
{p.description && (
- <p className="m-0 mt-[6px] text-[14.5px] leading-[150%] text-[rgba(38,35,35,0.74)]">
+ <p className="m-0 mt-1.5 text-ed-14 leading-normal text-ed-ink/74">
{p.description}
</p>
)}
@@ -145,12 +145,12 @@ export default async function ToolPage(props: Params) {
<Breadcrumb
items={[{ label: "MCP", href: "/mcp" }, { label: mod.name }]}
/>
- <div className="mt-[8px] flex flex-wrap items-center gap-[12px]">
- <h1 className="m-0 break-all font-[family-name:var(--font-mono)] text-[25px] font-[560] leading-[120%] text-[#262323]">
+ <div className="mt-2 flex flex-wrap items-center gap-3">
+ <h1 className="m-0 break-all font-mono text-ed-24 font-semi leading-[120%] text-ed-ink">
{t.name}
</h1>
<span
- className={`inline-flex shrink-0 items-center rounded-[6px] border px-[8px] py-[2px] font-[family-name:var(--font-mono)] text-[11px] font-semibold ${BADGE[t.classification]}`}
+ className={`inline-flex shrink-0 items-center rounded-md border px-2 py-0.5 font-mono text-ed-11 font-semibold ${BADGE[t.classification]}`}
>
{t.classification}
</span>
diff --git a/docs/app/not-found.tsx b/docs/app/not-found.tsx
index fd8f5c62e1..cf550f4360 100644
--- a/docs/app/not-found.tsx
+++ b/docs/app/not-found.tsx
@@ -34,7 +34,7 @@ function Arrow() {
viewBox="0 0 16 16"
fill="none"
aria-hidden
- className="shrink-0 -translate-x-[2px] text-[rgba(38,35,35,0.38)] transition-all duration-200 group-hover:translate-x-0 group-hover:text-[#262323]"
+ className="shrink-0 -translate-x-[2px] text-ed-ink/38 transition-all duration-200 group-hover:translate-x-0 group-hover:text-ed-ink"
>
<path
d="M3 8h9M8.5 4.5 12 8l-3.5 3.5"
@@ -49,18 +49,18 @@ function Arrow() {
export default function NotFound() {
return (
- <div className="min-h-screen w-full bg-[#FBFBF9] pt-[64px]">
+ <div className="min-h-screen w-full bg-ed-paper pt-16">
<MainHeader />
- <main className="mx-auto flex min-h-[calc(100vh-64px)] w-full max-w-[720px] flex-col items-center justify-center px-[24px] pb-[100px] text-center">
- <p className="font-[family-name:var(--font-mono)] text-[12.5px] font-[600] uppercase tracking-[0.18em] text-[rgba(38,35,35,0.5)]">
+ <main className="mx-auto flex min-h-[calc(100vh-64px)] w-full max-w-180 flex-col items-center justify-center px-6 pb-25 text-center">
+ <p className="font-mono text-ed-12 font-semibold uppercase tracking-[0.18em] text-ed-ink/50">
Error 404
</p>
{/* Ghosted numeral behind the headline for depth — the type-forward editorial look. */}
- <div className="relative mt-[12px] flex items-center justify-center">
+ <div className="relative mt-3 flex items-center justify-center">
<span
aria-hidden
- className="pointer-events-none absolute select-none font-[600] leading-none text-[180px] text-[rgba(38,35,35,0.05)] sm:text-[240px]"
+ className="pointer-events-none absolute select-none font-semibold leading-none text-[180px] text-ed-ink/5 sm:text-[240px]"
>
404
</span>
@@ -69,27 +69,27 @@ export default function NotFound() {
</h1>
</div>
- <p className="mt-[20px] max-w-[460px] text-[16px] leading-[165%] text-[rgba(38,35,35,0.7)]">
+ <p className="mt-5 max-w-115 text-ed-16 leading-[165%] text-ed-ink/70">
The link may be broken or the page may have moved. Jump back into the
docs below, or press{" "}
- <kbd className="inline-flex items-center rounded-[5px] border border-[#DEDEDA] bg-[#F5F5F2] px-[5px] py-[1px] font-[family-name:var(--font-mono)] text-[12px] text-[rgba(38,35,35,0.55)]">
+ <kbd className="inline-flex items-center rounded-[5px] border border-ed-warm-300 bg-ed-warm-100 px-[5px] py-px font-mono text-ed-12 text-ed-ink/55">
⌘K
</kbd>{" "}
to search everything.
</p>
- <div className="mt-[40px] grid w-full grid-cols-1 gap-[12px] sm:grid-cols-2">
+ <div className="mt-10 grid w-full grid-cols-1 gap-3 sm:grid-cols-2">
{LINKS.map((l) => (
<Link
key={l.href}
href={l.href}
- className="group flex items-center justify-between gap-[12px] rounded-[12px] border border-[#E7E7E3] bg-[#FBFBF8] px-[18px] py-[15px] text-left no-underline shadow-[inset_0_1px_0_#fff] transition-colors hover:border-[#D9D9D3] hover:bg-white"
+ className="group flex items-center justify-between gap-3 rounded-xl border border-ed-hairline bg-ed-paper px-[18px] py-[15px] text-left no-underline shadow-[inset_0_1px_0_#fff] transition-colors hover:border-ed-warm-400 hover:bg-white"
>
<span className="min-w-0">
- <span className="block text-[15px] font-[560] text-ink">
+ <span className="block text-ed-15 font-semi text-ink">
{l.label}
</span>
- <span className="mt-[3px] block text-[13.5px] leading-[150%] text-[rgba(38,35,35,0.6)]">
+ <span className="mt-[3px] block text-ed-13 leading-normal text-ed-ink/60">
{l.desc}
</span>
</span>
@@ -100,17 +100,17 @@ export default function NotFound() {
<Link
href="/guides/order"
- className="group relative mt-[36px] inline-flex h-[44px] items-center justify-center rounded-[8px] px-[20px] no-underline"
+ className="group relative mt-9 inline-flex h-11 items-center justify-center rounded-lg px-5 no-underline"
>
<span
aria-hidden
- className="pointer-events-none absolute inset-0 rounded-[8px] cta-btn-dark"
+ className="pointer-events-none absolute inset-0 rounded-lg cta-btn-dark"
/>
<span
aria-hidden
- className="pointer-events-none absolute inset-0 rounded-[8px] btn-dark-hover opacity-0 transition-opacity duration-200 ease-out group-hover:opacity-100"
+ className="pointer-events-none absolute inset-0 rounded-lg btn-dark-hover opacity-0 transition-opacity duration-200 ease-out group-hover:opacity-100"
/>
- <span className="text-on-dark relative z-10 text-[14px] font-[460] tracking-[0.15px]">
+ <span className="text-on-dark relative z-10 text-ed-14 font-book tracking-[0.15px]">
Back to the guide
</span>
</Link>
diff --git a/docs/components/api/api-nav.tsx b/docs/components/api/api-nav.tsx
index 8fd416c193..f3137b7aa4 100644
--- a/docs/components/api/api-nav.tsx
+++ b/docs/components/api/api-nav.tsx
@@ -6,10 +6,10 @@ import { useEffect, useRef, useState } from "react";
import type { NavModule } from "@/lib/api-data";
const METHOD_COLOR: Record<string, string> = {
- GET: "text-[#3F9142]",
- POST: "text-[#1E84B0]",
- PATCH: "text-[#9C7136]",
- DELETE: "text-[#B3261E]",
+ GET: "text-ed-green-strong",
+ POST: "text-ed-brand-ink",
+ PATCH: "text-ed-amber-text",
+ DELETE: "text-ed-red",
};
const METHOD_ABBR: Record<string, string> = {
GET: "GET",
@@ -24,11 +24,11 @@ const REST_API = [
{ label: "Authentication", href: "/api-reference/authentication" },
];
-const GS_ACTIVE = "bg-[rgba(0,176,255,0.10)] font-[530] text-[#1E84B0]";
-const GS_IDLE = "text-[rgba(38,35,35,0.8)] hover:bg-[rgba(231,231,227,0.55)] hover:text-[#262323]";
+const GS_ACTIVE = "bg-ed-brand/10 font-demi text-ed-brand-ink";
+const GS_IDLE = "text-ed-ink/80 hover:bg-ed-hairline/55 hover:text-ed-ink";
const SECTION_LABEL =
- "m-0 mb-[3px] px-[8px] py-[6px] font-[family-name:var(--font-mono)] text-[12.5px] font-[600] uppercase tracking-[0.06em] text-[rgba(38,35,35,0.6)]";
-const GS_LINK = "block rounded-[6px] px-[8px] py-[3.5px] text-[14.5px] leading-[135%] transition-colors";
+ "m-0 mb-[3px] px-2 py-1.5 font-mono text-ed-12 font-semibold uppercase tracking-[0.06em] text-ed-ink/60";
+const GS_LINK = "block rounded-md px-2 py-[3.5px] text-ed-14 leading-[135%] transition-colors";
function Chevron({ open }: { open: boolean }) {
return (
@@ -82,8 +82,8 @@ export function ApiNav({ tree }: { tree: NavModule[] }) {
return (
<div>
- <nav className="flex flex-col gap-[2px]">
- <div className="mb-[10px]">
+ <nav className="flex flex-col gap-0.5">
+ <div className="mb-2.5">
<p className={SECTION_LABEL}>REST API</p>
{REST_API.map((item) => (
<Link
@@ -111,21 +111,21 @@ export function ApiNav({ tree }: { tree: NavModule[] }) {
return next;
})
}
- className="flex w-full items-center justify-between gap-[8px] rounded-[7px] px-[8px] py-[5px] transition-colors hover:bg-[rgba(231,231,227,0.5)]"
+ className="flex w-full items-center justify-between gap-2 rounded-[7px] px-2 py-[5px] transition-colors hover:bg-ed-hairline/50"
>
<span className="flex items-center gap-[7px]">
<Chevron open={isOpen} />
- <span className="font-[family-name:var(--font-mono)] text-[12.5px] font-[600] uppercase tracking-[0.06em] text-[rgba(38,35,35,0.6)]">
+ <span className="font-mono text-ed-12 font-semibold uppercase tracking-[0.06em] text-ed-ink/60">
{m.name}
</span>
</span>
- <span className="font-[family-name:var(--font-mono)] text-[12px] tabular-nums text-[rgba(38,35,35,0.42)]">
+ <span className="font-mono text-ed-12 tabular-nums text-ed-ink/42">
{m.resources.length}
</span>
</button>
{isOpen && (
- <ul className="mt-[2px] mb-[6px] ml-[13px] list-none border-l border-[#ECECE7] py-[2px] pl-[8px]">
+ <ul className="mt-0.5 mb-1.5 ml-[13px] list-none border-l border-ed-warm-150 py-0.5 pl-2">
{m.resources.map((r) => {
const isActive = activeModule === m.slug && activeResource === r.slug;
const href = `/api-reference/${m.slug}/${r.slug}`;
@@ -135,7 +135,7 @@ export function ApiNav({ tree }: { tree: NavModule[] }) {
ref={isActive ? activeRef : undefined}
href={href}
title={`${r.name} · ${r.kind}`}
- className={`flex items-center gap-[7px] rounded-[6px] px-[8px] py-[3.5px] text-[14.5px] leading-[135%] transition-colors ${
+ className={`flex items-center gap-[7px] rounded-md px-2 py-[3.5px] text-ed-14 leading-[135%] transition-colors ${
isActive ? GS_ACTIVE : GS_IDLE
}`}
>
@@ -143,15 +143,15 @@ export function ApiNav({ tree }: { tree: NavModule[] }) {
<span className="truncate">{r.name}</span>
</Link>
{isActive && r.endpoints.length > 0 && (
- <ul className="m-0 mt-[2px] mb-[6px] list-none p-0">
+ <ul className="m-0 mt-0.5 mb-1.5 list-none p-0">
{r.endpoints.map((e) => (
<li key={e.id}>
<a
href={`${href}#${e.id}`}
- className="flex items-center gap-[9px] rounded-[6px] py-[3px] pr-[8px] pl-[12px] text-[13px] text-[rgba(38,35,35,0.66)] transition-colors hover:text-[#262323]"
+ className="flex items-center gap-[9px] rounded-md py-[3px] pr-2 pl-3 text-ed-13 text-ed-ink/66 transition-colors hover:text-ed-ink"
>
<span
- className={`w-[30px] shrink-0 font-[family-name:var(--font-mono)] text-[10px] font-semibold tracking-[0.03em] ${
+ className={`w-[30px] shrink-0 font-mono text-ed-10 font-semibold tracking-[0.03em] ${
METHOD_COLOR[e.method] || ""
}`}
>
diff --git a/docs/components/api/base-url.tsx b/docs/components/api/base-url.tsx
index 0713edca70..71aaa06ffd 100644
--- a/docs/components/api/base-url.tsx
+++ b/docs/components/api/base-url.tsx
@@ -6,8 +6,8 @@ import { useApiConfig } from "./config-context";
export function BaseUrl({ path }: { path: string }) {
const { base } = useApiConfig();
return (
- <div className="mt-[18px] mb-[32px] flex w-fit items-center gap-[10px] rounded-[8px] border border-[#E7E7E3] bg-white px-[12px] py-[8px] font-[family-name:var(--font-mono)] text-[13.5px] text-[rgba(38,35,35,0.8)]">
- <span className="text-[rgba(38,35,35,0.5)]">Base</span>
+ <div className="mt-[18px] mb-8 flex w-fit items-center gap-2.5 rounded-lg border border-ed-hairline bg-white px-3 py-2 font-mono text-ed-13 text-ed-ink/80">
+ <span className="text-ed-ink/50">Base</span>
{base}
{path}
</div>
diff --git a/docs/components/api/breadcrumb.tsx b/docs/components/api/breadcrumb.tsx
index d1f487a284..e882ad3a50 100644
--- a/docs/components/api/breadcrumb.tsx
+++ b/docs/components/api/breadcrumb.tsx
@@ -12,24 +12,24 @@ export function Breadcrumb({ items }: { items: Crumb[] }) {
return (
<nav
aria-label="Breadcrumb"
- className="flex flex-wrap items-center font-[family-name:var(--font-mono)] text-[12.5px] leading-[16px]"
+ className="flex flex-wrap items-center font-mono text-ed-12 leading-4"
>
{items.map((c, i) => (
<Fragment key={`${c.label}-${i}`}>
{i > 0 && (
- <span aria-hidden="true" className="px-[7px] text-[rgba(38,35,35,0.3)]">
+ <span aria-hidden="true" className="px-[7px] text-ed-ink/30">
/
</span>
)}
{c.href ? (
<Link
href={c.href}
- className="text-[rgba(38,35,35,0.5)] no-underline transition-colors hover:text-[#262323]"
+ className="text-ed-ink/50 no-underline transition-colors hover:text-ed-ink"
>
{c.label}
</Link>
) : (
- <span className="text-[rgba(38,35,35,0.72)]">{c.label}</span>
+ <span className="text-ed-ink/72">{c.label}</span>
)}
</Fragment>
))}
diff --git a/docs/components/api/code-block.tsx b/docs/components/api/code-block.tsx
index a4cdf191f1..11ac3932c7 100644
--- a/docs/components/api/code-block.tsx
+++ b/docs/components/api/code-block.tsx
@@ -13,7 +13,7 @@ function CopyButton({ text }: { text: string }) {
setCopied(true);
setTimeout(() => setCopied(false), 1400);
}}
- className="absolute top-[10px] right-[10px] z-10 rounded-[6px] border border-[#3A3A38] bg-[#262624] px-[8px] py-[3px] font-[family-name:var(--font-mono)] text-[11px] text-[#C9C9C5] transition-colors hover:border-[#4A4A47] hover:text-white"
+ className="absolute top-2.5 right-2.5 z-10 rounded-md border border-ed-dark-line-2 bg-ed-dark-surface px-2 py-[3px] font-mono text-ed-11 text-ed-text-faint transition-colors hover:border-ed-dark-line-3 hover:text-white"
>
{copied ? "Copied" : "Copy"}
</button>
@@ -24,10 +24,10 @@ function CopyButton({ text }: { text: string }) {
export function CodeBlock({ html, code, label }: { html: string; code: string; label?: string }) {
const { base, apiKey } = useApiConfig();
return (
- <div className="my-[18px] overflow-hidden rounded-[12px] border border-[#2A2A28] bg-[#1B1B1A]">
+ <div className="my-[18px] overflow-hidden rounded-xl border border-ed-dark-line bg-ed-dark-bg">
{label && (
- <div className="flex h-[38px] items-center border-b border-[#2A2A28] px-[14px]">
- <span className="font-[family-name:var(--font-mono)] text-[11.5px] tracking-[0.03em] text-[#9A9A96]">
+ <div className="flex h-[38px] items-center border-b border-ed-dark-line px-3.5">
+ <span className="font-mono text-ed-11 tracking-[0.03em] text-ed-text-muted">
{label}
</span>
</div>
diff --git a/docs/components/api/code-panel.tsx b/docs/components/api/code-panel.tsx
index f8c6173b5f..b1a2b8b793 100644
--- a/docs/components/api/code-panel.tsx
+++ b/docs/components/api/code-panel.tsx
@@ -22,7 +22,7 @@ function CopyButton({ text }: { text: string }) {
setCopied(true);
setTimeout(() => setCopied(false), 1400);
}}
- className="absolute top-[10px] right-[10px] z-10 rounded-[6px] border border-[#3A3A38] bg-[#262624] px-[8px] py-[3px] font-[family-name:var(--font-mono)] text-[11px] text-[#C9C9C5] transition-colors hover:border-[#4A4A47] hover:text-white"
+ className="absolute top-2.5 right-2.5 z-10 rounded-md border border-ed-dark-line-2 bg-ed-dark-surface px-2 py-[3px] font-mono text-ed-11 text-ed-text-faint transition-colors hover:border-ed-dark-line-3 hover:text-white"
>
{copied ? "Copied" : "Copy"}
</button>
@@ -44,10 +44,10 @@ function LangSelect({
aria-label="Code language"
value={value}
onChange={(e) => onChange(e.target.value as keyof ApiSamples)}
- className="cursor-pointer appearance-none rounded-[6px] border border-[#3A3A38] bg-[#262624] py-[4px] pl-[10px] pr-[26px] font-[family-name:var(--font-mono)] text-[12px] text-[#C9C9C5] transition-colors hover:border-[#4A4A47] hover:text-white focus:border-[#4A4A47] focus:outline-none"
+ className="cursor-pointer appearance-none rounded-md border border-ed-dark-line-2 bg-ed-dark-surface py-1 pl-2.5 pr-[26px] font-mono text-ed-12 text-ed-text-faint transition-colors hover:border-ed-dark-line-3 hover:text-white focus:border-ed-dark-line-3 focus:outline-none"
>
{LANGS.map((l) => (
- <option key={l.key} value={l.key} className="bg-[#1B1B1A] text-[#C9C9C5]">
+ <option key={l.key} value={l.key} className="bg-ed-dark-bg text-ed-text-faint">
{l.label}
</option>
))}
@@ -74,7 +74,7 @@ function LangSelect({
function Panel({ children }: { children: React.ReactNode }) {
return (
- <div className="overflow-hidden rounded-[12px] border border-[#2A2A28] bg-[#1B1B1A] shadow-[0_1px_2px_rgba(0,0,0,0.06)]">
+ <div className="overflow-hidden rounded-xl border border-ed-dark-line bg-ed-dark-bg shadow-[0_1px_2px_rgba(0,0,0,0.06)]">
{children}
</div>
);
@@ -99,12 +99,12 @@ export function CodePanel({
const { base, apiKey } = useApiConfig();
return (
- <div className="sticky top-[88px] flex flex-col gap-[16px]">
+ <div className="sticky top-22 flex flex-col gap-4">
<Panel>
- <div className="flex h-[44px] items-center justify-between gap-[8px] border-b border-[#2A2A28] pr-[8px] pl-[14px]">
- <div className="flex min-w-0 items-center gap-[8px]">
+ <div className="flex h-11 items-center justify-between gap-2 border-b border-ed-dark-line pr-2 pl-3.5">
+ <div className="flex min-w-0 items-center gap-2">
<MethodBadge method={method} />
- <span className="truncate font-[family-name:var(--font-mono)] text-[12px] text-[#9A9A96]">
+ <span className="truncate font-mono text-ed-12 text-ed-text-muted">
{applyBase(fullPath, base)}
</span>
</div>
@@ -124,8 +124,8 @@ export function CodePanel({
{response ? (
<Panel>
- <div className="flex h-[40px] items-center border-b border-[#2A2A28] px-[14px]">
- <span className="font-[family-name:var(--font-mono)] text-[12px] tracking-[0.04em] text-[#9A9A96]">
+ <div className="flex h-10 items-center border-b border-ed-dark-line px-3.5">
+ <span className="font-mono text-ed-12 tracking-[0.04em] text-ed-text-muted">
Response
</span>
</div>
@@ -136,7 +136,7 @@ export function CodePanel({
/>
</Panel>
) : (
- <div className="rounded-[10px] border border-[#E7E7E3] bg-[#FBFBF8] px-[14px] py-[12px] font-[family-name:var(--font-mono)] text-[13px] text-[rgba(38,35,35,0.63)]">
+ <div className="rounded-[10px] border border-ed-hairline bg-ed-paper px-3.5 py-3 font-mono text-ed-13 text-ed-ink/63">
204 No Content
</div>
)}
diff --git a/docs/components/api/configurator.tsx b/docs/components/api/configurator.tsx
index f9c0178842..f9873e8433 100644
--- a/docs/components/api/configurator.tsx
+++ b/docs/components/api/configurator.tsx
@@ -79,19 +79,19 @@ function ModeCard({
<button
type="button"
onClick={onClick}
- className={`relative flex flex-col items-start gap-[2px] rounded-[10px] border px-[12px] py-[10px] text-left transition-colors ${
+ className={`relative flex flex-col items-start gap-0.5 rounded-[10px] border px-3 py-2.5 text-left transition-colors ${
active
- ? "border-[#00B0FF] bg-[rgba(0,176,255,0.07)]"
- : "border-[#E3E3DF] bg-white hover:border-[#CFCFC9]"
+ ? "border-ed-brand bg-ed-brand/7"
+ : "border-ed-warm-300 bg-white hover:border-ed-warm-500"
}`}
>
- <span className={`text-[13.5px] font-[560] ${active ? "text-[#1E84B0]" : "text-[#262323]"}`}>
+ <span className={`text-ed-13 font-semi ${active ? "text-ed-brand-ink" : "text-ed-ink"}`}>
{title}
</span>
- <span className="font-[family-name:var(--font-mono)] text-[11.5px] text-[rgba(38,35,35,0.5)]">
+ <span className="font-mono text-ed-11 text-ed-ink/50">
{sub}
</span>
- {active && <Check className="absolute right-[10px] top-[10px] text-[#1E84B0]" />}
+ {active && <Check className="absolute right-2.5 top-2.5 text-ed-brand-ink" />}
</button>
);
}
@@ -145,22 +145,22 @@ export function Configurator() {
<Dialog.Trigger asChild>
<button
type="button"
- className="group mb-[14px] flex w-full items-center gap-[8px] rounded-[8px] border border-[#E3E3DF] bg-white px-[10px] py-[8px] text-left text-[rgba(38,35,35,0.58)] transition-colors hover:border-[#CFCFC9] data-[state=open]:border-[#CFCFC9]"
+ className="group mb-3.5 flex w-full items-center gap-2 rounded-lg border border-ed-warm-300 bg-white px-2.5 py-2 text-left text-ed-ink/58 transition-colors hover:border-ed-warm-500 data-[state=open]:border-ed-warm-500"
>
<ServerIcon />
- <span className="min-w-0 flex-1 truncate font-[family-name:var(--font-mono)] text-[13px] text-[#262323]">
+ <span className="min-w-0 flex-1 truncate font-mono text-ed-13 text-ed-ink">
{host}
</span>
{apiKey && (
<span
title="API key set"
- className="inline-flex items-center gap-[3px] rounded-[5px] bg-[rgba(79,145,64,0.12)] px-[5px] py-[2px] text-[#4F9140]"
+ className="inline-flex items-center gap-[3px] rounded-[5px] bg-ed-green-text/12 px-[5px] py-0.5 text-ed-green-text"
>
<KeyIcon />
</span>
)}
<svg
- className="shrink-0 text-[rgba(38,35,35,0.48)] transition-transform group-data-[state=open]:rotate-180"
+ className="shrink-0 text-ed-ink/48 transition-transform group-data-[state=open]:rotate-180"
width="11"
height="11"
viewBox="0 0 12 12"
@@ -172,19 +172,19 @@ export function Configurator() {
</Dialog.Trigger>
<Dialog.Portal>
- <Dialog.Overlay className="fixed inset-0 z-[100] bg-[rgba(38,35,35,0.32)] backdrop-blur-[2px] data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0" />
- <Dialog.Content className="fixed left-1/2 top-[50%] z-[101] flex w-[calc(100vw-32px)] max-w-[440px] -translate-x-1/2 -translate-y-1/2 flex-col overflow-hidden rounded-[14px] border border-[#E3E3DF] bg-[#FBFBF8] shadow-[0_24px_60px_-12px_rgba(38,35,35,0.28)] data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95">
+ <Dialog.Overlay className="fixed inset-0 z-[100] bg-ed-ink/32 backdrop-blur-[2px] data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0" />
+ <Dialog.Content className="fixed left-1/2 top-[50%] z-[101] flex w-[calc(100vw-32px)] max-w-110 -translate-x-1/2 -translate-y-1/2 flex-col overflow-hidden rounded-[14px] border border-ed-warm-300 bg-ed-paper shadow-[0_24px_60px_-12px_rgba(38,35,35,0.28)] data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95">
{/* Header */}
- <div className="flex items-start justify-between gap-[12px] border-b border-[#EAEAE6] px-[20px] py-[16px]">
+ <div className="flex items-start justify-between gap-3 border-b border-ed-warm-150 px-5 py-4">
<div>
- <Dialog.Title className="m-0 text-[16px] font-[560] text-ink">API configuration</Dialog.Title>
- <Dialog.Description className="m-0 mt-[3px] text-[13px] leading-[150%] text-[rgba(38,35,35,0.6)]">
+ <Dialog.Title className="m-0 text-ed-16 font-semi text-ink">API configuration</Dialog.Title>
+ <Dialog.Description className="m-0 mt-[3px] text-ed-13 leading-normal text-ed-ink/60">
Tune the base URL and key used across the code samples.
</Dialog.Description>
</div>
<Dialog.Close
aria-label="Close"
- className="-mr-[4px] -mt-[2px] shrink-0 rounded-[7px] p-[5px] text-[rgba(38,35,35,0.5)] transition-colors hover:bg-[rgba(231,231,227,0.7)] hover:text-[#262323]"
+ className="-mr-[4px] -mt-[2px] shrink-0 rounded-[7px] p-[5px] text-ed-ink/50 transition-colors hover:bg-ed-hairline/70 hover:text-ed-ink"
>
<svg width="15" height="15" viewBox="0 0 16 16" fill="none" aria-hidden>
<path d="M4 4l8 8M12 4l-8 8" stroke="currentColor" strokeWidth="1.4" strokeLinecap="round" />
@@ -193,17 +193,17 @@ export function Configurator() {
</div>
{/* Body */}
- <div className="flex flex-col gap-[18px] px-[20px] py-[18px]">
+ <div className="flex flex-col gap-[18px] px-5 py-[18px]">
<section>
- <p className="m-0 mb-[8px] font-[family-name:var(--font-mono)] text-[11px] font-[600] uppercase tracking-[0.07em] text-[rgba(38,35,35,0.5)]">
+ <p className="m-0 mb-2 font-mono text-ed-11 font-semibold uppercase tracking-[0.07em] text-ed-ink/50">
Environment
</p>
- <div className="grid grid-cols-2 gap-[8px]">
+ <div className="grid grid-cols-2 gap-2">
<ModeCard active={mode === "cloud"} onClick={() => setMode("cloud")} title="Carbon Cloud" sub="rest.carbon.ms" />
<ModeCard active={mode === "self"} onClick={() => setMode("self")} title="Self-hosted" sub="Your instance" />
</div>
{mode === "self" && (
- <div className="mt-[8px]">
+ <div className="mt-2">
<input
value={url}
autoFocus
@@ -216,19 +216,19 @@ export function Configurator() {
}}
placeholder="https://api.your-domain.com"
aria-invalid={!!urlError}
- className={`w-full rounded-[8px] border bg-white px-[11px] py-[9px] font-[family-name:var(--font-mono)] text-[12.5px] text-[#262323] outline-none placeholder:text-[rgba(38,35,35,0.42)] ${
- urlError ? "border-[#E5484D] focus:border-[#E5484D]" : "border-[#E3E3DF] focus:border-[#00B0FF]"
+ className={`w-full rounded-lg border bg-white px-[11px] py-[9px] font-mono text-ed-12 text-ed-ink outline-none placeholder:text-ed-ink/42 ${
+ urlError ? "border-ed-red-bright focus:border-ed-red-bright" : "border-ed-warm-300 focus:border-ed-brand"
}`}
/>
{urlError && (
- <p className="mt-[5px] text-[11.5px] leading-[1.3] text-[#E5484D]">{urlError}</p>
+ <p className="mt-[5px] text-ed-11 leading-[1.3] text-ed-red-bright">{urlError}</p>
)}
</div>
)}
</section>
<section>
- <p className="m-0 mb-[8px] font-[family-name:var(--font-mono)] text-[11px] font-[600] uppercase tracking-[0.07em] text-[rgba(38,35,35,0.5)]">
+ <p className="m-0 mb-2 font-mono text-ed-11 font-semibold uppercase tracking-[0.07em] text-ed-ink/50">
API key
</p>
<div className="relative">
@@ -242,26 +242,26 @@ export function Configurator() {
placeholder="crbn_…"
autoComplete="off"
spellCheck={false}
- className="w-full rounded-[8px] border border-[#E3E3DF] bg-white py-[9px] pl-[11px] pr-[38px] font-[family-name:var(--font-mono)] text-[12.5px] text-[#262323] outline-none transition-colors placeholder:text-[rgba(38,35,35,0.42)] focus:border-[#00B0FF]"
+ className="w-full rounded-lg border border-ed-warm-300 bg-white py-[9px] pl-[11px] pr-[38px] font-mono text-ed-12 text-ed-ink outline-none transition-colors placeholder:text-ed-ink/42 focus:border-ed-brand"
/>
{key && (
<button
type="button"
aria-label={showKey ? "Hide key" : "Show key"}
onClick={() => setShowKey((s) => !s)}
- className="absolute right-[6px] top-1/2 -translate-y-1/2 rounded-[6px] p-[5px] text-[rgba(38,35,35,0.5)] transition-colors hover:bg-[rgba(231,231,227,0.7)] hover:text-[#262323]"
+ className="absolute right-1.5 top-1/2 -translate-y-1/2 rounded-md p-[5px] text-ed-ink/50 transition-colors hover:bg-ed-hairline/70 hover:text-ed-ink"
>
<EyeIcon off={showKey} />
</button>
)}
</div>
- <p className="m-0 mt-[7px] text-[12px] leading-[150%] text-[rgba(38,35,35,0.55)]">
+ <p className="m-0 mt-[7px] text-ed-12 leading-normal text-ed-ink/55">
Stored in this browser only and dropped into the samples. Never sent to Carbon.{" "}
<a
href="https://app.carbon.ms/x/settings/api-keys"
target="_blank"
rel="noreferrer"
- className="text-[#1E84B0] no-underline hover:underline"
+ className="text-ed-brand-ink no-underline hover:underline"
>
Create a key ↗
</a>
@@ -270,22 +270,22 @@ export function Configurator() {
</div>
{/* Footer */}
- <div className="flex items-center justify-between gap-[10px] border-t border-[#EAEAE6] px-[20px] py-[14px]">
+ <div className="flex items-center justify-between gap-2.5 border-t border-ed-warm-150 px-5 py-3.5">
<button
type="button"
onClick={reset}
- className="rounded-[8px] px-[10px] py-[8px] text-[13px] font-[460] text-[rgba(38,35,35,0.6)] transition-colors hover:bg-[rgba(231,231,227,0.7)] hover:text-[#262323]"
+ className="rounded-lg px-2.5 py-2 text-ed-13 font-book text-ed-ink/60 transition-colors hover:bg-ed-hairline/70 hover:text-ed-ink"
>
Reset to defaults
</button>
<button
type="button"
onClick={save}
- className="group relative inline-flex h-[38px] items-center justify-center rounded-[8px] px-[18px]"
+ className="group relative inline-flex h-[38px] items-center justify-center rounded-lg px-[18px]"
>
- <span aria-hidden className="pointer-events-none absolute inset-0 rounded-[8px] cta-btn-dark" />
- <span aria-hidden className="pointer-events-none absolute inset-0 rounded-[8px] btn-dark-hover opacity-0 transition-opacity duration-200 ease-out group-hover:opacity-100" />
- <span className="text-on-dark relative z-10 text-[13.5px] font-[460] tracking-[0.15px]">Save</span>
+ <span aria-hidden className="pointer-events-none absolute inset-0 rounded-lg cta-btn-dark" />
+ <span aria-hidden className="pointer-events-none absolute inset-0 rounded-lg btn-dark-hover opacity-0 transition-opacity duration-200 ease-out group-hover:opacity-100" />
+ <span className="text-on-dark relative z-10 text-ed-13 font-book tracking-[0.15px]">Save</span>
</button>
</div>
</Dialog.Content>
diff --git a/docs/components/api/doc.tsx b/docs/components/api/doc.tsx
index 24fc3a07ff..0016b4d43f 100644
--- a/docs/components/api/doc.tsx
+++ b/docs/components/api/doc.tsx
@@ -1,24 +1,24 @@
import type { ReactNode } from "react";
export function DocPage({ children }: { children: ReactNode }) {
- return <div className="max-w-[760px]">{children}</div>;
+ return <div className="max-w-190">{children}</div>;
}
export function DocEyebrow({ children }: { children: ReactNode }) {
return (
- <p className="m-0 font-[family-name:var(--font-mono)] text-[12px] font-medium uppercase tracking-[0.08em] text-[rgba(38,35,35,0.5)]">
+ <p className="m-0 font-mono text-ed-12 font-medium uppercase tracking-[0.08em] text-ed-ink/50">
{children}
</p>
);
}
export function DocTitle({ children }: { children: ReactNode }) {
- return <h1 className="m-0 mt-[8px] text-[34px] font-[560] leading-[120%] text-[#262323]">{children}</h1>;
+ return <h1 className="m-0 mt-2 text-ed-32 font-semi leading-[120%] text-ed-ink">{children}</h1>;
}
export function Lead({ children }: { children: ReactNode }) {
return (
- <p className="m-0 mt-[12px] max-w-[640px] text-[16.5px] leading-[170%] text-[rgba(38,35,35,0.82)]">
+ <p className="m-0 mt-3 max-w-160 text-ed-16 leading-[170%] text-ed-ink/82">
{children}
</p>
);
@@ -28,7 +28,7 @@ export function H2({ children, id }: { children: ReactNode; id?: string }) {
return (
<h2
id={id}
- className="m-0 mt-[44px] mb-[2px] scroll-mt-[88px] text-[22px] font-[560] leading-[130%] text-[#262323]"
+ className="m-0 mt-11 mb-0.5 scroll-mt-22 text-ed-24 font-semi leading-[130%] text-ed-ink"
>
{children}
</h2>
@@ -36,18 +36,18 @@ export function H2({ children, id }: { children: ReactNode; id?: string }) {
}
export function P({ children }: { children: ReactNode }) {
- return <p className="m-0 mt-[12px] text-[15.5px] leading-[170%] text-[rgba(38,35,35,0.82)]">{children}</p>;
+ return <p className="m-0 mt-3 text-ed-15 leading-[170%] text-ed-ink/82">{children}</p>;
}
export function Code({ children }: { children: ReactNode }) {
- return <code className="font-[family-name:var(--font-mono)] text-[13.5px] text-[#a76451]">{children}</code>;
+ return <code className="font-mono text-ed-13 text-ed-brown">{children}</code>;
}
export function DocLink({ href, children }: { href: string; children: ReactNode }) {
return (
<a
href={href}
- className="text-[#1E84B0] underline decoration-[#A9DAF3] underline-offset-2 hover:decoration-[#1E84B0]"
+ className="text-ed-brand-ink underline decoration-ed-blue-border underline-offset-2 hover:decoration-ed-brand-ink"
>
{children}
</a>
@@ -56,28 +56,28 @@ export function DocLink({ href, children }: { href: string; children: ReactNode
export function Warn({ title, children }: { title: string; children: ReactNode }) {
return (
- <div className="my-[18px] rounded-[12px] border border-[#E6CFA3] bg-[#FFF8EC] px-[16px] py-[13px]">
- <p className="m-0 text-[14.5px] font-[560] text-[#8a5a1f]">{title}</p>
- <p className="m-0 mt-[4px] text-[14px] leading-[155%] text-[rgba(38,35,35,0.78)]">{children}</p>
+ <div className="my-[18px] rounded-xl border border-ed-amber-stroke bg-[#FFF8EC] px-4 py-[13px]">
+ <p className="m-0 text-ed-14 font-semi text-[#8a5a1f]">{title}</p>
+ <p className="m-0 mt-1 text-ed-14 leading-[155%] text-ed-ink/78">{children}</p>
</div>
);
}
export function Table({ children }: { children: ReactNode }) {
return (
- <div className="my-[18px] overflow-hidden rounded-[10px] border border-[#E3E3DF]">{children}</div>
+ <div className="my-[18px] overflow-hidden rounded-[10px] border border-ed-warm-300">{children}</div>
);
}
export function Row({ cells, cols, head = false }: { cells: ReactNode[]; cols: string; head?: boolean }) {
return (
- <div className="grid border-t border-[#E3E3DF] first:border-t-0" style={{ gridTemplateColumns: cols }}>
+ <div className="grid border-t border-ed-warm-300 first:border-t-0" style={{ gridTemplateColumns: cols }}>
{cells.map((c, i) => (
<div
key={i}
- className={`px-[12px] py-[9px] text-[14px] leading-[150%] ${
- head ? "font-[560] text-[#262323]" : "text-[rgba(38,35,35,0.82)]"
- } ${i > 0 ? "border-l border-[#E3E3DF]" : ""}`}
+ className={`px-3 py-[9px] text-ed-14 leading-normal ${
+ head ? "font-semi text-ed-ink" : "text-ed-ink/82"
+ } ${i > 0 ? "border-l border-ed-warm-300" : ""}`}
>
{c}
</div>
diff --git a/docs/components/api/docs-nav.tsx b/docs/components/api/docs-nav.tsx
index 94bd61cbc8..d26201f17c 100644
--- a/docs/components/api/docs-nav.tsx
+++ b/docs/components/api/docs-nav.tsx
@@ -2,19 +2,90 @@
import Link from "next/link";
import { usePathname } from "next/navigation";
-import { type ReactNode, useState } from "react";
+import {
+ type ReactNode,
+ useEffect,
+ useLayoutEffect,
+ useRef,
+ useState,
+} from "react";
+
+// useLayoutEffect warns during SSR; fall back to useEffect on the server.
+const useIsoLayoutEffect = typeof document !== "undefined" ? useLayoutEffect : useEffect;
+// ease-out: snappy start, gentle settle — the right curve for enter/exit (animations.dev).
+const EASE_OUT = "cubic-bezier(0.25, 0.46, 0.45, 0.94)";
+
+// Animates a nav group open/closed via the Web Animations API (height + opacity).
+// Stays mounted through the close animation, then unmounts; never animates on first
+// paint (so default-open groups don't slide in on load); honors reduced-motion.
+function Collapse({ open, children }: { open: boolean; children: ReactNode }) {
+ const ref = useRef<HTMLDivElement>(null);
+ const [mounted, setMounted] = useState(open);
+ const prevOpen = useRef(open);
+ const current = useRef<Animation | null>(null);
+
+ // Mount immediately on open; unmount is deferred until the close animation finishes.
+ useEffect(() => {
+ if (open) setMounted(true);
+ }, [open]);
+
+ useIsoLayoutEffect(() => {
+ const el = ref.current;
+ if (!el) return; // closed + unmounted: nothing to animate yet
+ // Only animate a real open<->close transition. Equal values mean the initial
+ // commit (adopt final state, no slide-in on page load) or a benign mount re-run.
+ if (open === prevOpen.current) return;
+ prevOpen.current = open;
+ current.current?.cancel();
+ const reduce = window.matchMedia("(prefers-reduced-motion: reduce)").matches;
+
+ if (open) {
+ if (reduce) {
+ el.style.height = "auto";
+ return;
+ }
+ el.style.overflow = "hidden";
+ const anim = el.animate(
+ [{ height: "0px", opacity: 0 }, { height: `${el.scrollHeight}px`, opacity: 1 }],
+ { duration: 200, easing: EASE_OUT },
+ );
+ current.current = anim;
+ anim.onfinish = () => {
+ el.style.height = "auto"; // let nested expansions grow naturally
+ el.style.overflow = "visible"; // don't clip focus rings once settled
+ };
+ } else {
+ if (reduce) {
+ setMounted(false);
+ return;
+ }
+ el.style.overflow = "hidden";
+ const anim = el.animate(
+ [{ height: `${el.scrollHeight}px`, opacity: 1 }, { height: "0px", opacity: 0 }],
+ // fill:forwards holds the collapsed end state so there's no 1-frame snap back
+ // to full height between the animation finishing and React unmounting.
+ { duration: 170, easing: EASE_OUT, fill: "forwards" }, // exits ~20% faster than entrances
+ );
+ current.current = anim;
+ anim.onfinish = () => setMounted(false);
+ }
+ }, [open, mounted]);
+
+ if (!mounted) return null;
+ return <div ref={ref}>{children}</div>;
+}
export type DocsNavNode = { label: string; url?: string; children?: DocsNavNode[] };
-const GS_ACTIVE = "bg-[rgba(0,176,255,0.10)] font-[530] text-[#1E84B0]";
-const GS_IDLE = "text-[rgba(38,35,35,0.8)] hover:bg-[rgba(231,231,227,0.55)] hover:text-[#262323]";
-const GS_LINK = "block rounded-[6px] px-[8px] py-[4px] text-[14.5px] leading-[135%] transition-colors";
+const GS_ACTIVE = "bg-ed-brand/10 font-demi text-ed-brand-ink";
+const GS_IDLE = "text-ed-ink/90 hover:bg-ed-hairline/55 hover:text-ed-ink";
+const GS_LINK = "block rounded-md px-2 py-1 text-ed-15 leading-[135%] transition-colors";
// Top-level group label (Platform, Product reference, …) vs nested sub-group label
// (the module groups inside Product reference) — one step quieter so the hierarchy reads.
const GROUP_LABEL =
- "font-[family-name:var(--font-mono)] text-[12.5px] font-[600] uppercase tracking-[0.06em] text-[rgba(38,35,35,0.6)]";
+ "font-mono text-ed-13 font-semibold uppercase tracking-[0.06em] text-ed-ink/75";
const SUBGROUP_LABEL =
- "font-[family-name:var(--font-mono)] text-[11px] font-[600] uppercase tracking-[0.05em] text-[rgba(38,35,35,0.5)]";
+ "font-mono text-ed-12 font-semibold uppercase tracking-[0.05em] text-ed-ink/68";
function Chevron({ open }: { open: boolean }) {
return (
@@ -60,19 +131,19 @@ export function DocsNav({ tree }: { tree: DocsNavNode[] }) {
const open = override[key] ?? (depth === 0 || holdsActive(node));
return (
- <div key={key} className={depth === 0 ? "mt-[8px] first:mt-[2px]" : "mt-[4px] first:mt-0"}>
+ <div key={key} className={depth === 0 ? "mt-2 first:mt-0.5" : "mt-1 first:mt-0"}>
<button
type="button"
aria-expanded={open}
onClick={() => setOverride((p) => ({ ...p, [key]: !open }))}
- className="flex w-full items-center gap-[7px] rounded-[7px] px-[8px] py-[5px] transition-colors hover:bg-[rgba(231,231,227,0.5)]"
+ className="flex w-full items-center gap-[7px] rounded-[7px] px-2 py-[5px] transition-colors hover:bg-ed-hairline/50"
>
<Chevron open={open} />
<span className={depth === 0 ? GROUP_LABEL : SUBGROUP_LABEL}>{node.label}</span>
</button>
- {open && (
- <div className="mt-[2px] mb-[2px] ml-[13px] flex flex-col gap-[2px] border-l border-[#ECECE7] py-[2px] pl-[8px]">
+ <Collapse open={open}>
+ <div className="mt-0.5 mb-0.5 ml-[13px] flex flex-col gap-0.5 border-l border-ed-warm-150 py-0.5 pl-2">
{node.url && (
<Link
href={node.url}
@@ -83,10 +154,10 @@ export function DocsNav({ tree }: { tree: DocsNavNode[] }) {
)}
{render(node.children, depth + 1, key)}
</div>
- )}
+ </Collapse>
</div>
);
});
- return <nav className="flex flex-col gap-[2px]">{render(tree, 0, "")}</nav>;
+ return <nav className="flex flex-col gap-0.5">{render(tree, 0, "")}</nav>;
}
diff --git a/docs/components/api/endpoint-section.tsx b/docs/components/api/endpoint-section.tsx
index 9fd15b43a0..844cab5444 100644
--- a/docs/components/api/endpoint-section.tsx
+++ b/docs/components/api/endpoint-section.tsx
@@ -19,19 +19,19 @@ export async function EndpointSection({ endpoint, base }: { endpoint: ApiEndpoin
return (
<section
id={endpoint.id}
- className="grid scroll-mt-[88px] grid-cols-1 gap-x-[56px] gap-y-[24px] border-t border-[#E7E7E3] py-[44px] lg:grid-cols-2"
+ className="grid scroll-mt-22 grid-cols-1 gap-x-14 gap-y-6 border-t border-ed-hairline py-11 lg:grid-cols-2"
>
<div className="min-w-0">
- <div className="flex items-center gap-[10px]">
+ <div className="flex items-center gap-2.5">
<MethodBadge method={endpoint.method} />
- <code className="font-[family-name:var(--font-mono)] text-[13.5px] text-[rgba(38,35,35,0.63)]">
+ <code className="font-mono text-ed-13 text-ed-ink/63">
{endpoint.path}
</code>
</div>
- <h2 className="m-0 mt-[14px] text-[24px] font-[560] leading-[130%] text-[#262323]">
+ <h2 className="m-0 mt-3.5 text-ed-24 font-semi leading-[130%] text-ed-ink">
{endpoint.title}
</h2>
- <p className="m-0 mt-[10px] text-[15.5px] leading-[160%] text-[rgba(38,35,35,0.8)]">
+ <p className="m-0 mt-2.5 text-ed-15 leading-[160%] text-ed-ink/80">
{endpoint.description}
</p>
<Fields title="Query parameters" query={endpoint.query} />
diff --git a/docs/components/api/faq.tsx b/docs/components/api/faq.tsx
index 3488f8cf56..9a30d1bb99 100644
--- a/docs/components/api/faq.tsx
+++ b/docs/components/api/faq.tsx
@@ -7,16 +7,16 @@ export type FaqEntry = { q: string; a: string };
function FaqItem({ q, a }: FaqEntry) {
const [open, setOpen] = useState(false);
return (
- <div className="rounded-[10px] border border-[#E7E7E3] bg-white transition-colors hover:border-[#D6D6D0]">
+ <div className="rounded-[10px] border border-ed-hairline bg-white transition-colors hover:border-ed-warm-400">
<button
type="button"
aria-expanded={open}
onClick={() => setOpen((o) => !o)}
- className="flex w-full items-center justify-between gap-[12px] px-[16px] py-[13px] text-left"
+ className="flex w-full items-center justify-between gap-3 px-4 py-[13px] text-left"
>
- <span className="text-[14.5px] font-[560] text-[#262323]">{q}</span>
+ <span className="text-ed-14 font-semi text-ed-ink">{q}</span>
<span
- className={`shrink-0 text-[19px] leading-none text-[#1E84B0] transition-transform duration-200 ${
+ className={`shrink-0 text-ed-18 leading-none text-ed-brand-ink transition-transform duration-200 ${
open ? "rotate-45" : ""
}`}
aria-hidden="true"
@@ -30,7 +30,7 @@ function FaqItem({ q, a }: FaqEntry) {
}`}
>
<div className="min-h-0 overflow-hidden">
- <p className="m-0 px-[16px] pb-[14px] text-[14px] leading-[165%] text-[rgba(38,35,35,0.7)]">{a}</p>
+ <p className="m-0 px-4 pb-3.5 text-ed-14 leading-[165%] text-ed-ink/70">{a}</p>
</div>
</div>
</div>
@@ -39,7 +39,7 @@ function FaqItem({ q, a }: FaqEntry) {
export function Faq({ items }: { items: FaqEntry[] }) {
return (
- <div className="mt-[16px] flex flex-col gap-[8px]">
+ <div className="mt-4 flex flex-col gap-2">
{items.map((it) => (
<FaqItem key={it.q} q={it.q} a={it.a} />
))}
diff --git a/docs/components/api/fields.tsx b/docs/components/api/fields.tsx
index eef62c78bb..f1d6caf74b 100644
--- a/docs/components/api/fields.tsx
+++ b/docs/components/api/fields.tsx
@@ -27,30 +27,30 @@ type Field = {
function Row({ field }: { field: Field }) {
return (
- <div className="py-[14px]">
- <div className="flex items-center gap-[8px] flex-wrap">
- <code className="font-[family-name:var(--font-mono)] text-[13.5px] text-[#262323]">
+ <div className="py-3.5">
+ <div className="flex items-center gap-2 flex-wrap">
+ <code className="font-mono text-ed-13 text-ed-ink">
{field.name}
</code>
- <span className="font-[family-name:var(--font-mono)] text-[12px] text-[rgba(38,35,35,0.54)]">
+ <span className="font-mono text-ed-12 text-ed-ink/54">
{prettyType(field)}
</span>
{field.required && (
- <span className="text-[11px] font-medium text-[#9C7136]">required</span>
+ <span className="text-ed-11 font-medium text-ed-amber-text">required</span>
)}
{field.pk && (
- <span className="text-[11px] font-medium text-[#1E84B0]">primary key</span>
+ <span className="text-ed-11 font-medium text-ed-brand-ink">primary key</span>
)}
</div>
{field.description && (
- <p className="m-0 mt-[6px] text-[14.5px] leading-[150%] text-[rgba(38,35,35,0.74)]">
+ <p className="m-0 mt-1.5 text-ed-14 leading-normal text-ed-ink/74">
{field.description}
</p>
)}
{field.fk && (
- <p className="m-0 mt-[4px] text-[13px] text-[rgba(38,35,35,0.58)]">
+ <p className="m-0 mt-1 text-ed-13 text-ed-ink/58">
References{" "}
- <code className="font-[family-name:var(--font-mono)]">
+ <code className="font-mono">
{field.fk.table}.{field.fk.column}
</code>
</p>
@@ -71,11 +71,11 @@ export function Fields({
const fields: Field[] = attributes ?? query?.map((q) => ({ ...q })) ?? [];
if (!fields.length) return null;
return (
- <div className="mt-[28px]">
- <h3 className="m-0 mb-[2px] text-[13.5px] font-[560] uppercase tracking-[0.05em] text-[rgba(38,35,35,0.58)]">
+ <div className="mt-7">
+ <h3 className="m-0 mb-0.5 text-ed-13 font-semi uppercase tracking-[0.05em] text-ed-ink/58">
{title}
</h3>
- <div className="divide-y divide-[#E7E7E3] border-t border-[#E7E7E3]">
+ <div className="divide-y divide-ed-hairline border-t border-ed-hairline">
{fields.map((f) => (
<Row key={f.name} field={f} />
))}
diff --git a/docs/components/api/mcp-nav.tsx b/docs/components/api/mcp-nav.tsx
index 7094c1cf14..ce31ac0a38 100644
--- a/docs/components/api/mcp-nav.tsx
+++ b/docs/components/api/mcp-nav.tsx
@@ -6,9 +6,9 @@ import { useEffect, useMemo, useRef, useState } from "react";
import type { ToolNavModule } from "@/lib/tools-data";
const CLASS_DOT: Record<string, string> = {
- READ: "bg-[#3F9142]",
- WRITE: "bg-[#1E84B0]",
- DESTRUCTIVE: "bg-[#B3261E]",
+ READ: "bg-ed-green-strong",
+ WRITE: "bg-ed-brand-ink",
+ DESTRUCTIVE: "bg-ed-red",
};
const MCP_LINKS = [
@@ -17,11 +17,11 @@ const MCP_LINKS = [
{ label: "Tools", href: "/mcp/tools" },
];
-const GS_ACTIVE = "bg-[rgba(0,176,255,0.10)] font-[530] text-[#1E84B0]";
-const GS_IDLE = "text-[rgba(38,35,35,0.8)] hover:bg-[rgba(231,231,227,0.55)] hover:text-[#262323]";
+const GS_ACTIVE = "bg-ed-brand/10 font-demi text-ed-brand-ink";
+const GS_IDLE = "text-ed-ink/80 hover:bg-ed-hairline/55 hover:text-ed-ink";
const SECTION_LABEL =
- "m-0 mb-[3px] px-[8px] py-[6px] font-[family-name:var(--font-mono)] text-[12.5px] font-[600] uppercase tracking-[0.06em] text-[rgba(38,35,35,0.6)]";
-const GS_LINK = "block rounded-[6px] px-[8px] py-[3.5px] text-[14.5px] leading-[135%] transition-colors";
+ "m-0 mb-[3px] px-2 py-1.5 font-mono text-ed-12 font-semibold uppercase tracking-[0.06em] text-ed-ink/60";
+const GS_LINK = "block rounded-md px-2 py-[3.5px] text-ed-14 leading-[135%] transition-colors";
function Chevron({ open }: { open: boolean }) {
return (
@@ -46,7 +46,7 @@ function toolLabel(name: string, moduleSlug: string): string {
function ClassDot({ c }: { c: string }) {
return (
<span
- className={`h-[6px] w-[6px] shrink-0 rounded-full ${CLASS_DOT[c] || "bg-[rgba(38,35,35,0.4)]"}`}
+ className={`h-1.5 w-1.5 shrink-0 rounded-full ${CLASS_DOT[c] || "bg-ed-ink/40"}`}
aria-label={c}
/>
);
@@ -75,8 +75,8 @@ export function McpNav({ tools }: { tools: ToolNavModule[] }) {
return (
<div>
- <nav className="flex flex-col gap-[2px]">
- <div className="mb-[10px]">
+ <nav className="flex flex-col gap-0.5">
+ <div className="mb-2.5">
<p className={SECTION_LABEL}>Getting Started</p>
{MCP_LINKS.map((item) => (
<Link
@@ -104,21 +104,21 @@ export function McpNav({ tools }: { tools: ToolNavModule[] }) {
return next;
})
}
- className="flex w-full items-center justify-between gap-[8px] rounded-[7px] px-[8px] py-[5px] transition-colors hover:bg-[rgba(231,231,227,0.5)]"
+ className="flex w-full items-center justify-between gap-2 rounded-[7px] px-2 py-[5px] transition-colors hover:bg-ed-hairline/50"
>
<span className="flex items-center gap-[7px]">
<Chevron open={isOpen} />
- <span className="font-[family-name:var(--font-mono)] text-[12.5px] font-[600] uppercase tracking-[0.06em] text-[rgba(38,35,35,0.6)]">
+ <span className="font-mono text-ed-12 font-semibold uppercase tracking-[0.06em] text-ed-ink/60">
{m.name}
</span>
</span>
- <span className="font-[family-name:var(--font-mono)] text-[12px] tabular-nums text-[rgba(38,35,35,0.42)]">
+ <span className="font-mono text-ed-12 tabular-nums text-ed-ink/42">
{m.tools.length}
</span>
</button>
{isOpen && (
- <ul className="mt-[2px] mb-[6px] ml-[13px] list-none border-l border-[#ECECE7] py-[2px] pl-[8px]">
+ <ul className="mt-0.5 mb-1.5 ml-[13px] list-none border-l border-ed-warm-150 py-0.5 pl-2">
{m.tools.map((t) => {
const isActive = activeTool === t.slug;
return (
@@ -127,12 +127,12 @@ export function McpNav({ tools }: { tools: ToolNavModule[] }) {
ref={isActive ? activeRef : undefined}
href={`/mcp/tools/${t.slug}`}
title={`${t.name} · ${t.classification}`}
- className={`flex items-center gap-[8px] rounded-[6px] px-[8px] py-[3.5px] leading-[135%] transition-colors ${
+ className={`flex items-center gap-2 rounded-md px-2 py-[3.5px] leading-[135%] transition-colors ${
isActive ? GS_ACTIVE : GS_IDLE
}`}
>
<ClassDot c={t.classification} />
- <span className="truncate font-[family-name:var(--font-mono)] text-[13px]">
+ <span className="truncate font-mono text-ed-13">
{toolLabel(t.name, m.slug)}
</span>
</Link>
diff --git a/docs/components/api/mdx-code-block.tsx b/docs/components/api/mdx-code-block.tsx
index 3a54231d97..ebc3024575 100644
--- a/docs/components/api/mdx-code-block.tsx
+++ b/docs/components/api/mdx-code-block.tsx
@@ -16,10 +16,10 @@ export function MdxCodeBlock({ title, children }: { title?: string; children?: R
};
return (
- <div className="my-[18px] overflow-hidden rounded-[12px] border border-[#2A2A28] bg-[#1B1B1A]">
+ <div className="my-[18px] overflow-hidden rounded-xl border border-ed-dark-line bg-ed-dark-bg">
{title && (
- <div className="flex h-[38px] items-center border-b border-[#2A2A28] px-[14px]">
- <span className="font-[family-name:var(--font-mono)] text-[11.5px] tracking-[0.03em] text-[#9A9A96]">
+ <div className="flex h-[38px] items-center border-b border-ed-dark-line px-3.5">
+ <span className="font-mono text-ed-11 tracking-[0.03em] text-ed-text-muted">
{title}
</span>
</div>
@@ -28,7 +28,7 @@ export function MdxCodeBlock({ title, children }: { title?: string; children?: R
<button
type="button"
onClick={copy}
- className="absolute top-[10px] right-[10px] z-10 rounded-[6px] border border-[#3A3A38] bg-[#262624] px-[8px] py-[3px] font-[family-name:var(--font-mono)] text-[11px] text-[#C9C9C5] transition-colors hover:border-[#4A4A47] hover:text-white"
+ className="absolute top-2.5 right-2.5 z-10 rounded-md border border-ed-dark-line-2 bg-ed-dark-surface px-2 py-[3px] font-mono text-ed-11 text-ed-text-faint transition-colors hover:border-ed-dark-line-3 hover:text-white"
>
{copied ? "Copied" : "Copy"}
</button>
diff --git a/docs/components/api/method-badge.tsx b/docs/components/api/method-badge.tsx
index 6bae760897..e580bfc931 100644
--- a/docs/components/api/method-badge.tsx
+++ b/docs/components/api/method-badge.tsx
@@ -1,14 +1,14 @@
const TONE: Record<string, string> = {
- GET: "text-[#3F9142] bg-[#E4F8DA] border-[#A8DB91]",
- POST: "text-[#1E84B0] bg-[#DFF5FF] border-[#A9DAF3]",
- PATCH: "text-[#9C7136] bg-[#FFF2D8] border-[#E6CFA3]",
- DELETE: "text-[#B3261E] bg-[#FCE8E6] border-[#F2C0BC]",
+ GET: "text-ed-green-strong bg-ed-green-bg border-ed-green-border",
+ POST: "text-ed-brand-ink bg-ed-blue-bg border-ed-blue-border",
+ PATCH: "text-ed-amber-text bg-ed-amber-fill border-ed-amber-stroke",
+ DELETE: "text-ed-red bg-ed-red-bg border-ed-red-border",
};
export function MethodBadge({ method, className = "" }: { method: string; className?: string }) {
return (
<span
- className={`inline-flex items-center rounded-[6px] border px-[7px] py-[2px] font-[family-name:var(--font-mono)] text-[11px] font-semibold leading-[14px] tracking-[0.04em] ${
+ className={`inline-flex items-center rounded-md border px-[7px] py-0.5 font-mono text-ed-11 font-semibold leading-3.5 tracking-[0.04em] ${
TONE[method] || TONE.GET
} ${className}`}
>
diff --git a/docs/components/api/page-feedback.tsx b/docs/components/api/page-feedback.tsx
index 53b2beacd9..ea97be4932 100644
--- a/docs/components/api/page-feedback.tsx
+++ b/docs/components/api/page-feedback.tsx
@@ -6,10 +6,10 @@ import { useState } from "react";
const DISCUSSIONS_URL = "https://github.com/crbnos/carbon/discussions/new?category=q-a";
const PILL_BASE =
- "inline-flex items-center gap-[6px] rounded-[8px] px-[12px] py-[6px] text-[13.5px] font-[500] no-underline transition-colors";
+ "inline-flex items-center gap-1.5 rounded-lg px-3 py-1.5 text-ed-13 font-medium no-underline transition-colors";
// `docs` — white card on paper; `editorial` — warm glass pill for the Guide surface.
-const PILL_DOCS = `${PILL_BASE} border border-[#E3E3DF] bg-white text-[rgba(38,35,35,0.8)] hover:border-[#CFCFC9] hover:text-[#262323]`;
-const PILL_EDITORIAL = `${PILL_BASE} glass-pill text-ink-ui hover:text-[#262323]`;
+const PILL_DOCS = `${PILL_BASE} border border-ed-warm-300 bg-white text-ed-ink/80 hover:border-ed-warm-500 hover:text-ed-ink`;
+const PILL_EDITORIAL = `${PILL_BASE} glass-pill text-ink-ui hover:text-ed-ink`;
function ThumbUp() {
return (
@@ -44,18 +44,18 @@ export function PageFeedback({ variant = "docs" }: { variant?: "docs" | "editori
if (thanked) {
return (
- <p className={`m-0 text-[14px] ${editorial ? "text-ink-faint" : "text-[rgba(38,35,35,0.66)]"}`}>
+ <p className={`m-0 text-ed-14 ${editorial ? "text-ink-faint" : "text-ed-ink/66"}`}>
Thanks for your feedback!
</p>
);
}
return (
- <div className="flex flex-wrap items-center gap-x-[14px] gap-y-[10px]">
- <span className={`text-[14px] font-[560] ${editorial ? "text-ink-ui" : "text-[#262323]"}`}>
+ <div className="flex flex-wrap items-center gap-x-3.5 gap-y-2.5">
+ <span className={`text-ed-14 font-semi ${editorial ? "text-ink-ui" : "text-ed-ink"}`}>
Was this page helpful?
</span>
- <div className="flex items-center gap-[8px]">
+ <div className="flex items-center gap-2">
<button type="button" onClick={() => setThanked(true)} className={pill}>
<ThumbUp /> Yes
</button>
diff --git a/docs/components/api/page-footer.tsx b/docs/components/api/page-footer.tsx
index d4269fd90a..4c47f9bfaa 100644
--- a/docs/components/api/page-footer.tsx
+++ b/docs/components/api/page-footer.tsx
@@ -37,16 +37,16 @@ function Card({ dir, link }: { dir: "prev" | "next"; link: NavLink }) {
return (
<Link
href={link.url}
- className={`group flex items-center gap-[10px] rounded-[10px] border border-[#E7E7E3] bg-white px-[14px] py-[11px] no-underline transition-colors hover:border-[#D6D6D0] ${
+ className={`group flex items-center gap-2.5 rounded-[10px] border border-ed-hairline bg-white px-3.5 py-[11px] no-underline transition-colors hover:border-ed-warm-400 ${
next ? "flex-row-reverse text-right" : ""
}`}
>
<Chevron dir={next ? "right" : "left"} />
<span className="flex min-w-0 flex-1 flex-col">
- <span className="font-[family-name:var(--font-mono)] text-[10.5px] font-[600] uppercase tracking-[0.07em] text-[rgba(38,35,35,0.45)]">
+ <span className="font-mono text-ed-10 font-semibold uppercase tracking-[0.07em] text-ed-ink/45">
{next ? "Next" : "Previous"}
</span>
- <span className="truncate text-[14px] font-[560] text-[#262323] group-hover:text-[#1E84B0]">
+ <span className="truncate text-ed-14 font-semi text-ed-ink group-hover:text-ed-brand-ink">
{link.label}
</span>
</span>
@@ -65,13 +65,13 @@ export function ContentFooter({
editPath?: string;
}) {
return (
- <footer className="mt-[56px] border-t border-[#E7E7E3] pt-[24px]">
- <div className="flex flex-wrap items-center justify-between gap-x-[24px] gap-y-[12px]">
+ <footer className="mt-14 border-t border-ed-hairline pt-6">
+ <div className="flex flex-wrap items-center justify-between gap-x-6 gap-y-3">
<PageFeedback />
{editPath && <EditOnGitHub path={editPath} />}
</div>
{(prev || next) && (
- <nav className="mt-[22px] grid grid-cols-1 gap-[12px] sm:grid-cols-2">
+ <nav className="mt-[22px] grid grid-cols-1 gap-3 sm:grid-cols-2">
<div>{prev && <Card dir="prev" link={prev} />}</div>
<div>{next && <Card dir="next" link={next} />}</div>
</nav>
diff --git a/docs/components/api/sdk-cards.tsx b/docs/components/api/sdk-cards.tsx
index 0d60f49613..af262a1e95 100644
--- a/docs/components/api/sdk-cards.tsx
+++ b/docs/components/api/sdk-cards.tsx
@@ -12,7 +12,7 @@ function Brand({ path }: { path: string }) {
function Tile({ glyph, tone }: { glyph: ReactNode; tone: string }) {
return (
- <span className={`flex h-[34px] w-[34px] shrink-0 items-center justify-center rounded-[8px] ${tone}`}>
+ <span className={`flex h-[34px] w-[34px] shrink-0 items-center justify-center rounded-lg ${tone}`}>
{glyph}
</span>
);
@@ -25,7 +25,7 @@ function Arrow() {
height="13"
viewBox="0 0 14 14"
fill="none"
- className="transition-transform group-hover:translate-x-[2px]"
+ className="transition-transform group-hover:translate-x-0.5"
>
<path
d="M3 7h8M7.5 3.5L11 7l-3.5 3.5"
@@ -58,7 +58,7 @@ const CARDS = [
},
{
glyph: <Brand path={siSwift.path} />,
- tone: "bg-[#FCEAE2] text-[#E0431F]",
+ tone: "bg-ed-red-bg text-[#E0431F]",
name: "Swift",
desc: "The official supabase-swift SDK for iOS, macOS, and server-side Swift.",
href: "https://supabase.com/docs/reference/swift/introduction",
@@ -76,19 +76,19 @@ const CARDS = [
export function SdkCards() {
return (
- <div className="mt-[18px] grid grid-cols-1 gap-[14px] sm:grid-cols-2">
+ <div className="mt-[18px] grid grid-cols-1 gap-3.5 sm:grid-cols-2">
{CARDS.map((c) => (
<a
key={c.name}
href={c.href}
- className="group rounded-[12px] border border-[#E7E7E3] bg-white p-[16px] no-underline transition-colors hover:border-[#D6D6D0]"
+ className="group rounded-xl border border-ed-hairline bg-white p-4 no-underline transition-colors hover:border-ed-warm-400"
>
<div className="flex items-center gap-[11px]">
<Tile glyph={c.glyph} tone={c.tone} />
- <span className="text-[15.5px] font-[560] text-[#262323]">{c.name}</span>
+ <span className="text-ed-15 font-semi text-ed-ink">{c.name}</span>
</div>
- <p className="m-0 mt-[10px] text-[14px] leading-[160%] text-[rgba(38,35,35,0.74)]">{c.desc}</p>
- <span className="mt-[12px] inline-flex items-center gap-[5px] text-[13.5px] font-[500] text-[#1E84B0]">
+ <p className="m-0 mt-2.5 text-ed-14 leading-[160%] text-ed-ink/74">{c.desc}</p>
+ <span className="mt-3 inline-flex items-center gap-[5px] text-ed-13 font-medium text-ed-brand-ink">
{c.cta} <Arrow />
</span>
</a>
diff --git a/docs/components/api/toc.tsx b/docs/components/api/toc.tsx
index 774675c07f..05cea55ea5 100644
--- a/docs/components/api/toc.tsx
+++ b/docs/components/api/toc.tsx
@@ -51,21 +51,21 @@ export function TableOfContents() {
if (headings.length === 0) return null;
return (
- <nav className="sticky top-[88px] max-h-[calc(100dvh-120px)] overflow-y-auto scrollbar-hidden-until-scroll">
- <p className="m-0 mb-[10px] font-[family-name:var(--font-mono)] text-[11px] font-medium uppercase tracking-[0.08em] text-[rgba(38,35,35,0.5)]">
+ <nav className="sticky top-22 max-h-[calc(100dvh-120px)] overflow-y-auto scrollbar-hidden-until-scroll">
+ <p className="m-0 mb-2.5 font-mono text-ed-11 font-medium uppercase tracking-[0.08em] text-ed-ink/50">
On this page
</p>
- <ul className="m-0 list-none border-l border-[#E7E7E3] p-0">
+ <ul className="m-0 list-none border-l border-ed-hairline p-0">
{headings.map((h) => (
<li key={h.id}>
<a
href={`#${h.id}`}
- className={`-ml-px block border-l py-[5px] text-[13.5px] leading-[140%] transition-colors ${
- h.level === 3 ? "pl-[24px]" : "pl-[14px]"
+ className={`-ml-px block border-l py-[5px] text-ed-13 leading-[140%] transition-colors ${
+ h.level === 3 ? "pl-6" : "pl-3.5"
} ${
active === h.id
- ? "border-[#1E84B0] text-[#1E84B0]"
- : "border-transparent text-[rgba(38,35,35,0.68)] hover:text-[#262323]"
+ ? "border-ed-brand-ink text-ed-brand-ink"
+ : "border-transparent text-ed-ink/68 hover:text-ed-ink"
}`}
>
{h.text}
diff --git a/docs/components/chapter-nav.tsx b/docs/components/chapter-nav.tsx
index fac9ea8057..a04c034434 100644
--- a/docs/components/chapter-nav.tsx
+++ b/docs/components/chapter-nav.tsx
@@ -47,7 +47,7 @@ export function ChapterNav({
return (
<nav className="text-sm">
- <p className="mb-6 max-w-[14rem] text-[13px] leading-snug text-muted-foreground">{title}</p>
+ <p className="mb-6 max-w-[14rem] text-ed-13 leading-snug text-muted-foreground">{title}</p>
<ol className="space-y-7">
{chapters.map((chapter, ci) => (
diff --git a/docs/components/checklist.tsx b/docs/components/checklist.tsx
index 769decefe0..fa4e6275c1 100644
--- a/docs/components/checklist.tsx
+++ b/docs/components/checklist.tsx
@@ -68,7 +68,7 @@ export function Check({ children, _index = 0 }: { children: ReactNode; _index?:
)}
</span>
<span
- className={`text-[15px] leading-relaxed ${
+ className={`text-ed-15 leading-relaxed ${
done ? "text-muted-foreground line-through" : "text-foreground"
}`}
>
diff --git a/docs/components/edit-on-github.tsx b/docs/components/edit-on-github.tsx
index 565bd24d73..b25069684d 100644
--- a/docs/components/edit-on-github.tsx
+++ b/docs/components/edit-on-github.tsx
@@ -31,10 +31,10 @@ export function EditOnGitHub({
href={githubEditUrl(path)}
target="_blank"
rel="noreferrer"
- className={`inline-flex items-center gap-[7px] text-[13.5px] font-[500] no-underline transition-colors ${
+ className={`inline-flex items-center gap-[7px] text-ed-13 font-medium no-underline transition-colors ${
variant === "editorial"
- ? "text-ink-faint hover:text-[#262323]"
- : "text-[rgba(38,35,35,0.6)] hover:text-[#1E84B0]"
+ ? "text-ink-faint hover:text-ed-ink"
+ : "text-ed-ink/60 hover:text-ed-brand-ink"
}`}
>
<GitHubMark />
diff --git a/docs/components/editorial/field-table.tsx b/docs/components/editorial/field-table.tsx
index 8282bfa639..40e225bec8 100644
--- a/docs/components/editorial/field-table.tsx
+++ b/docs/components/editorial/field-table.tsx
@@ -42,11 +42,11 @@ export function FieldTable({
isValidElement(c),
);
return (
- <div className="my-[24px] overflow-hidden rounded-[12px] border border-ed-hairline bg-ed-paper">
- <div className="flex items-center gap-[12px] border-b border-ed-hairline bg-ed-header px-[16px] py-[9px] font-[family-name:var(--font-mono)] text-[10.5px] font-[600] uppercase tracking-[0.07em] text-ed-ink-45">
+ <div className="my-6 overflow-hidden rounded-xl border border-ed-hairline bg-ed-paper">
+ <div className="flex items-center gap-3 border-b border-ed-hairline bg-ed-header px-4 py-[9px] font-mono text-ed-10 font-semibold uppercase tracking-[0.07em] text-ed-ink-45">
<span>Field</span>
<span className="ml-auto">Type</span>
- <span className="w-[14px]" />
+ <span className="w-3.5" />
</div>
<div className="divide-y divide-ed-hairline">
{rows.map((row, i) =>
@@ -72,30 +72,30 @@ export function Field({ name, type, required, defaultOpen = false, children }: F
aria-expanded={open}
aria-controls={hasBody ? panelId : undefined}
onClick={() => hasBody && setOpen((o) => !o)}
- className={`flex w-full items-center gap-[12px] px-[16px] py-[11px] text-left hover:bg-ed-row-hover ${
+ className={`flex w-full items-center gap-3 px-4 py-[11px] text-left hover:bg-ed-row-hover ${
hasBody ? "cursor-pointer" : "cursor-default"
}`}
>
- <span className="text-[14px] font-[550] tracking-[0.1px] text-ed-ink">{name}</span>
+ <span className="text-ed-14 font-semi tracking-[0.1px] text-ed-ink">{name}</span>
{required && (
- <span className="inline-flex items-center rounded-[5px] border border-ed-amber-stroke bg-ed-amber-fill px-[6px] py-[1px] text-[10px] font-medium tracking-[0.02em] text-ed-amber-text">
+ <span className="inline-flex items-center rounded-[5px] border border-ed-amber-stroke bg-ed-amber-fill px-1.5 py-px text-ed-10 font-medium tracking-[0.02em] text-ed-amber-text">
required
</span>
)}
- <span className="ml-auto font-[family-name:var(--font-mono)] text-[12.5px] text-ed-ink-45 whitespace-nowrap">
+ <span className="ml-auto font-mono text-ed-12 text-ed-ink-45 whitespace-nowrap">
{type}
</span>
{hasBody ? (
<span
aria-hidden="true"
- className={`w-[14px] text-center text-[18px] leading-none text-ed-brand-ink transition-transform duration-200 motion-reduce:transition-none ${
+ className={`w-3.5 text-center text-ed-18 leading-none text-ed-brand-ink transition-transform duration-200 motion-reduce:transition-none ${
open ? "rotate-45" : ""
}`}
>
+
</span>
) : (
- <span className="w-[14px]" />
+ <span className="w-3.5" />
)}
</button>
{hasBody && (
@@ -108,7 +108,7 @@ export function Field({ name, type, required, defaultOpen = false, children }: F
<div
id={panelId}
role="region"
- className="border-t border-ed-hairline bg-ed-inset px-[16px] py-[12px] text-[13.5px] leading-[160%] text-ed-ink-66 [&>p]:m-0 [&>p]:text-[13.5px] [&>p]:leading-[160%] [&>p]:text-ed-ink-66 [&>p+p]:mt-[8px]"
+ className="border-t border-ed-hairline bg-ed-inset px-4 py-3 text-ed-13 leading-[160%] text-ed-ink-66 [&>p]:m-0 [&>p]:text-ed-13 [&>p]:leading-[160%] [&>p]:text-ed-ink-66 [&>p+p]:mt-2"
>
{children}
</div>
diff --git a/docs/components/editorial/glossary.tsx b/docs/components/editorial/glossary.tsx
index 067f308068..7cf574a25b 100644
--- a/docs/components/editorial/glossary.tsx
+++ b/docs/components/editorial/glossary.tsx
@@ -24,30 +24,30 @@ export function Glossary() {
}
return (
- <div className="my-[28px]">
+ <div className="my-7">
{[...groups.entries()].map(([letter, items]) => (
- <section key={letter} className="mb-[28px]">
+ <section key={letter} className="mb-7">
<h2
id={`letter-${letter.toLowerCase()}`}
- className="!mt-0 !mb-[6px] scroll-mt-[88px] !border-0 font-[family-name:var(--font-mono)] !text-[12px] !font-[600] uppercase tracking-[0.08em] !text-[rgba(38,35,35,0.4)]"
+ className="!mt-0 !mb-1.5 scroll-mt-22 !border-0 font-mono !text-ed-12 !font-semibold uppercase tracking-[0.08em] !text-ed-ink/40"
>
{letter}
</h2>
- <div className="divide-y divide-[#E7E7E3] border-y border-[#E7E7E3]">
+ <div className="divide-y divide-ed-hairline border-y border-ed-hairline">
{items.map((entry) => (
- <div key={entry.term} id={termSlug(entry.term)} className="scroll-mt-[88px] py-[15px]">
- <div className="flex flex-wrap items-baseline justify-between gap-x-[12px] gap-y-[3px]">
- <span className="text-[15px] font-[560] text-[#262323]">{entry.term}</span>
+ <div key={entry.term} id={termSlug(entry.term)} className="scroll-mt-22 py-[15px]">
+ <div className="flex flex-wrap items-baseline justify-between gap-x-3 gap-y-[3px]">
+ <span className="text-ed-15 font-semi text-ed-ink">{entry.term}</span>
{entry.href && (
<Link
href={entry.href}
- className="shrink-0 text-[12.5px] font-[500] text-[#1E84B0] no-underline hover:text-[#0C6E96]"
+ className="shrink-0 text-ed-12 font-medium text-ed-brand-ink no-underline hover:text-ed-blue-text"
>
Learn more <span aria-hidden>→</span>
</Link>
)}
</div>
- <p className="m-0 mt-[5px] text-[14px] leading-[155%] text-[rgba(38,35,35,0.66)]">
+ <p className="m-0 mt-[5px] text-ed-14 leading-[155%] text-ed-ink/66">
{entry.definition}
</p>
</div>
diff --git a/docs/components/editorial/guide-mobile-nav.tsx b/docs/components/editorial/guide-mobile-nav.tsx
index 1bc8ffe783..43c279cde1 100644
--- a/docs/components/editorial/guide-mobile-nav.tsx
+++ b/docs/components/editorial/guide-mobile-nav.tsx
@@ -23,7 +23,7 @@ export function GuideMobileNav() {
<div className="flex flex-col gap-[30px]">
{flows.map((flow) => (
<div key={flow.slug}>
- <p className="mb-[16px] px-[4px] font-[family-name:var(--font-mono)] text-[11.5px] font-[600] uppercase tracking-[0.08em] text-[rgba(38,35,35,0.5)]">
+ <p className="mb-4 px-1 font-mono text-ed-11 font-semibold uppercase tracking-[0.08em] text-ed-ink/50">
{flow.name}
</p>
<div className="flex flex-col gap-[26px]">
@@ -32,16 +32,16 @@ export function GuideMobileNav() {
<button
type="button"
onClick={() => select(index, 0)}
- className="flex w-full items-baseline gap-[8px] border-none bg-transparent px-[4px] text-left"
+ className="flex w-full items-baseline gap-2 border-none bg-transparent px-1 text-left"
>
- <span className="font-[family-name:var(--font-mono)] text-[11px] font-[500] leading-[140%] text-ink-faint">
+ <span className="font-mono text-ed-11 font-medium leading-[140%] text-ink-faint">
{chapter.label}
</span>
- <span className="text-[15px] font-[530] leading-[140%] tracking-[0.15px] text-[rgba(32,32,32,0.82)]">
+ <span className="text-ed-15 font-demi leading-[140%] tracking-[0.15px] text-ed-ink/82">
{chapter.title}
</span>
</button>
- <div className="mt-[14px] flex flex-col gap-[12px] pl-[4px]">
+ <div className="mt-3.5 flex flex-col gap-3 pl-1">
{chapter.items.map((item, itemIdx) => {
const isActive = active.chapter === index && active.item === itemIdx;
return (
@@ -49,18 +49,18 @@ export function GuideMobileNav() {
key={item.id}
type="button"
onClick={() => select(index, itemIdx)}
- className="flex cursor-pointer items-center gap-[14px] border-none bg-transparent p-0 text-left"
+ className="flex cursor-pointer items-center gap-3.5 border-none bg-transparent p-0 text-left"
>
<span
- className={`h-[8px] w-[8px] shrink-0 rounded-[5.5px] transition-all duration-200 ${
+ className={`h-2 w-2 shrink-0 rounded-[5.5px] transition-all duration-200 ${
isActive
- ? "bg-[#B2E7FF] shadow-[0_1px_1px_0_rgba(0,126,183,0.70),inset_0_0.5px_0.2px_0_#FFF,0_0_0_3px_#96DEFF]"
- : "bg-[#F3F3F0] shadow-[0_1px_1px_0_rgba(0,0,0,0.25),0_0_0_3px_rgba(213,213,211,0.50),inset_0_0.5px_0.2px_0_#FFF]"
+ ? "bg-ed-blue-bg-strong shadow-[0_1px_1px_0_rgba(0,126,183,0.70),inset_0_0.5px_0.2px_0_#FFF,0_0_0_3px_#96DEFF]"
+ : "bg-ed-warm-100 shadow-[0_1px_1px_0_rgba(0,0,0,0.25),0_0_0_3px_rgba(213,213,211,0.50),inset_0_0.5px_0.2px_0_#FFF]"
}`}
/>
<span
- className={`text-[14.5px] font-[460] leading-[140%] tracking-[0.15px] transition-colors ${
- isActive ? "text-[#262323]" : "text-[rgba(75,75,74,0.82)]"
+ className={`text-ed-14 font-book leading-[140%] tracking-[0.15px] transition-colors ${
+ isActive ? "text-ed-ink" : "text-ed-graphite/82"
}`}
>
{item.title}
diff --git a/docs/components/editorial/guide-subnav.tsx b/docs/components/editorial/guide-subnav.tsx
index 6aee6590e7..c30f7eefce 100644
--- a/docs/components/editorial/guide-subnav.tsx
+++ b/docs/components/editorial/guide-subnav.tsx
@@ -4,7 +4,7 @@ import { flowsOf, useGuide } from "./guide-context";
function Divider() {
return (
- <span className="relative mx-[7px] h-[16px] w-[1px] shrink-0 self-center">
+ <span className="relative mx-[7px] h-4 w-px shrink-0 self-center">
<span
className="absolute inset-0 opacity-40"
style={{
@@ -26,13 +26,13 @@ export function GuideSubnav() {
return (
<div
- className="fixed inset-x-0 top-[64px] z-[55] hidden min-[1000px]:block"
+ className="fixed inset-x-0 top-16 z-[55] hidden min-[1000px]:block"
style={{ background: "#F5F5F2", borderBottom: "1px solid #E8E7E6", boxShadow: "0 1px 0 0 #fff" }}
>
- <div className="mx-auto flex h-[52px] w-full max-w-[1440px] items-center overflow-x-auto px-[24px] scrollbar-none md:px-[32px]">
+ <div className="mx-auto flex h-13 w-full max-w-360 items-center overflow-x-auto px-6 scrollbar-none md:px-8">
<nav className="flex items-center">
<span
- className="nav-link whitespace-nowrap px-[6px] text-[15px] font-[460] leading-[150%] tracking-[0.15px]"
+ className="nav-link whitespace-nowrap px-1.5 text-ed-15 font-book leading-normal tracking-[0.15px]"
style={{ color: "rgba(32, 32, 32, 0.40)" }}
>
How to
@@ -47,10 +47,10 @@ export function GuideSubnav() {
aria-hidden="true"
className={`pointer-events-none absolute inset-0 rounded-[7px] transition-opacity duration-200 ease-out ${
isActive ? "opacity-100" : "opacity-0 group-hover:opacity-100"
- } bg-[rgba(231,231,227,0.80)]`}
+ } bg-ed-hairline/80`}
/>
<a
- className="nav-link relative z-10 flex items-center whitespace-nowrap px-[12px] py-[8px] text-[15px] font-[460] leading-[150%] tracking-[0.15px] text-ink-ui no-underline"
+ className="nav-link relative z-10 flex items-center whitespace-nowrap px-3 py-2 text-ed-15 font-book leading-normal tracking-[0.15px] text-ink-ui no-underline"
href={`/guides/${chapters[flow.firstIndex]?.slug ?? ""}`}
aria-current={isActive ? "page" : undefined}
onClick={(e) => {
diff --git a/docs/components/editorial/how-to-layout.tsx b/docs/components/editorial/how-to-layout.tsx
index 6838c14fc6..5143cb931e 100644
--- a/docs/components/editorial/how-to-layout.tsx
+++ b/docs/components/editorial/how-to-layout.tsx
@@ -29,16 +29,16 @@ function ChapterCard({ dir, title, onSelect }: { dir: "prev" | "next"; title: st
<button
type="button"
onClick={onSelect}
- className={`group flex w-full items-center gap-[10px] rounded-[12px] border border-[#E7E7E3] bg-[rgba(251,251,248,0.6)] px-[16px] py-[12px] text-left shadow-[inset_0_1px_0_#fff] transition-colors hover:border-[#D9D9D3] hover:bg-[rgba(255,255,255,0.7)] ${
+ className={`group flex w-full items-center gap-2.5 rounded-xl border border-ed-hairline bg-ed-paper/60 px-4 py-3 text-left shadow-[inset_0_1px_0_#fff] transition-colors hover:border-ed-warm-400 hover:bg-white/70 ${
next ? "flex-row-reverse text-right" : ""
}`}
>
<FooterChevron dir={next ? "right" : "left"} />
<span className="flex min-w-0 flex-1 flex-col">
- <span className="font-[family-name:var(--font-mono)] text-[10.5px] font-[600] uppercase tracking-[0.08em] text-[rgba(38,35,35,0.72)]">
+ <span className="font-mono text-ed-10 font-semibold uppercase tracking-[0.08em] text-ed-ink/72">
{next ? "Next" : "Previous"}
</span>
- <span className="truncate text-[15px] font-[560] text-ink-ui transition-colors group-hover:text-[#262323]">
+ <span className="truncate text-ed-15 font-semi text-ink-ui transition-colors group-hover:text-ed-ink">
{title}
</span>
</span>
@@ -63,18 +63,18 @@ function MobileContextBar({ chapter, section }: { chapter: string; section?: str
<button
type="button"
onClick={() => window.dispatchEvent(new CustomEvent("carbon:open-mobile-nav"))}
- className="fixed inset-x-0 top-[64px] z-[55] flex h-[52px] items-center min-[1000px]:hidden"
+ className="fixed inset-x-0 top-16 z-[55] flex h-13 items-center min-[1000px]:hidden"
style={{ background: "#F5F5F2", borderBottom: "1px solid #E8E7E6", boxShadow: "0 1px 0 0 #fff" }}
>
{/* sr-only prefix keeps the visible flow/title text in the accessible name (Label in Name). */}
<span className="sr-only">Open contents: </span>
- <span className="mx-auto flex w-full max-w-[1440px] items-center gap-[11px] px-[24px]">
+ <span className="mx-auto flex w-full max-w-360 items-center gap-[11px] px-6">
<PanelIcon />
- <span className="min-w-0 flex-1 truncate text-left text-[14px] font-[460] tracking-[0.15px] text-ink-ui">
+ <span className="min-w-0 flex-1 truncate text-left text-ed-14 font-book tracking-[0.15px] text-ink-ui">
<span className={section ? "text-ink-faint" : undefined}>{chapter}</span>
{section ? (
<>
- <span className="mx-[7px] text-[rgba(38,35,35,0.3)]">/</span>
+ <span className="mx-[7px] text-ed-ink/30">/</span>
{section}
</>
) : null}
@@ -122,12 +122,12 @@ export function HowToLayout({ bodies }: { bodies: ReactNode[] }) {
const nextInFlow = flowChapters[posInFlow + 1];
return (
- <main className="min-h-screen bg-[#FBFBF9]" style={{ paddingTop: "116px" }}>
+ <main className="min-h-screen bg-ed-paper" style={{ paddingTop: "116px" }}>
<MobileContextBar chapter={currentChapter.title} section={currentChapter.items[active.item]?.title} />
- <div className="mx-auto flex w-full max-w-[1440px] px-[20px]">
+ <div className="mx-auto flex w-full max-w-360 px-5">
{/* Sidebar (desktop) — sticky, self-start so it tracks the page scroll instead
of stretching; scrolls internally only if it outgrows the viewport. */}
- <aside className="sticky top-[116px] hidden max-h-[calc(100dvh-116px)] w-[260px] shrink-0 self-start overflow-y-auto scrollbar-hidden-until-scroll nav-scroll-fade pb-[40px] pl-[50px] pr-[10px] pt-[40px] min-[1000px]:block">
+ <aside className="sticky top-29 hidden max-h-[calc(100dvh-116px)] w-65 shrink-0 self-start overflow-y-auto scrollbar-hidden-until-scroll nav-scroll-fade pb-10 pl-[50px] pr-2.5 pt-10 min-[1000px]:block">
<SidebarNav chapters={chapters} active={active} onActiveChange={goTo} />
<NavScrollChevron />
</aside>
@@ -135,11 +135,11 @@ export function HowToLayout({ bodies }: { bodies: ReactNode[] }) {
{/* Content — natural document flow. The window scrolls, so the footer only
appears once the reader reaches the true end of the chapter. The big left
indent eases off at xl, where the right-rail TOC fills that space instead. */}
- <div className="min-w-0 flex-1 pb-[80px] pt-[28px] min-[640px]:pl-[32px] min-[640px]:pb-[120px] min-[640px]:pt-[44px] min-[1000px]:pl-[130px] min-[1000px]:pr-[20px] xl:pl-[80px] xl:pr-[40px]">
- <div className="max-w-[620px]">
- <div className="flex flex-wrap items-center gap-[12px]">
+ <div className="min-w-0 flex-1 pb-20 pt-7 min-[640px]:pl-8 min-[640px]:pb-30 min-[640px]:pt-11 min-[1000px]:pl-[130px] min-[1000px]:pr-5 xl:pl-20 xl:pr-10">
+ <div className="max-w-155">
+ <div className="flex flex-wrap items-center gap-3">
<span
- className="inline-flex items-center justify-center whitespace-nowrap rounded-[100px] px-[8px] py-[4px] font-[family-name:var(--font-mono)] text-[12px] font-medium leading-[16px] text-[rgba(38,35,35,0.72)]"
+ className="inline-flex items-center justify-center whitespace-nowrap rounded-full px-2 py-1 font-mono text-ed-12 font-medium leading-4 text-ed-ink/72"
style={{
background:
"linear-gradient(180deg, rgba(251, 251, 248, 0.50) 0%, rgba(251, 251, 248, 0.00) 100%)",
@@ -149,13 +149,13 @@ export function HowToLayout({ bodies }: { bodies: ReactNode[] }) {
>
{currentChapter.label} — {currentChapter.slug.toUpperCase()}
</span>
- <span className="inline-flex items-center gap-[5px] font-[family-name:var(--font-mono)] text-[12px] leading-[16px] text-[rgba(38,35,35,0.42)]">
+ <span className="inline-flex items-center gap-[5px] font-mono text-ed-12 leading-4 text-ed-ink/42">
<ClockIcon />
{currentChapter.readingTime} min read
</span>
</div>
- <h1 className="mt-[18px] text-[32px] font-normal leading-[112%] text-ink md:text-[40px]">
+ <h1 className="mt-[18px] text-ed-32 font-normal leading-[112%] text-ink md:text-ed-40">
{currentChapter.title}
</h1>
@@ -163,13 +163,13 @@ export function HowToLayout({ bodies }: { bodies: ReactNode[] }) {
{bodies[active.chapter]}
{/* Footer — feedback + edit link, then within-flow prev/next, matching the docs pages. */}
- <footer className="mt-[64px] border-t border-[rgba(38,35,35,0.12)] pt-[26px]">
- <div className="flex flex-wrap items-center justify-between gap-x-[24px] gap-y-[12px]">
+ <footer className="mt-16 border-t border-ed-ink/12 pt-[26px]">
+ <div className="flex flex-wrap items-center justify-between gap-x-6 gap-y-3">
<PageFeedback key={active.chapter} variant="editorial" />
<EditOnGitHub path={currentChapter.editPath} variant="editorial" />
</div>
{(prevInFlow || nextInFlow) && (
- <nav className="mt-[22px] grid grid-cols-1 gap-[12px] sm:grid-cols-2">
+ <nav className="mt-[22px] grid grid-cols-1 gap-3 sm:grid-cols-2">
<div>
{prevInFlow && (
<ChapterCard
@@ -196,7 +196,7 @@ export function HowToLayout({ bodies }: { bodies: ReactNode[] }) {
{/* Right-rail reading-progress ruler (≥xl). Stretches with the row so the
sticky ruler inside tracks scroll; the left sidebar keeps section nav. */}
- <aside className="hidden w-[72px] shrink-0 justify-end pl-[16px] xl:flex">
+ <aside className="hidden w-18 shrink-0 justify-end pl-4 xl:flex">
<ReadingProgress />
</aside>
</div>
diff --git a/docs/components/editorial/mdx.tsx b/docs/components/editorial/mdx.tsx
index 20739964a5..2bb7e118cd 100644
--- a/docs/components/editorial/mdx.tsx
+++ b/docs/components/editorial/mdx.tsx
@@ -22,16 +22,16 @@ function ImageGlyph() {
}
const badgeToneClasses: Record<string, string> = {
- neutral: "border-[#DADAD5] bg-[#EFEFEB] text-[rgba(38,35,35,0.72)]",
- blue: "border-[#A9DAF3] bg-[#DFF5FF] text-[#2A6A8A]",
- green: "border-[#A8DB91] bg-[#E4F8DA] text-[#3F7A33]",
- amber: "border-[#E6CFA3] bg-[#FFF2D8] text-[#835F20]",
+ neutral: "border-ed-warm-400 bg-ed-warm-150 text-ed-ink/72",
+ blue: "border-ed-blue-border bg-ed-blue-bg text-[#2A6A8A]",
+ green: "border-ed-green-border bg-ed-green-bg text-[#3F7A33]",
+ amber: "border-ed-amber-stroke bg-ed-amber-fill text-[#835F20]",
};
function Badge({ children, tone = "neutral" }: { children: ReactNode; tone?: string }) {
return (
<span
- className={`inline-flex items-center rounded-[100px] border px-[10px] py-[4px] font-[family-name:var(--font-mono)] text-[11.5px] leading-[14px] tracking-[0.03em] ${badgeToneClasses[tone] || badgeToneClasses.neutral}`}
+ className={`inline-flex items-center rounded-full border px-2.5 py-1 font-mono text-ed-11 leading-3.5 tracking-[0.03em] ${badgeToneClasses[tone] || badgeToneClasses.neutral}`}
>
{children}
</span>
@@ -41,14 +41,14 @@ function Badge({ children, tone = "neutral" }: { children: ReactNode; tone?: str
export function Figure({ illustration, caption }: { illustration: IllustrationKey; caption?: string }) {
const Illustration = illustrations[illustration];
return (
- <figure className="my-[40px]">
+ <figure className="my-10">
<Zoomable>
- <div className="rounded-[12px] border border-[#E7E7E3] bg-[#FBFBF8] px-[24px] py-[28px] shadow-[inset_0_1px_0_#fff]">
+ <div className="rounded-xl border border-ed-hairline bg-ed-paper px-6 py-7 shadow-[inset_0_1px_0_#fff]">
{Illustration ? <Illustration /> : null}
</div>
</Zoomable>
{caption && (
- <figcaption className="mt-[12px] text-center text-[12px] text-ink-faint">{caption}</figcaption>
+ <figcaption className="mt-3 text-center text-ed-12 text-ink-faint">{caption}</figcaption>
)}
</figure>
);
@@ -66,22 +66,22 @@ export function Screenshot({
const aspect =
ratio === "tall" ? "aspect-[3/4]" : ratio === "square" ? "aspect-square" : "aspect-[16/9]";
return (
- <figure className="my-[40px]">
+ <figure className="my-10">
<Zoomable>
<div
- className={`relative w-full ${aspect} rounded-[12px] border border-dashed border-[#CCCBC4] bg-[#F1F1EC] overflow-hidden`}
+ className={`relative w-full ${aspect} rounded-xl border border-dashed border-ed-warm-500 bg-ed-header overflow-hidden`}
>
- <div className="absolute inset-0 flex flex-col items-center justify-center gap-[10px] px-6 text-center">
+ <div className="absolute inset-0 flex flex-col items-center justify-center gap-2.5 px-6 text-center">
<ImageGlyph />
- <span className="font-[family-name:var(--font-mono)] text-[10px] tracking-[0.08em] uppercase text-[rgba(38,35,35,0.7)]">
+ <span className="font-mono text-ed-10 tracking-[0.08em] uppercase text-ed-ink/70">
Carbon screenshot
</span>
- <span className="text-[14px] font-[500] text-[rgba(38,35,35,0.78)] max-w-[360px]">{label}</span>
+ <span className="text-ed-14 font-medium text-ed-ink/78 max-w-90">{label}</span>
</div>
</div>
</Zoomable>
{caption && (
- <figcaption className="mt-[12px] text-center text-[12px] text-ink-faint">{caption}</figcaption>
+ <figcaption className="mt-3 text-center text-ed-12 text-ink-faint">{caption}</figcaption>
)}
</figure>
);
@@ -99,13 +99,13 @@ export function Callout({
children: ReactNode;
}) {
return (
- <div className="my-[48px] callout-box p-[8px]">
- <div className="w-full callout-box-inner px-[22px] py-[20px]">
+ <div className="my-12 callout-box p-2">
+ <div className="w-full callout-box-inner px-[22px] py-5">
<Badge tone={tone}>{badge}</Badge>
- <p className="m-0 mt-[10px] text-[18px] font-[530] leading-[140%] text-ink">{title}</p>
+ <p className="m-0 mt-2.5 text-ed-18 font-demi leading-[140%] text-ink">{title}</p>
{/* div, not p: MDX already wraps the callout body in a paragraph, so a <p> here
would nest <p><p>…</p></p> (invalid → hydration mismatch). */}
- <div className="m-0 mt-[12px] text-[15px] font-[460] leading-[160%] tracking-[0.15px] text-[rgba(38,35,35,0.70)] [&>p]:m-0">
+ <div className="m-0 mt-3 text-ed-15 font-book leading-[160%] tracking-[0.15px] text-ed-ink/70 [&>p]:m-0">
{children}
</div>
</div>
@@ -114,29 +114,29 @@ export function Callout({
}
export function Divider() {
- return <hr className="my-[48px] border-none border-t border-[#E7E7E3]" />;
+ return <hr className="my-12 border-none border-t border-ed-hairline" />;
}
function Paragraph(props: ComponentPropsWithoutRef<"p">) {
return (
<p
{...props}
- className="m-0 mt-[20px] text-[0.97rem] font-normal leading-[1.72] tracking-[-0.32px] text-[rgba(38,35,35,0.78)]"
+ className="m-0 mt-5 text-ed-15 font-normal leading-[1.72] tracking-[-0.32px] text-ed-ink/78"
/>
);
}
function UnorderedList(props: ComponentPropsWithoutRef<"ul">) {
- return <ul {...props} className="m-0 mt-[20px] flex flex-col gap-[12px] list-none pl-0" />;
+ return <ul {...props} className="m-0 mt-5 flex flex-col gap-3 list-none pl-0" />;
}
function ListItem({ children, ...props }: ComponentPropsWithoutRef<"li">) {
return (
<li
{...props}
- className="flex gap-[12px] items-start text-[0.97rem] font-normal leading-[1.72] tracking-[-0.32px] text-[rgba(38,35,35,0.78)]"
+ className="flex gap-3 items-start text-ed-15 font-normal leading-[1.72] tracking-[-0.32px] text-ed-ink/78"
>
- <span className="mt-[8px] shrink-0 w-[8px] h-[8px] rounded-[24px] border-[1.5px] border-[rgba(190,190,190,0.50)] bg-[#F5F5F2] shadow-[0_1px_1px_0_#FFF,inset_0_0_0.357px_1.071px_#FFF,inset_0_0_0.357px_1.071px_rgba(255,255,255,0.35),inset_0_1.429px_0_0_#FFF]" />
+ <span className="mt-2 shrink-0 w-2 h-2 rounded-[24px] border-[1.5px] border-[rgba(190,190,190,0.50)] bg-ed-warm-100 shadow-[0_1px_1px_0_#FFF,inset_0_0_0.357px_1.071px_#FFF,inset_0_0_0.357px_1.071px_rgba(255,255,255,0.35),inset_0_1.429px_0_0_#FFF]" />
<span className="flex-1">{children}</span>
</li>
);
@@ -149,7 +149,7 @@ function HeadingAnchor({ id }: { id: string }) {
<a
href={`#${id}`}
aria-label="Link to this section"
- className="ml-[12px] inline-flex items-center align-middle text-ink-faint no-underline opacity-0 transition-[opacity,color] duration-150 hover:text-[#1E84B0] group-hover:opacity-100"
+ className="ml-3 inline-flex items-center align-middle text-ink-faint no-underline opacity-0 transition-[opacity,color] duration-150 hover:text-ed-brand-ink group-hover:opacity-100"
>
<svg
viewBox="0 0 24 24"
@@ -175,7 +175,7 @@ function Heading2({ id, children, ...props }: ComponentPropsWithoutRef<"h2">) {
<h2
{...props}
id={id}
- className="group scroll-mt-[120px] m-0 pt-[50px] text-[32px] md:text-[40px] font-normal leading-[115%] text-ink"
+ className="group scroll-mt-30 m-0 pt-[50px] text-ed-24 font-normal leading-[115%] text-ink"
>
{children}
{id ? <HeadingAnchor id={id} /> : null}
@@ -188,7 +188,7 @@ function Heading3({ id, children, ...props }: ComponentPropsWithoutRef<"h3">) {
<h3
{...props}
id={id}
- className="group m-0 mt-[48px] scroll-mt-[120px] text-[24px] font-[530] leading-[140%] tracking-[0.24px] text-ink"
+ className="group m-0 mt-12 scroll-mt-30 text-ed-20 font-demi leading-[140%] tracking-[0.24px] text-ink"
>
{children}
{id ? <HeadingAnchor id={id} /> : null}
@@ -197,14 +197,14 @@ function Heading3({ id, children, ...props }: ComponentPropsWithoutRef<"h3">) {
}
function Heading4(props: ComponentPropsWithoutRef<"h4">) {
- return <h4 {...props} className="m-0 mt-[32px] text-[15px] font-[530] leading-[140%] tracking-[0.15px] text-ink" />;
+ return <h4 {...props} className="m-0 mt-8 text-ed-16 font-demi leading-[140%] tracking-[0.15px] text-ink" />;
}
function Blockquote(props: ComponentPropsWithoutRef<"blockquote">) {
return (
<blockquote
{...props}
- className="m-0 mt-[20px] pl-[16px] border-l-[2px] border-[#D5D5D3] text-[15px] font-[460] leading-[160%] tracking-[0.15px] text-ink-faint italic"
+ className="m-0 mt-5 pl-4 border-l-[2px] border-ed-warm-500 text-ed-15 font-book leading-[160%] tracking-[0.15px] text-ink-faint italic"
/>
);
}
@@ -215,7 +215,7 @@ function Anchor(props: ComponentPropsWithoutRef<"a">) {
return (
<a
{...props}
- className="text-[#17729B] underline decoration-[rgba(23,114,155,0.4)] underline-offset-[3px] transition-colors hover:decoration-[#17729B]"
+ className="text-ed-blue-deep underline decoration-ed-blue-deep/40 underline-offset-[3px] transition-colors hover:decoration-ed-blue-deep"
/>
);
}
diff --git a/docs/components/editorial/reference-components.tsx b/docs/components/editorial/reference-components.tsx
index 34eb450855..17edd4c7ea 100644
--- a/docs/components/editorial/reference-components.tsx
+++ b/docs/components/editorial/reference-components.tsx
@@ -5,10 +5,10 @@ import type { ReactNode } from "react";
* mono badge, and warm cards with a hover arrow. Wired in via getMDXComponents. */
const toneClasses: Record<string, string> = {
- neutral: "border-[#DADAD5] bg-[#EFEFEB] text-[rgba(38,35,35,0.55)]",
- blue: "border-[#A9DAF3] bg-[#DFF5FF] text-[#3583A8]",
- green: "border-[#A8DB91] bg-[#E4F8DA] text-[#4F9140]",
- amber: "border-[#E6CFA3] bg-[#FFF2D8] text-[#9C7136]",
+ neutral: "border-ed-warm-400 bg-ed-warm-150 text-ed-ink/55",
+ blue: "border-ed-blue-border bg-ed-blue-bg text-ed-blue-mid",
+ green: "border-ed-green-border bg-ed-green-bg text-ed-green-text",
+ amber: "border-ed-amber-stroke bg-ed-amber-fill text-ed-amber-text",
};
const calloutKinds: Record<string, { badge: string; tone: keyof typeof toneClasses }> = {
@@ -32,17 +32,17 @@ export function Callout({
}) {
const kind = calloutKinds[type] ?? calloutKinds.info;
return (
- <div className="my-[32px] callout-box p-[8px]">
- <div className="w-full callout-box-inner px-[20px] py-[16px]">
+ <div className="my-8 callout-box p-2">
+ <div className="w-full callout-box-inner px-5 py-4">
<span
- className={`inline-flex items-center rounded-[100px] border px-[7px] py-[3px] font-[family-name:var(--font-mono)] text-[10px] leading-[12px] ${toneClasses[kind.tone]}`}
+ className={`inline-flex items-center rounded-full border px-[7px] py-[3px] font-mono text-ed-10 leading-3 ${toneClasses[kind.tone]}`}
>
{kind.badge}
</span>
{title && (
- <p className="m-0 mt-[10px] text-[16px] font-[560] leading-[140%] text-[#262323]">{title}</p>
+ <p className="m-0 mt-2.5 text-ed-16 font-semi leading-[140%] text-ed-ink">{title}</p>
)}
- <div className="m-0 mt-[8px] text-[14.5px] font-[460] leading-[160%] text-[rgba(38,35,35,0.72)] [&>p]:m-0 [&>p+p]:mt-[10px]">
+ <div className="m-0 mt-2 text-ed-14 font-book leading-[160%] text-ed-ink/72 [&>p]:m-0 [&>p+p]:mt-2.5">
{children}
</div>
</div>
@@ -58,7 +58,7 @@ export function PlanBadge({ plan = "Business", className = "" }: { plan?: string
return (
<span
title={`Available on the ${plan} and Partner plans`}
- className={`inline-flex items-center gap-[6px] whitespace-nowrap rounded-[100px] border border-[#E6CFA3] bg-[#FFF2D8] px-[10px] py-[3.5px] font-[family-name:var(--font-mono)] text-[10.5px] font-[600] uppercase tracking-[0.04em] text-[#9C7136] ${className}`}
+ className={`inline-flex items-center gap-1.5 whitespace-nowrap rounded-full border border-ed-amber-stroke bg-ed-amber-fill px-2.5 py-[3.5px] font-mono text-ed-10 font-semibold uppercase tracking-[0.04em] text-ed-amber-text ${className}`}
>
<svg width="11" height="11" viewBox="0 0 14 14" fill="none" aria-hidden="true" className="shrink-0">
<rect x="2.6" y="6.3" width="8.8" height="5.6" rx="1.4" stroke="currentColor" strokeWidth="1.3" />
@@ -70,7 +70,7 @@ export function PlanBadge({ plan = "Business", className = "" }: { plan?: string
}
export function Cards({ children }: { children?: ReactNode }) {
- return <div className="my-[28px] grid gap-[14px] sm:grid-cols-2">{children}</div>;
+ return <div className="my-7 grid gap-3.5 sm:grid-cols-2">{children}</div>;
}
export function Card({
@@ -87,16 +87,16 @@ export function Card({
return (
<a
href={href}
- className="group relative flex flex-col rounded-[14px] border border-[#E7E7E3] bg-[linear-gradient(180deg,#FFFFFF_0%,#FBFBF8_100%)] px-[18px] py-[15px] no-underline shadow-[0_1px_2px_rgba(0,0,0,0.03),inset_0_1px_0_#fff] transition-[transform,box-shadow,border-color] duration-200 hover:-translate-y-px hover:border-[#D2D2CC] hover:shadow-[0_12px_28px_-16px_rgba(0,0,0,0.22)]"
+ className="group relative flex flex-col rounded-[14px] border border-ed-hairline bg-[linear-gradient(180deg,#FFFFFF_0%,#FBFBF8_100%)] px-[18px] py-[15px] no-underline shadow-[0_1px_2px_rgba(0,0,0,0.03),inset_0_1px_0_#fff] transition-[transform,box-shadow,border-color] duration-200 hover:-translate-y-px hover:border-ed-warm-500 hover:shadow-[0_12px_28px_-16px_rgba(0,0,0,0.22)]"
>
- <div className="flex items-start justify-between gap-[10px]">
- <div className="flex min-w-0 items-center gap-[10px]">
+ <div className="flex items-start justify-between gap-2.5">
+ <div className="flex min-w-0 items-center gap-2.5">
{icon && (
- <span className="flex h-[26px] w-[26px] shrink-0 items-center justify-center rounded-[8px] border border-[#E7E7E3] bg-white text-[rgba(38,35,35,0.6)] shadow-[inset_0_1px_0_#fff]">
+ <span className="flex h-[26px] w-[26px] shrink-0 items-center justify-center rounded-lg border border-ed-hairline bg-white text-ed-ink/60 shadow-[inset_0_1px_0_#fff]">
{icon}
</span>
)}
- <span className="truncate text-[15px] font-[560] tracking-[0.1px] text-[#262323]">{title}</span>
+ <span className="truncate text-ed-15 font-semi tracking-[0.1px] text-ed-ink">{title}</span>
</div>
<svg
width="14"
@@ -104,7 +104,7 @@ export function Card({
viewBox="0 0 14 14"
fill="none"
aria-hidden
- className="mt-[4px] shrink-0 text-[rgba(38,35,35,0.3)] transition-all duration-200 group-hover:translate-x-[2px] group-hover:text-[rgba(38,35,35,0.62)]"
+ className="mt-1 shrink-0 text-ed-ink/30 transition-all duration-200 group-hover:translate-x-0.5 group-hover:text-ed-ink/62"
>
<path
d="M5.5 3.5L9 7l-3.5 3.5"
@@ -119,7 +119,7 @@ export function Card({
// div, not p: MDX wraps the card's text child in its own <p>, so a <p> here
// would nest <p><p> (hydration error). Re-apply the description styles to that
// inner <p> so .prose's paragraph rules don't resize it.
- <div className="mt-[7px] text-[13.5px] font-[450] leading-[155%] text-[rgba(38,35,35,0.56)] [&>p]:m-0 [&>p]:text-[13.5px] [&>p]:font-[450] [&>p]:leading-[155%] [&>p]:text-[rgba(38,35,35,0.56)]">
+ <div className="mt-[7px] text-ed-13 font-book leading-[155%] text-ed-ink/56 [&>p]:m-0 [&>p]:text-ed-13 [&>p]:font-book [&>p]:leading-[155%] [&>p]:text-ed-ink/56">
{children}
</div>
)}
@@ -131,7 +131,7 @@ export function Card({
* required badge, with a description beneath. Hairline-divided list. */
export function EnvVars({ children }: { children?: ReactNode }) {
return (
- <div className="my-[24px] divide-y divide-[#E7E7E3] border-y border-[#E7E7E3]">{children}</div>
+ <div className="my-6 divide-y divide-ed-hairline border-y border-ed-hairline">{children}</div>
);
}
@@ -149,31 +149,31 @@ export function EnvVar({
children?: ReactNode;
}) {
return (
- <div className="py-[16px]">
- <div className="flex flex-wrap items-center gap-x-[10px] gap-y-[4px]">
- <span className="font-[family-name:var(--font-mono)] text-[14px] font-[500] text-[#262323]">
+ <div className="py-4">
+ <div className="flex flex-wrap items-center gap-x-2.5 gap-y-1">
+ <span className="font-mono text-ed-14 font-medium text-ed-ink">
{name}
</span>
{type && (
- <span className="font-[family-name:var(--font-mono)] text-[12px] text-[rgba(38,35,35,0.45)]">
+ <span className="font-mono text-ed-12 text-ed-ink/45">
{type}
</span>
)}
{defaultValue != null && (
- <span className="font-[family-name:var(--font-mono)] text-[12px] text-[rgba(38,35,35,0.4)]">
+ <span className="font-mono text-ed-12 text-ed-ink/40">
default: {defaultValue}
</span>
)}
{required ? (
- <span className="inline-flex items-center rounded-[5px] border border-[#E6CFA3] bg-[#FFF2D8] px-[6px] py-[1px] text-[10.5px] font-medium tracking-[0.02em] text-[#9C7136]">
+ <span className="inline-flex items-center rounded-[5px] border border-ed-amber-stroke bg-ed-amber-fill px-1.5 py-px text-ed-10 font-medium tracking-[0.02em] text-ed-amber-text">
required
</span>
) : (
- <span className="text-[11px] text-[rgba(38,35,35,0.38)]">optional</span>
+ <span className="text-ed-11 text-ed-ink/38">optional</span>
)}
</div>
{children && (
- <div className="mt-[7px] text-[14px] leading-[155%] text-[rgba(38,35,35,0.66)] [&>p]:m-0 [&>p]:text-[14px] [&>p]:leading-[155%] [&>p]:text-[rgba(38,35,35,0.66)] [&>p+p]:mt-[8px]">
+ <div className="mt-[7px] text-ed-14 leading-[155%] text-ed-ink/66 [&>p]:m-0 [&>p]:text-ed-14 [&>p]:leading-[155%] [&>p]:text-ed-ink/66 [&>p+p]:mt-2">
{children}
</div>
)}
diff --git a/docs/components/editorial/sidebar-nav.tsx b/docs/components/editorial/sidebar-nav.tsx
index 7185be341d..fe334d4037 100644
--- a/docs/components/editorial/sidebar-nav.tsx
+++ b/docs/components/editorial/sidebar-nav.tsx
@@ -47,18 +47,18 @@ export function SidebarNav({ chapters, active, onActiveChange }: SidebarNavProps
}, [active.chapter, active.item]);
return (
- <nav className="flex flex-col gap-[40px]">
+ <nav className="flex flex-col gap-10">
{visible.map(({ chapter, index: chapterIdx }) => (
<div key={chapter.slug}>
<div className="relative flex items-center">
- <span className="absolute right-[calc(100%+10px)] top-1/2 -translate-y-1/2 font-[family-name:var(--font-mono)] text-[12px] font-[500] text-ink-faint leading-[140%] tracking-[0.12px] whitespace-nowrap">
+ <span className="absolute right-[calc(100%+10px)] top-1/2 -translate-y-1/2 font-mono text-ed-12 font-medium text-ink-faint leading-[140%] tracking-[0.12px] whitespace-nowrap">
{chapter.label}
</span>
- <span className="text-[rgba(32,32,32,0.80)] text-[15px] font-[530] leading-[140%] tracking-[0.15px]">
+ <span className="text-ed-ink/80 text-ed-15 font-demi leading-[140%] tracking-[0.15px]">
{chapter.title}
</span>
</div>
- <div className="mt-[24px] flex flex-col gap-[12px]">
+ <div className="mt-6 flex flex-col gap-3">
{chapter.items.map((item, itemIdx) => {
const isActive = active.chapter === chapterIdx && active.item === itemIdx;
return (
@@ -67,16 +67,16 @@ export function SidebarNav({ chapters, active, onActiveChange }: SidebarNavProps
ref={isActive ? activeRef : undefined}
type="button"
onClick={() => onActiveChange({ chapter: chapterIdx, item: itemIdx })}
- className="flex gap-[14px] text-left cursor-pointer bg-transparent border-none p-0 items-center"
+ className="flex gap-3.5 text-left cursor-pointer bg-transparent border-none p-0 items-center"
>
<div
- className={`w-[8px] h-[8px] rounded-[5.5px] shrink-0 transition-all duration-200 ${
+ className={`w-2 h-2 rounded-[5.5px] shrink-0 transition-all duration-200 ${
isActive
- ? "bg-[#B2E7FF] shadow-[0_1px_1px_0_rgba(0,126,183,0.70),inset_0_0.5px_0.2px_0_#FFF,0_0_0_3px_#96DEFF]"
- : "bg-[#F3F3F0] shadow-[0_1px_1px_0_rgba(0,0,0,0.25),0_0_0_3px_rgba(213,213,211,0.50),inset_0_0.5px_0.2px_0_#FFF]"
+ ? "bg-ed-blue-bg-strong shadow-[0_1px_1px_0_rgba(0,126,183,0.70),inset_0_0.5px_0.2px_0_#FFF,0_0_0_3px_#96DEFF]"
+ : "bg-ed-warm-100 shadow-[0_1px_1px_0_rgba(0,0,0,0.25),0_0_0_3px_rgba(213,213,211,0.50),inset_0_0.5px_0.2px_0_#FFF]"
}`}
/>
- <span className="text-[rgba(75,75,74,0.80)] text-[15px] font-[460] leading-[140%] tracking-[0.15px] whitespace-pre-line">
+ <span className="text-ed-graphite/80 text-ed-15 font-book leading-[140%] tracking-[0.15px] whitespace-pre-line">
{item.title}
</span>
</button>
diff --git a/docs/components/editorial/site-header.tsx b/docs/components/editorial/site-header.tsx
index 2e65e9bad8..f9d6f553e8 100644
--- a/docs/components/editorial/site-header.tsx
+++ b/docs/components/editorial/site-header.tsx
@@ -5,7 +5,7 @@ import { useGuide } from "./guide-context";
function Divider() {
return (
- <span className="relative mx-[7px] self-center shrink-0 w-[1px] h-[16px] translate-y-[4px]">
+ <span className="relative mx-[7px] self-center shrink-0 w-px h-4 translate-y-1">
<span
className="absolute inset-0 opacity-40"
style={{
@@ -30,11 +30,11 @@ export function SiteHeader() {
boxShadow: "0 1px 0 0 #fff",
}}
>
- <div className="w-full max-w-[1440px] mx-auto px-[20px] min-[476px]:px-[32px] md:px-[20px] py-[18px] min-[1000px]:py-0 min-[1000px]:pt-[26px] min-[1000px]:pb-[23px] flex items-center justify-between">
+ <div className="w-full max-w-360 mx-auto px-5 min-[476px]:px-8 md:px-5 py-[18px] min-[1000px]:py-0 min-[1000px]:pt-[26px] min-[1000px]:pb-[23px] flex items-center justify-between">
{/* Logo */}
- <Link className="shrink-0 flex items-center gap-[10px] no-underline" aria-label="Home" href="/">
+ <Link className="shrink-0 flex items-center gap-2.5 no-underline" aria-label="Home" href="/">
<img src="/carbon-mark-light.svg" alt="" width={22} height={22} className="block" />
- <span className="hidden min-[480px]:inline text-ink-ui text-[16px] font-[580] tracking-[0.16px]">
+ <span className="hidden min-[480px]:inline text-ink-ui text-ed-16 font-semi tracking-[0.16px]">
Carbon
</span>
</Link>
@@ -42,10 +42,10 @@ export function SiteHeader() {
{/* Desktop Navigation */}
<div className="hidden min-[1000px]:block">
<nav className="flex items-center gap-3">
- <div className="relative flex h-[41px] items-center pl-[14px] pr-[10px] rounded-[8px]">
- <span className="group relative inline-flex items-center justify-center rounded-[4px] py-[2px] px-[5px] pointer-events-none">
+ <div className="relative flex h-[41px] items-center pl-3.5 pr-2.5 rounded-lg">
+ <span className="group relative inline-flex items-center justify-center rounded-sm py-0.5 px-[5px] pointer-events-none">
<span
- className="nav-link relative z-10 no-underline whitespace-nowrap px-[6px] text-[15px] leading-[150%] tracking-[0.15px] font-[460] cursor-default"
+ className="nav-link relative z-10 no-underline whitespace-nowrap px-1.5 text-ed-15 leading-normal tracking-[0.15px] font-book cursor-default"
style={{ color: "rgba(32, 32, 32, 0.40)" }}
>
How to
@@ -57,15 +57,15 @@ export function SiteHeader() {
return (
<span className="contents" key={chapter.slug}>
<Divider />
- <span className="group relative inline-flex items-center justify-center rounded-[4px] py-[2px] px-[5px]">
+ <span className="group relative inline-flex items-center justify-center rounded-sm py-0.5 px-[5px]">
<span
aria-hidden="true"
- className={`pointer-events-none absolute inset-0 rounded-[4px] transition-opacity duration-200 ease-out ${
+ className={`pointer-events-none absolute inset-0 rounded-sm transition-opacity duration-200 ease-out ${
isActive ? "opacity-100" : "opacity-0 group-hover:opacity-100"
- } bg-[rgba(231,231,227,0.80)]`}
+ } bg-ed-hairline/80`}
/>
<a
- className="nav-link relative z-10 no-underline whitespace-nowrap px-[6px] text-[15px] leading-[150%] tracking-[0.15px] transition-[color,font-weight] duration-200 ease-in-out text-ink-ui font-[460]"
+ className="nav-link relative z-10 no-underline whitespace-nowrap px-1.5 text-ed-15 leading-normal tracking-[0.15px] transition-[color,font-weight] duration-200 ease-in-out text-ink-ui font-book"
href={`/guides/${chapter.slug}`}
aria-current={isActive ? "page" : undefined}
onClick={(e) => {
@@ -82,14 +82,14 @@ export function SiteHeader() {
</div>
{/* Reference (Fumadocs surface) */}
- <div className="relative flex h-[41px] items-center justify-center px-[8px] rounded-[8px]">
- <span className="relative inline-flex items-center justify-center rounded-[4px] py-[2px] px-[5px] group">
+ <div className="relative flex h-[41px] items-center justify-center px-2 rounded-lg">
+ <span className="relative inline-flex items-center justify-center rounded-sm py-0.5 px-[5px] group">
<span
aria-hidden="true"
- className="pointer-events-none absolute inset-0 rounded-[4px] bg-[rgba(231,231,227,0.80)] transition-opacity duration-200 ease-out opacity-0 group-hover:opacity-100"
+ className="pointer-events-none absolute inset-0 rounded-sm bg-ed-hairline/80 transition-opacity duration-200 ease-out opacity-0 group-hover:opacity-100"
/>
<Link
- className="nav-link relative z-10 no-underline whitespace-nowrap px-[6px] text-[15px] leading-[150%] tracking-[0.15px] text-ink-ui font-[460]"
+ className="nav-link relative z-10 no-underline whitespace-nowrap px-1.5 text-ed-15 leading-normal tracking-[0.15px] text-ink-ui font-book"
href="/docs"
>
Reference
@@ -99,19 +99,19 @@ export function SiteHeader() {
{/* CTA */}
<a
- className="group relative inline-flex items-center justify-center no-underline whitespace-nowrap cursor-pointer h-[41px] px-3 rounded-[8px] w-[140px]"
+ className="group relative inline-flex items-center justify-center no-underline whitespace-nowrap cursor-pointer h-[41px] px-3 rounded-lg w-35"
href="https://app.carbon.ms"
>
<span
aria-hidden="true"
- className="pointer-events-none absolute inset-0 rounded-[8px] cta-btn-dark opacity-100"
+ className="pointer-events-none absolute inset-0 rounded-lg cta-btn-dark opacity-100"
/>
<span
aria-hidden="true"
- className="pointer-events-none absolute inset-0 rounded-[8px] btn-dark-hover opacity-0 duration-200 ease-out group-hover:opacity-100 transition-opacity"
+ className="pointer-events-none absolute inset-0 rounded-lg btn-dark-hover opacity-0 duration-200 ease-out group-hover:opacity-100 transition-opacity"
/>
- <span className="relative z-10 inline-flex items-center justify-center gap-[6px]">
- <span className="font-[460] text-[15px] tracking-[0.15px] text-on-dark">Open Carbon</span>
+ <span className="relative z-10 inline-flex items-center justify-center gap-1.5">
+ <span className="font-book text-ed-15 tracking-[0.15px] text-on-dark">Open Carbon</span>
</span>
</a>
</nav>
diff --git a/docs/components/editorial/status-flow.tsx b/docs/components/editorial/status-flow.tsx
index 0ec532d277..41530e0f21 100644
--- a/docs/components/editorial/status-flow.tsx
+++ b/docs/components/editorial/status-flow.tsx
@@ -113,12 +113,12 @@ const BADGE: Record<StatusColor, { cls: string; Icon: ComponentType<{ className?
orange: { cls: "bg-orange-100 text-orange-800 border-orange-500/20", Icon: CircleAlert },
red: { cls: "bg-red-100 text-red-800 border-red-500/20", Icon: CircleSlash },
blue: { cls: "bg-blue-100 text-blue-800 border-blue-500/20", Icon: LoaderCircle },
- gray: { cls: "bg-[#e3e2e080] text-[#32302c] border-transparent", Icon: CircleDashed },
+ gray: { cls: "bg-ed-warm-300/50 text-[#32302c] border-transparent", Icon: CircleDashed },
purple: { cls: "bg-violet-100 text-violet-800 border-violet-500/20", Icon: Star },
};
const BADGE_BASE =
- "inline-flex items-center gap-[5px] rounded-md border px-2 py-[4px] text-[11px] font-bold uppercase tracking-tight leading-none whitespace-nowrap";
+ "inline-flex items-center gap-[5px] rounded-md border px-2 py-1 text-ed-11 font-bold uppercase tracking-tight leading-none whitespace-nowrap";
export function StatusFlow({
children,
@@ -195,7 +195,7 @@ export function StatusFlow({
: undefined
}
>
- <Icon className="h-[12px] w-[12px] shrink-0" />
+ <Icon className="h-3 w-3 shrink-0" />
{s.name}
</button>
);
@@ -207,18 +207,18 @@ export function StatusFlow({
const SelIcon = BADGE[selColor].Icon;
return (
- <figure className="my-[36px] overflow-hidden rounded-[14px] border border-ed-hairline bg-ed-paper">
+ <figure className="my-9 overflow-hidden rounded-[14px] border border-ed-hairline bg-ed-paper">
<div
role="group"
aria-label={ariaLabel}
onKeyDown={onKeyDown}
- className="flex flex-col gap-[12px] px-[18px] pt-[18px] pb-[16px]"
+ className="flex flex-col gap-3 px-[18px] pt-[18px] pb-4"
>
- <div className="flex flex-wrap items-center gap-x-[4px] gap-y-[10px]">
+ <div className="flex flex-wrap items-center gap-x-1 gap-y-2.5">
{mainItems.map((s, j) => (
<Fragment key={s.idx}>
{j > 0 && (
- <span aria-hidden="true" className="px-[2px] text-[14px] leading-none text-ed-ink-45">
+ <span aria-hidden="true" className="px-0.5 text-ed-14 leading-none text-ed-ink-45">
→
</span>
)}
@@ -227,8 +227,8 @@ export function StatusFlow({
))}
</div>
{offItems.length > 0 && (
- <div className="flex flex-wrap items-center gap-[8px]">
- <span className="font-[family-name:var(--font-mono)] text-[9.5px] font-[600] uppercase tracking-[0.08em] text-ed-ink-45">
+ <div className="flex flex-wrap items-center gap-2">
+ <span className="font-mono text-ed-10 font-semibold uppercase tracking-[0.08em] text-ed-ink-45">
Off-track
</span>
{offItems.map((s) => pill(s))}
@@ -240,10 +240,10 @@ export function StatusFlow({
<div aria-live="polite" className="border-t border-ed-hairline bg-ed-inset px-[18px] py-[15px]">
<div key={sel} className="animate-in fade-in-0 duration-200 motion-reduce:animate-none">
<span className={`${BADGE_BASE} ${BADGE[selColor].cls}`}>
- <SelIcon className="h-[12px] w-[12px] shrink-0" />
+ <SelIcon className="h-3 w-3 shrink-0" />
{selected.name}
</span>
- <div className="mt-[10px] text-[13.5px] leading-[1.6] text-ed-ink-66 [&>p]:m-0 [&>p]:text-[13.5px] [&>p]:leading-[1.6]">
+ <div className="mt-2.5 text-ed-13 leading-[1.6] text-ed-ink-66 [&>p]:m-0 [&>p]:text-ed-13 [&>p]:leading-[1.6]">
{selected.children}
</div>
</div>
diff --git a/docs/components/editorial/term.tsx b/docs/components/editorial/term.tsx
index af6ba39fe2..a0f1ab0e71 100644
--- a/docs/components/editorial/term.tsx
+++ b/docs/components/editorial/term.tsx
@@ -36,7 +36,7 @@ export function Term({ id, children }: { id?: string; children: ReactNode }) {
<Popover.Trigger asChild>
<button
type="button"
- className="inline cursor-help appearance-none border-0 bg-transparent p-0 m-0 [font:inherit] text-inherit align-baseline underline decoration-dotted decoration-[#1E84B0] decoration-[1.5px] underline-offset-[3.5px] transition-colors hover:decoration-[#0C6E96] focus:outline-none focus-visible:outline-none focus-visible:rounded-[2px] focus-visible:ring-2 focus-visible:ring-[#00B0FF]/50"
+ className="inline cursor-help appearance-none border-0 bg-transparent p-0 m-0 [font:inherit] text-inherit align-baseline underline decoration-dotted decoration-ed-brand-ink decoration-[1.5px] underline-offset-[3.5px] transition-colors hover:decoration-ed-blue-text focus:outline-none focus-visible:outline-none focus-visible:rounded-[2px] focus-visible:ring-2 focus-visible:ring-ed-brand/50"
>
{children}
</button>
@@ -47,18 +47,18 @@ export function Term({ id, children }: { id?: string; children: ReactNode }) {
align="start"
sideOffset={8}
collisionPadding={16}
- className="z-50 w-[300px] max-w-[calc(100vw-32px)] rounded-[10px] border border-[#E3E3DF] bg-white px-[15px] py-[14px] shadow-[0_4px_20px_rgba(38,35,35,0.10)]"
+ className="z-50 w-75 max-w-[calc(100vw-32px)] rounded-[10px] border border-ed-warm-300 bg-white px-[15px] py-3.5 shadow-[0_4px_20px_rgba(38,35,35,0.10)]"
>
- <div className="text-[13px] font-[500] text-[#262323]">{entry.term}</div>
- <div className="mt-[5px] text-[13px] leading-[1.55] text-[rgba(38,35,35,0.72)]">
+ <div className="text-ed-13 font-medium text-ed-ink">{entry.term}</div>
+ <div className="mt-[5px] text-ed-13 leading-[1.55] text-ed-ink/72">
{entry.definition}
</div>
{entry.href && (
- <div className="mt-[11px] border-t border-[#EFEFEB] pt-[10px]">
+ <div className="mt-[11px] border-t border-ed-warm-150 pt-2.5">
<Popover.Close asChild>
<Link
href={entry.href}
- className="inline-flex items-center gap-[4px] text-[13px] font-[500] text-[#1E84B0] no-underline hover:text-[#0C6E96]"
+ className="inline-flex items-center gap-1 text-ed-13 font-medium text-ed-brand-ink no-underline hover:text-ed-blue-text"
>
Learn more
<span aria-hidden>→</span>
diff --git a/docs/components/editorial/zoomable.tsx b/docs/components/editorial/zoomable.tsx
index 3556b90dc7..50ffa586e9 100644
--- a/docs/components/editorial/zoomable.tsx
+++ b/docs/components/editorial/zoomable.tsx
@@ -78,7 +78,7 @@ export function Zoomable({ children }: { children: ReactNode }) {
{/* Accessible name; prefixing keeps any visible caption in the name (Label in Name). */}
<span className="sr-only">Enlarge: </span>
{children}
- <span className="pointer-events-none absolute right-[14px] top-[14px] flex h-[28px] w-[28px] items-center justify-center rounded-[8px] border border-[#E7E7E3] bg-[#FBFBF8]/90 opacity-0 shadow-sm backdrop-blur-sm transition-opacity duration-200 group-hover:opacity-100">
+ <span className="pointer-events-none absolute right-3.5 top-3.5 flex h-7 w-7 items-center justify-center rounded-lg border border-ed-hairline bg-ed-paper/90 opacity-0 shadow-sm backdrop-blur-sm transition-opacity duration-200 group-hover:opacity-100">
<svg width="14" height="14" viewBox="0 0 16 16" fill="none" aria-hidden>
<path
d="M6 2H2v4M10 2h4v4M6 14H2v-4M10 14h4v-4"
@@ -95,11 +95,11 @@ export function Zoomable({ children }: { children: ReactNode }) {
open &&
createPortal(
<div
- className="fixed inset-0 z-[300] flex items-center justify-center p-[20px] md:p-[56px]"
+ className="fixed inset-0 z-[300] flex items-center justify-center p-5 md:p-14"
onClick={() => set(false)}
>
{/* Backdrop fades in/out via the root view transition (or instantly without VT). */}
- <div aria-hidden className="absolute inset-0 bg-[rgba(38,35,35,0.55)] backdrop-blur-[3px]" />
+ <div aria-hidden className="absolute inset-0 bg-ed-ink/55 backdrop-blur-[3px]" />
<div
onClick={(e) => e.stopPropagation()}
style={{ viewTransitionName: name }}
diff --git a/docs/components/feature-callout.tsx b/docs/components/feature-callout.tsx
index 2974e07781..f59e34f4b1 100644
--- a/docs/components/feature-callout.tsx
+++ b/docs/components/feature-callout.tsx
@@ -42,7 +42,7 @@ export function FeatureCallout({
</Link>
)}
</div>
- <div className="text-[15px] leading-relaxed text-foreground [&>p]:m-0">{children}</div>
+ <div className="text-ed-15 leading-relaxed text-foreground [&>p]:m-0">{children}</div>
</div>
{aside && (
diff --git a/docs/components/main-header.tsx b/docs/components/main-header.tsx
index 24771f45a0..b7c4b8feb6 100644
--- a/docs/components/main-header.tsx
+++ b/docs/components/main-header.tsx
@@ -19,24 +19,24 @@ type Active = (typeof NAV)[number]["key"];
export function MainHeader({ active, mobileNav }: { active?: Active; mobileNav?: ReactNode }) {
return (
<header
- className="fixed inset-x-0 top-0 z-[60] h-[64px]"
+ className="fixed inset-x-0 top-0 z-[60] h-16"
style={{ background: "#F5F5F2", borderBottom: "1px solid #E8E7E6", boxShadow: "0 1px 0 0 #fff" }}
>
{/* Inner row capped to the content width so the logo/CTA don't drift to the
screen edges on large displays — aligns with the docs/api/mcp containers. */}
- <div className="mx-auto flex h-full w-full max-w-[1480px] items-center justify-between px-[24px] md:px-[32px]">
+ <div className="mx-auto flex h-full w-full max-w-370 items-center justify-between px-6 md:px-8">
<div className="flex items-center gap-[26px]">
<SiteLogo />
- <nav className="hidden items-center gap-[2px] lg:flex">
+ <nav className="hidden items-center gap-0.5 lg:flex">
{NAV.map((item) => (
<Link
key={item.key}
href={item.href}
aria-current={active === item.key ? "page" : undefined}
- className={`nav-link rounded-[7px] px-[10px] py-[6px] text-[15px] leading-[150%] tracking-[0.15px] no-underline transition-colors ${
+ className={`nav-link rounded-[7px] px-2.5 py-1.5 text-ed-15 leading-normal tracking-[0.15px] no-underline transition-colors ${
active === item.key
- ? "text-ink-ui font-[530]"
- : "text-ink-faint font-[460] hover:text-ink-ui hover:bg-[rgba(231,231,227,0.55)]"
+ ? "text-ink-ui font-demi"
+ : "text-ink-faint font-book hover:text-ink-ui hover:bg-ed-hairline/55"
}`}
>
{item.label}
@@ -45,18 +45,18 @@ export function MainHeader({ active, mobileNav }: { active?: Active; mobileNav?:
</nav>
</div>
- <div className="flex items-center gap-[10px]">
+ <div className="flex items-center gap-2.5">
<SearchCommand />
<a
- className="group relative hidden h-[40px] items-center justify-center rounded-[8px] px-[16px] no-underline sm:inline-flex"
+ className="group relative hidden h-10 items-center justify-center rounded-lg px-4 no-underline sm:inline-flex"
href="https://app.carbon.ms"
>
- <span aria-hidden="true" className="pointer-events-none absolute inset-0 rounded-[8px] cta-btn-dark" />
+ <span aria-hidden="true" className="pointer-events-none absolute inset-0 rounded-lg cta-btn-dark" />
<span
aria-hidden="true"
- className="pointer-events-none absolute inset-0 rounded-[8px] btn-dark-hover opacity-0 transition-opacity duration-200 ease-out group-hover:opacity-100"
+ className="pointer-events-none absolute inset-0 rounded-lg btn-dark-hover opacity-0 transition-opacity duration-200 ease-out group-hover:opacity-100"
/>
- <span className="text-on-dark relative z-10 text-[14px] font-[460] tracking-[0.15px]">Open Carbon</span>
+ <span className="text-on-dark relative z-10 text-ed-14 font-book tracking-[0.15px]">Open Carbon</span>
</a>
<MobileNav active={active}>{mobileNav}</MobileNav>
</div>
diff --git a/docs/components/mdx.tsx b/docs/components/mdx.tsx
index 338cc4f036..3b0ec56f85 100644
--- a/docs/components/mdx.tsx
+++ b/docs/components/mdx.tsx
@@ -39,7 +39,7 @@ export function getMDXComponents(components?: MDXComponents) {
// ~330px, so wrap every table in a horizontal scroller — it keeps the rounded
// frame and lets the table scroll instead of forcing the page to.
table: ({ children, ...props }: ComponentProps<"table">) => (
- <div className="-mx-[2px] my-[20px] overflow-x-auto overscroll-x-contain">
+ <div className="-mx-[2px] my-5 overflow-x-auto overscroll-x-contain">
<table {...props} className="!my-0 min-w-full">
{children}
</table>
@@ -48,7 +48,7 @@ export function getMDXComponents(components?: MDXComponents) {
// Markdown images zoom too, via the same shared lightbox the Guide figures use.
img: ({ alt, ...props }: ComponentProps<"img">) => (
<Zoomable>
- <img {...props} alt={alt ?? ""} className="block w-full rounded-[12px] border border-ed-hairline" />
+ <img {...props} alt={alt ?? ""} className="block w-full rounded-xl border border-ed-hairline" />
</Zoomable>
),
Card,
diff --git a/docs/components/mobile-nav.tsx b/docs/components/mobile-nav.tsx
index 42407e90d1..a6351a0a01 100644
--- a/docs/components/mobile-nav.tsx
+++ b/docs/components/mobile-nav.tsx
@@ -42,7 +42,7 @@ function HamburgerIcon({ open }: { open: boolean }) {
<span className="relative block h-[15px] w-[18px]" aria-hidden="true">
<span
className={`absolute left-0 h-[1.6px] w-full rounded-full bg-current transition-all duration-300 ease-out ${
- open ? "top-1/2 -translate-y-1/2 rotate-45" : "top-[2px]"
+ open ? "top-1/2 -translate-y-1/2 rotate-45" : "top-0.5"
}`}
/>
<span
@@ -52,7 +52,7 @@ function HamburgerIcon({ open }: { open: boolean }) {
/>
<span
className={`absolute left-0 h-[1.6px] w-full rounded-full bg-current transition-all duration-300 ease-out ${
- open ? "top-1/2 -translate-y-1/2 -rotate-45" : "bottom-[2px]"
+ open ? "top-1/2 -translate-y-1/2 -rotate-45" : "bottom-0.5"
}`}
/>
</span>
@@ -105,7 +105,7 @@ export function MobileNav({ active, children }: { active?: Active; children?: Re
onClick={() => setOpen((v) => !v)}
aria-label={open ? "Close menu" : "Open menu"}
aria-expanded={open}
- className="inline-flex h-[40px] w-[40px] items-center justify-center rounded-[8px] border border-[rgba(32,32,32,0.1)] bg-[#F5F5F2] text-ink-ui shadow-[0_1px_2px_0_rgba(0,0,0,0.04)] transition-colors hover:bg-[rgba(231,231,227,0.6)] lg:hidden"
+ className="inline-flex h-10 w-10 items-center justify-center rounded-lg border border-ed-ink/10 bg-ed-warm-100 text-ink-ui shadow-[0_1px_2px_0_rgba(0,0,0,0.04)] transition-colors hover:bg-ed-hairline/60 lg:hidden"
>
<HamburgerIcon open={open} />
</button>
@@ -137,25 +137,25 @@ export function MobileNav({ active, children }: { active?: Active; children?: Re
role="dialog"
aria-modal="true"
aria-label="Navigation"
- className={`absolute bottom-0 left-0 top-[64px] flex w-[min(86vw,340px)] flex-col overflow-y-auto overscroll-contain border-r border-[#E7E7E3] bg-[#FBFBF9] shadow-[8px_0_40px_-12px_rgba(38,35,35,0.28)] transition-transform duration-300 ease-out scrollbar-hidden-until-scroll ${
+ className={`absolute bottom-0 left-0 top-16 flex w-[min(86vw,340px)] flex-col overflow-y-auto overscroll-contain border-r border-ed-hairline bg-ed-paper shadow-[8px_0_40px_-12px_rgba(38,35,35,0.28)] transition-transform duration-300 ease-out scrollbar-hidden-until-scroll ${
open ? "translate-x-0" : "-translate-x-full"
}`}
>
- <div className="flex flex-1 flex-col px-[20px] pb-[24px] pt-[22px]">
+ <div className="flex flex-1 flex-col px-5 pb-6 pt-[22px]">
{/* Site-level nav */}
- <p className="mb-[8px] px-[4px] font-[family-name:var(--font-mono)] text-[11.5px] font-[600] uppercase tracking-[0.08em] text-[rgba(38,35,35,0.5)]">
+ <p className="mb-2 px-1 font-mono text-ed-11 font-semibold uppercase tracking-[0.08em] text-ed-ink/50">
Browse
</p>
- <nav className="flex flex-col gap-[2px]">
+ <nav className="flex flex-col gap-0.5">
{NAV.map((item) => (
<Link
key={item.key}
href={item.href}
aria-current={active === item.key ? "page" : undefined}
- className={`rounded-[8px] px-[12px] py-[10px] text-[16px] leading-[140%] tracking-[0.15px] no-underline transition-colors ${
+ className={`rounded-lg px-3 py-2.5 text-ed-16 leading-[140%] tracking-[0.15px] no-underline transition-colors ${
active === item.key
- ? "bg-[rgba(0,176,255,0.10)] font-[530] text-[#1E84B0]"
- : "font-[460] text-ink-ui hover:bg-[rgba(231,231,227,0.55)]"
+ ? "bg-ed-brand/10 font-demi text-ed-brand-ink"
+ : "font-book text-ink-ui hover:bg-ed-hairline/55"
}`}
>
{item.label}
@@ -166,17 +166,17 @@ export function MobileNav({ active, children }: { active?: Active; children?: Re
{/* Section tree for the current surface, if any */}
{children ? (
<CloseCtx.Provider value={close}>
- <div className="mt-[22px] border-t border-[#E7E7E3] pt-[22px]">{children}</div>
+ <div className="mt-[22px] border-t border-ed-hairline pt-[22px]">{children}</div>
</CloseCtx.Provider>
) : null}
{/* CTA pinned to the bottom of the panel */}
<a
href="https://app.carbon.ms"
- className="group relative mt-[26px] inline-flex h-[44px] items-center justify-center rounded-[8px] no-underline"
+ className="group relative mt-[26px] inline-flex h-11 items-center justify-center rounded-lg no-underline"
>
- <span aria-hidden="true" className="pointer-events-none absolute inset-0 rounded-[8px] cta-btn-dark" />
- <span className="text-on-dark relative z-10 text-[15px] font-[460] tracking-[0.15px]">
+ <span aria-hidden="true" className="pointer-events-none absolute inset-0 rounded-lg cta-btn-dark" />
+ <span className="text-on-dark relative z-10 text-ed-15 font-book tracking-[0.15px]">
Open Carbon
</span>
</a>
diff --git a/docs/components/nav-scroll-chevron.tsx b/docs/components/nav-scroll-chevron.tsx
index 7cea9dfe93..433cff0454 100644
--- a/docs/components/nav-scroll-chevron.tsx
+++ b/docs/components/nav-scroll-chevron.tsx
@@ -38,12 +38,12 @@ export function NavScrollChevron() {
<div
ref={ref}
aria-hidden
- className={`pointer-events-none sticky bottom-[-28px] z-10 -mx-[20px] flex h-[48px] items-end justify-center pb-[12px] transition-opacity duration-200 ${
+ className={`pointer-events-none sticky bottom-[-28px] z-10 -mx-[20px] flex h-12 items-end justify-center pb-3 transition-opacity duration-200 ${
more ? "opacity-100" : "opacity-0"
}`}
style={{ background: "linear-gradient(to top, #FBFBF9 42%, rgba(251,251,249,0))" }}
>
- <span className="flex h-[22px] w-[22px] items-center justify-center rounded-full border border-[#E7E7E3] bg-[#FBFBF8] text-[rgba(38,35,35,0.5)] shadow-[0_2px_6px_-2px_rgba(0,0,0,0.2)]">
+ <span className="flex h-[22px] w-[22px] items-center justify-center rounded-full border border-ed-hairline bg-ed-paper text-ed-ink/50 shadow-[0_2px_6px_-2px_rgba(0,0,0,0.2)]">
<svg width="13" height="13" viewBox="0 0 16 16" fill="none" aria-hidden>
<path
d="M4 6l4 4 4-4"
diff --git a/docs/components/reading-progress.tsx b/docs/components/reading-progress.tsx
index e6173e4e32..f5e2081b02 100644
--- a/docs/components/reading-progress.tsx
+++ b/docs/components/reading-progress.tsx
@@ -15,7 +15,7 @@ function Ticks({ className }: { className?: string }) {
<div className={`flex h-full w-full flex-col items-end justify-between ${className ?? ""}`}>
{Array.from({ length: TICKS }).map((_, i) => (
// biome-ignore lint/suspicious/noArrayIndexKey: fixed-length decorative ruler
- <span key={i} className="h-px w-[14px] rounded-full bg-current" />
+ <span key={i} className="h-px w-3.5 rounded-full bg-current" />
))}
</div>
);
@@ -34,9 +34,9 @@ export function ReadingProgress({ top = 116 }: { top?: number }) {
{/* Base ruler (unread) */}
<Ticks className="text-[#D8D9D6]" />
{/* Brand overlay clipped to scroll depth; inner copy is full-height so ticks align */}
- <div className="reading-progress-fill absolute inset-x-0 top-0 overflow-hidden text-[#00B0FF]">
+ <div className="reading-progress-fill absolute inset-x-0 top-0 overflow-hidden text-ed-brand">
<div style={{ height: railHeight }}>
- <Ticks className="text-[#00B0FF]" />
+ <Ticks className="text-ed-brand" />
</div>
</div>
</div>
diff --git a/docs/components/scroll-hints.tsx b/docs/components/scroll-hints.tsx
index fb12631e4a..2ed205d82b 100644
--- a/docs/components/scroll-hints.tsx
+++ b/docs/components/scroll-hints.tsx
@@ -22,7 +22,7 @@ export function ScrollHints() {
type="button"
aria-label="Back to top"
onClick={() => window.scrollTo({ top: 0, behavior: "smooth" })}
- className={`fixed bottom-[22px] right-[22px] z-[60] flex h-[40px] w-[40px] items-center justify-center rounded-full border border-[#E7E7E3] bg-[rgba(251,251,248,0.92)] text-[rgba(38,35,35,0.55)] shadow-[0_6px_18px_-6px_rgba(0,0,0,0.25)] backdrop-blur transition-all duration-200 hover:-translate-y-px hover:border-[#D2D2CC] hover:text-[#262323] ${
+ className={`fixed bottom-[22px] right-[22px] z-[60] flex h-10 w-10 items-center justify-center rounded-full border border-ed-hairline bg-ed-paper/92 text-ed-ink/55 shadow-[0_6px_18px_-6px_rgba(0,0,0,0.25)] backdrop-blur transition-all duration-200 hover:-translate-y-px hover:border-ed-warm-500 hover:text-ed-ink ${
scrolled ? "translate-y-0 opacity-100" : "pointer-events-none translate-y-2 opacity-0"
}`}
>
diff --git a/docs/components/search/search-command.tsx b/docs/components/search/search-command.tsx
index 3e9f77774b..57788549fb 100644
--- a/docs/components/search/search-command.tsx
+++ b/docs/components/search/search-command.tsx
@@ -47,10 +47,10 @@ const SURFACES = [
] as const;
const surfaceToneClasses: Record<string, string> = {
- guide: "border-[#A9DAF3] bg-[#DFF5FF] text-[#3583A8]",
- api: "border-[#A8DB91] bg-[#E4F8DA] text-[#4F9140]",
- mcp: "border-[#E6CFA3] bg-[#FFF2D8] text-[#9C7136]",
- docs: "border-[#DADAD5] bg-[#EFEFEB] text-[rgba(38,35,35,0.6)]",
+ guide: "border-ed-blue-border bg-ed-blue-bg text-ed-blue-mid",
+ api: "border-ed-green-border bg-ed-green-bg text-ed-green-text",
+ mcp: "border-ed-amber-stroke bg-ed-amber-fill text-ed-amber-text",
+ docs: "border-ed-warm-400 bg-ed-warm-150 text-ed-ink/60",
};
// Which surface a result belongs to is read back off its URL — the flat result list
@@ -145,27 +145,27 @@ export function SearchCommand() {
<button
type="button"
aria-label="Search docs"
- className="group inline-flex h-[38px] items-center gap-[8px] rounded-[8px] border border-[rgba(32,32,32,0.1)] bg-[#F5F5F2] pl-[10px] pr-[8px] text-ink-faint shadow-[0_1px_2px_0_rgba(0,0,0,0.04)] transition-colors hover:text-ink-ui sm:w-[260px] sm:justify-between"
+ className="group inline-flex h-[38px] items-center gap-2 rounded-lg border border-ed-ink/10 bg-ed-warm-100 pl-2.5 pr-2 text-ink-faint shadow-[0_1px_2px_0_rgba(0,0,0,0.04)] transition-colors hover:text-ink-ui sm:w-65 sm:justify-between"
>
- <span className="flex items-center gap-[8px]">
+ <span className="flex items-center gap-2">
<SearchGlyph />
- <span className="hidden text-[14px] font-[460] tracking-[0.15px] sm:inline">Search</span>
+ <span className="hidden text-ed-14 font-book tracking-[0.15px] sm:inline">Search</span>
</span>
- <kbd className="hidden items-center rounded-[5px] border border-[#DEDEDA] bg-[#FBFBF8] px-[5px] py-[1px] font-[family-name:var(--font-mono)] text-[11px] leading-[16px] text-[rgba(38,35,35,0.5)] sm:inline-flex">
+ <kbd className="hidden items-center rounded-[5px] border border-ed-warm-300 bg-ed-paper px-[5px] py-px font-mono text-ed-11 leading-4 text-ed-ink/50 sm:inline-flex">
{modKey}K
</kbd>
</button>
</Dialog.Trigger>
<Dialog.Portal>
- <Dialog.Overlay className="fixed inset-0 z-[100] bg-[rgba(38,35,35,0.32)] backdrop-blur-[2px] data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0" />
+ <Dialog.Overlay className="fixed inset-0 z-[100] bg-ed-ink/32 backdrop-blur-[2px] data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0" />
<Dialog.Content
onOpenAutoFocus={(e) => {
// Focus the input, not Radix's default first-focusable.
e.preventDefault();
(e.currentTarget as HTMLElement).querySelector<HTMLInputElement>("input")?.focus();
}}
- className="fixed left-1/2 top-[11vh] z-[101] flex max-h-[72vh] w-[calc(100vw-32px)] max-w-[600px] -translate-x-1/2 flex-col overflow-hidden rounded-[14px] border border-[#E3E3DF] bg-[#FBFBF8] shadow-[0_24px_60px_-12px_rgba(38,35,35,0.28)] data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95"
+ className="fixed left-1/2 top-[11vh] z-[101] flex max-h-[72vh] w-[calc(100vw-32px)] max-w-150 -translate-x-1/2 flex-col overflow-hidden rounded-[14px] border border-ed-warm-300 bg-ed-paper shadow-[0_24px_60px_-12px_rgba(38,35,35,0.28)] data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95"
>
<Dialog.Title className="sr-only">Search Carbon docs</Dialog.Title>
<Dialog.Description className="sr-only">
@@ -173,24 +173,24 @@ export function SearchCommand() {
</Dialog.Description>
{/* Search field */}
- <div className="flex h-[56px] shrink-0 items-center gap-[12px] border-b border-[#EAEAE6] px-[18px]">
- <SearchGlyph className="shrink-0 text-[rgba(38,35,35,0.4)]" />
+ <div className="flex h-14 shrink-0 items-center gap-3 border-b border-ed-warm-150 px-[18px]">
+ <SearchGlyph className="shrink-0 text-ed-ink/40" />
<input
value={value}
onChange={(e) => onChange(e.target.value)}
onKeyDown={onInputKey}
placeholder="Search docs, API resources, MCP tools…"
- className="h-full flex-1 border-0 bg-transparent text-[16px] leading-[150%] text-ink outline-none placeholder:text-[rgba(38,35,35,0.42)]"
+ className="h-full flex-1 border-0 bg-transparent text-ed-16 leading-normal text-ink outline-none placeholder:text-ed-ink/42"
spellCheck={false}
autoComplete="off"
/>
- <kbd className="shrink-0 rounded-[5px] border border-[#DEDEDA] bg-[#F5F5F2] px-[6px] py-[2px] font-[family-name:var(--font-mono)] text-[11px] text-[rgba(38,35,35,0.5)]">
+ <kbd className="shrink-0 rounded-[5px] border border-ed-warm-300 bg-ed-warm-100 px-1.5 py-0.5 font-mono text-ed-11 text-ed-ink/50">
esc
</kbd>
</div>
{/* Surface filter pills */}
- <div className="flex shrink-0 items-center gap-[6px] border-b border-[#EAEAE6] px-[14px] py-[9px]">
+ <div className="flex shrink-0 items-center gap-1.5 border-b border-ed-warm-150 px-3.5 py-[9px]">
{SURFACES.map((s) => {
const on = tag === s.tag;
return (
@@ -198,10 +198,10 @@ export function SearchCommand() {
key={s.key}
type="button"
onClick={() => setTag(s.tag)}
- className={`rounded-[100px] px-[11px] py-[4px] text-[12.5px] font-[460] leading-[16px] transition-colors ${
+ className={`rounded-full px-[11px] py-1 text-ed-12 font-book leading-4 transition-colors ${
on
- ? "bg-[#262323] text-[#F5F5F2]"
- : "text-ink-faint hover:bg-[rgba(231,231,227,0.7)] hover:text-ink-ui"
+ ? "bg-ed-ink text-ed-warm-100"
+ : "text-ink-faint hover:bg-ed-hairline/70 hover:text-ink-ui"
}`}
>
{s.label}
@@ -211,7 +211,7 @@ export function SearchCommand() {
</div>
{/* Results */}
- <div ref={listRef} className="scrollbar-hidden-until-scroll min-h-[120px] flex-1 overflow-y-auto p-[8px]">
+ <div ref={listRef} className="scrollbar-hidden-until-scroll min-h-30 flex-1 overflow-y-auto p-2">
{!ready ? (
<Hint />
) : query.isLoading && results.length === 0 ? (
@@ -235,7 +235,7 @@ export function SearchCommand() {
</div>
{/* Footer */}
- <div className="flex h-[40px] shrink-0 items-center gap-[16px] border-t border-[#EAEAE6] px-[16px] text-[12px] text-[rgba(38,35,35,0.5)]">
+ <div className="flex h-10 shrink-0 items-center gap-4 border-t border-ed-warm-150 px-4 text-ed-12 text-ed-ink/50">
<FooterKey k="↑↓" label="navigate" />
<FooterKey k="↵" label="open" />
<FooterKey k="esc" label="close" />
@@ -269,29 +269,29 @@ function ResultRow({
data-row={index}
onMouseMove={onHover}
onClick={onClick}
- className={`flex w-full items-center gap-[12px] rounded-[8px] px-[12px] text-left transition-colors ${
- isPage ? "mt-[6px] py-[10px] first:mt-0" : "py-[7px] pl-[34px]"
- } ${active ? "bg-[rgba(231,231,227,0.75)]" : ""}`}
+ className={`flex w-full items-center gap-3 rounded-lg px-3 text-left transition-colors ${
+ isPage ? "mt-1.5 py-2.5 first:mt-0" : "py-[7px] pl-[34px]"
+ } ${active ? "bg-ed-hairline/75" : ""}`}
>
{!isPage && (
- <span className="shrink-0 text-[rgba(38,35,35,0.32)]" aria-hidden>
+ <span className="shrink-0 text-ed-ink/32" aria-hidden>
↳
</span>
)}
<span
className={`min-w-0 flex-1 truncate ${
isPage
- ? "text-[14.5px] font-[530] text-ink"
+ ? "text-ed-14 font-demi text-ink"
: result.type === "heading"
- ? "text-[13.5px] font-[460] text-[rgba(38,35,35,0.82)]"
- : "text-[13px] font-[440] text-[rgba(38,35,35,0.62)]"
+ ? "text-ed-13 font-book text-ed-ink/82"
+ : "text-ed-13 font-book text-ed-ink/62"
}`}
>
<Highlighted content={result.content} />
</span>
{isPage && (
<span
- className={`shrink-0 rounded-[100px] border px-[7px] py-[2px] font-[family-name:var(--font-mono)] text-[10px] leading-[12px] ${surfaceToneClasses[surface.key]}`}
+ className={`shrink-0 rounded-full border px-[7px] py-0.5 font-mono text-ed-10 leading-3 ${surfaceToneClasses[surface.key]}`}
>
{surface.label}
</span>
@@ -319,7 +319,7 @@ function Highlighted({ content }: { content: string }) {
const text = clean(part);
if (!text) return null;
return marked ? (
- <mark key={i} className="bg-transparent font-[600] text-[#A76451]">
+ <mark key={i} className="bg-transparent font-semibold text-ed-brown">
{text}
</mark>
) : (
@@ -332,9 +332,9 @@ function Highlighted({ content }: { content: string }) {
function Hint() {
return (
- <div className="flex flex-col items-center justify-center gap-[8px] px-6 py-[40px] text-center">
- <SearchGlyph className="text-[rgba(38,35,35,0.28)]" />
- <p className="m-0 text-[14px] leading-[150%] text-[rgba(38,35,35,0.55)]">
+ <div className="flex flex-col items-center justify-center gap-2 px-6 py-10 text-center">
+ <SearchGlyph className="text-ed-ink/28" />
+ <p className="m-0 text-ed-14 leading-normal text-ed-ink/55">
Search the guide, reference, API resources, and MCP tools.
</p>
</div>
@@ -343,7 +343,7 @@ function Hint() {
function Status({ children }: { children: React.ReactNode }) {
return (
- <div className="px-[12px] py-[36px] text-center text-[14px] leading-[150%] text-[rgba(38,35,35,0.55)]">
+ <div className="px-3 py-9 text-center text-ed-14 leading-normal text-ed-ink/55">
{children}
</div>
);
@@ -351,8 +351,8 @@ function Status({ children }: { children: React.ReactNode }) {
function FooterKey({ k, label }: { k: string; label: string }) {
return (
- <span className="inline-flex items-center gap-[6px]">
- <kbd className="inline-flex items-center rounded-[5px] border border-[#DEDEDA] bg-[#F5F5F2] px-[5px] py-[1px] font-[family-name:var(--font-mono)] text-[11px] leading-[14px]">
+ <span className="inline-flex items-center gap-1.5">
+ <kbd className="inline-flex items-center rounded-[5px] border border-ed-warm-300 bg-ed-warm-100 px-[5px] py-px font-mono text-ed-11 leading-3.5">
{k}
</kbd>
{label}
diff --git a/docs/components/site-footer.tsx b/docs/components/site-footer.tsx
index b4c072f689..043882fded 100644
--- a/docs/components/site-footer.tsx
+++ b/docs/components/site-footer.tsx
@@ -63,24 +63,24 @@ function SocialIcon({ label, href, path }: { label: string; href: string; path:
export function SiteFooter() {
const year = new Date().getFullYear();
return (
- <footer className="w-full border-t border-white/10 bg-[#1A1816] text-white">
- <div className="mx-auto w-full max-w-[1280px] px-[24px] py-[48px] md:px-[32px]">
- <div className="flex flex-col justify-between gap-[40px] lg:flex-row">
+ <footer className="w-full border-t border-white/10 bg-ed-dark-bg text-white">
+ <div className="mx-auto w-full max-w-320 px-6 py-12 md:px-8">
+ <div className="flex flex-col justify-between gap-10 lg:flex-row">
{/* Brand block */}
<div className="flex flex-col gap-[18px]">
<img src="/carbon-word-dark.svg" alt="Carbon" width={116} height={28} className="block" />
- <div className="flex items-center gap-[16px]">
+ <div className="flex items-center gap-4">
{SOCIAL.map((s) => (
<SocialIcon key={s.label} {...s} />
))}
</div>
- <div className="mt-[2px]">
- <p className="m-0 text-[13px] text-white/60">System Status:</p>
+ <div className="mt-0.5">
+ <p className="m-0 text-ed-13 text-white/60">System Status:</p>
<a
href="https://status.carbon.ms"
target="_blank"
rel="noreferrer noopener"
- className="mt-[3px] inline-flex items-center gap-[7px] text-[14px] text-white/85 transition-colors hover:text-white"
+ className="mt-[3px] inline-flex items-center gap-[7px] text-ed-14 text-white/85 transition-colors hover:text-white"
>
Operational
<span className="inline-block h-[7px] w-[7px] rounded-full bg-[#3FB950] shadow-[0_0_6px_rgba(63,185,80,0.7)]" />
@@ -89,17 +89,17 @@ export function SiteFooter() {
</div>
{/* Link columns */}
- <div className="flex flex-1 flex-wrap gap-x-[56px] gap-y-[32px] lg:justify-center">
+ <div className="flex flex-1 flex-wrap gap-x-14 gap-y-8 lg:justify-center">
{COLUMNS.map((col) => (
- <nav key={col.heading} className="flex min-w-[120px] flex-col gap-[12px]">
- <p className="m-0 text-[13px] font-medium text-white/60">{col.heading}</p>
+ <nav key={col.heading} className="flex min-w-30 flex-col gap-3">
+ <p className="m-0 text-ed-13 font-medium text-white/60">{col.heading}</p>
{col.links.map((link) => (
<a
key={link.label}
href={link.href}
target="_blank"
rel="noreferrer noopener"
- className="text-[14px] text-white/70 no-underline transition-colors hover:text-white"
+ className="text-ed-14 text-white/70 no-underline transition-colors hover:text-white"
>
{link.label}
</a>
@@ -111,19 +111,19 @@ export function SiteFooter() {
{/* ITAR badge — the shared lockup is dark-inked (made for light backgrounds), so its text
would vanish on the dark footer. Sit it on a light chip to keep it legible. */}
<div className="flex items-center">
- <span className="inline-flex items-center rounded-[10px] bg-white px-[16px] py-[11px]">
+ <span className="inline-flex items-center rounded-[10px] bg-white px-4 py-[11px]">
<img
src="https://carbon.ms/logos/itar.svg"
alt="ITAR Registered & Compliant"
- className="block h-[36px] w-auto"
+ className="block h-9 w-auto"
/>
</span>
</div>
</div>
{/* Copyright */}
- <div className="mt-[40px] border-t border-white/10 pt-[20px]">
- <p className="m-0 text-[13px] text-white/60">
+ <div className="mt-10 border-t border-white/10 pt-5">
+ <p className="m-0 text-ed-13 text-white/60">
© {year} Carbon Manufacturing Systems Corp. All rights reserved.
</p>
</div>
diff --git a/docs/content/docs/index.mdx b/docs/content/docs/index.mdx
index 678c7a7e2f..bcdf3b49e2 100644
--- a/docs/content/docs/index.mdx
+++ b/docs/content/docs/index.mdx
@@ -19,7 +19,7 @@ Come here when you already know the noun you need and want the precise detail be
<Card title="Deployment" href="/docs/platform/deployment">
Self-host Carbon on AWS with SST, plus the local development setup.
</Card>
- <Card title="Environment variables" href="/docs/platform/environment-variables">
+ <Card title="Environment variables" href="/docs/platform/self-hosting/environment-variables">
Every variable that configures a Carbon instance, grouped by concern.
</Card>
<Card title="Reference" href="/docs/reference/methods">
diff --git a/docs/content/docs/integrations/accounting.mdx b/docs/content/docs/integrations/accounting.mdx
index ba185e887d..69b8d4e6c0 100644
--- a/docs/content/docs/integrations/accounting.mdx
+++ b/docs/content/docs/integrations/accounting.mdx
@@ -40,7 +40,7 @@ purchase invoices** to Xero and keeps the two ledgers aligned.
<Callout type="warn">
Xero only appears when its OAuth client is configured server-side (`XERO_CLIENT_ID`). Without it the
-integration is hidden — see [Environment variables](/docs/platform/environment-variables).
+integration is hidden — see [Environment variables](/docs/platform/self-hosting/environment-variables).
</Callout>
## Exchange rates
diff --git a/docs/content/docs/integrations/cad.mdx b/docs/content/docs/integrations/cad.mdx
index c4aefafcbc..c2e9e9853d 100644
--- a/docs/content/docs/integrations/cad.mdx
+++ b/docs/content/docs/integrations/cad.mdx
@@ -32,7 +32,7 @@ Connect to **Onshape** over **OAuth** to bring CAD data into Carbon — no keys
<Callout type="warn">
Onshape only appears when its OAuth client is configured server-side (`ONSHAPE_CLIENT_ID`) — see
-[Environment variables](/docs/platform/environment-variables).
+[Environment variables](/docs/platform/self-hosting/environment-variables).
</Callout>
## Related
diff --git a/docs/content/docs/integrations/index.mdx b/docs/content/docs/integrations/index.mdx
index 1116f63f56..61b69d692e 100644
--- a/docs/content/docs/integrations/index.mdx
+++ b/docs/content/docs/integrations/index.mdx
@@ -38,7 +38,7 @@ disconnect.
<Callout type="warn">
Which integrations even appear depends on how Carbon is deployed. The OAuth connectors — **Xero**, **Jira**,
and **Onshape** — only show up when their OAuth client is configured server-side (see
-[Environment variables](/docs/platform/environment-variables)), and **Slack** is hidden in controlled (ITAR)
+[Environment variables](/docs/platform/self-hosting/environment-variables)), and **Slack** is hidden in controlled (ITAR)
environments. So the same Carbon build can offer a different set of integrations depending on its
configuration.
</Callout>
@@ -72,7 +72,7 @@ configuration.
<Card title="Webhooks" href="/docs/building/webhooks">
Push record changes to your own endpoints instead of a packaged integration.
</Card>
- <Card title="Environment variables" href="/docs/platform/environment-variables">
+ <Card title="Environment variables" href="/docs/platform/self-hosting/environment-variables">
The server-side credentials that gate the OAuth integrations.
</Card>
</Cards>
diff --git a/docs/content/docs/integrations/project-management.mdx b/docs/content/docs/integrations/project-management.mdx
index 06f0c804d0..ab731a17ab 100644
--- a/docs/content/docs/integrations/project-management.mdx
+++ b/docs/content/docs/integrations/project-management.mdx
@@ -47,7 +47,7 @@ Connect over **OAuth** — there are no fields to fill in beyond authorizing Car
<Callout type="warn">
Jira only appears when its OAuth client is configured server-side (`JIRA_CLIENT_ID`) — see
-[Environment variables](/docs/platform/environment-variables).
+[Environment variables](/docs/platform/self-hosting/environment-variables).
</Callout>
## Related
diff --git a/docs/content/docs/platform/architecture.mdx b/docs/content/docs/platform/architecture.mdx
index c10c063a14..da9d07af01 100644
--- a/docs/content/docs/platform/architecture.mdx
+++ b/docs/content/docs/platform/architecture.mdx
@@ -64,7 +64,7 @@ header), and a full **OAuth 2.0 server** backs the Claude remote connector.
<Card title="Deployment" href="/docs/platform/deployment">
Provision and run the apps on AWS.
</Card>
- <Card title="Environment variables" href="/docs/platform/environment-variables">
+ <Card title="Environment variables" href="/docs/platform/self-hosting/environment-variables">
The full configuration surface.
</Card>
</Cards>
diff --git a/docs/content/docs/platform/deployment.mdx b/docs/content/docs/platform/deployment.mdx
index 5d9cd39806..3fa2c9a306 100644
--- a/docs/content/docs/platform/deployment.mdx
+++ b/docs/content/docs/platform/deployment.mdx
@@ -1,9 +1,9 @@
---
title: Deployment
-description: Self-host Carbon on AWS with SST, and run it locally with the crbn CLI.
+description: Deploy Carbon on AWS with SST, or run it locally with the crbn CLI.
---
-Carbon deploys to **AWS** with **SST**. The two apps — ERP and MES — run as containers on **ECS Fargate** behind load balancers, defined in `sst.config.ts` (app `carbon`, home `aws`).
+Carbon deploys to **AWS** with **SST**. The two apps — ERP and MES — run as containers on **ECS Fargate** behind load balancers, defined in `sst.config.ts` (app `carbon`, home `aws`). To run Carbon on your own hardware instead, see [Self-hosting](/docs/platform/self-hosting).
## What gets provisioned
@@ -29,4 +29,4 @@ Container images are pulled from **ECR** (`carbon/erp` and `carbon/mes`), built
The WAF web ACL must be **manually associated** with the application load balancer after the first deploy — SST creates it but does not attach it.
</Callout>
-See [Environment variables](/docs/platform/environment-variables) for the full configuration surface, or [Local development](/docs/platform/local-development) to run Carbon locally with the `crbn` CLI.
+See [Environment variables](/docs/platform/self-hosting/environment-variables) for the full configuration surface, or [Local development](/docs/platform/local-development) to run Carbon locally with the `crbn` CLI.
diff --git a/docs/content/docs/platform/local-development.mdx b/docs/content/docs/platform/local-development.mdx
index 412f549b30..f25003295c 100644
--- a/docs/content/docs/platform/local-development.mdx
+++ b/docs/content/docs/platform/local-development.mdx
@@ -94,4 +94,4 @@ A fresh worktree doesn't carry your gitignored local files. Pull them across fro
## Configuration
-Your local settings live in the generated `.env.local`. See [Environment variables](/docs/platform/environment-variables) for the full configuration surface, and [Deployment](/docs/platform/deployment) to self-host on AWS.
+Your local settings live in the generated `.env.local`. See [Environment variables](/docs/platform/self-hosting/environment-variables) for the full configuration surface, and [Deployment](/docs/platform/deployment) to self-host on AWS.
diff --git a/docs/content/docs/platform/meta.json b/docs/content/docs/platform/meta.json
index c975fd1df8..d2cfc1695f 100644
--- a/docs/content/docs/platform/meta.json
+++ b/docs/content/docs/platform/meta.json
@@ -1,10 +1,5 @@
{
"title": "Platform",
"defaultOpen": true,
- "pages": [
- "architecture",
- "deployment",
- "environment-variables",
- "local-development"
- ]
+ "pages": ["architecture", "deployment", "self-hosting", "local-development"]
}
diff --git a/docs/content/docs/platform/self-hosting/docker-caddy.mdx b/docs/content/docs/platform/self-hosting/docker-caddy.mdx
new file mode 100644
index 0000000000..86d45a3075
--- /dev/null
+++ b/docs/content/docs/platform/self-hosting/docker-caddy.mdx
@@ -0,0 +1,145 @@
+---
+title: Docker with Caddy
+description: Self-host the full Carbon stack on a single Linux VPS with a Docker Swarm and an automatic-HTTPS Caddy reverse proxy.
+---
+
+Run all of Carbon on **one Linux VPS**: a single-node [Docker Swarm](https://docs.docker.com/engine/swarm/) running the ERP and MES apps, the full Supabase data plane, Redis, and Inngest, behind a [Caddy](https://caddyserver.com/docs/) reverse proxy that handles TLS for you. Secrets are real **Docker Swarm secrets**, and only ports **80/443** are exposed — everything else stays on a private overlay network.
+
+Everything for this recipe lives in [`contrib/deploying/simple-docker-caddy`](https://github.com/crbnos/carbon/tree/main/contrib/deploying/simple-docker-caddy). The `deploy.sh` script wraps the whole lifecycle.
+
+## What runs
+
+| Service | Role |
+| --- | --- |
+| `caddy` | Reverse proxy + automatic HTTPS. The only service that publishes ports (80/443). |
+| `erp`, `mes` | The Carbon apps, built from the repo. Reached at `erp.<domain>` and `mes.<domain>`. |
+| `postgres` | Supabase Postgres, tuned on first boot (`pg_stat_statements`, connection limits). |
+| `gotrue`, `postgrest`, `realtime`, `storage`, `meta`, `kong` | The Supabase data plane, fronted by Kong at `api.<domain>`. |
+| `studio` | Supabase Studio (DB admin) — internal-only by default. |
+| `edge-runtime` | Supabase Edge Functions. |
+| `redis` | Cache, rate limiting, session state. |
+| `inngest` | Background jobs for both apps. |
+
+## Prerequisites
+
+| Requirement | Details |
+| --- | --- |
+| VPS | Ubuntu 22.04+, **≥ 4 GB RAM** to run the stack. Building images on the host needs **~8 GB** — add swap or build elsewhere. |
+| Docker | Docker Engine with the Compose plugin. |
+| DNS | `A`/`AAAA` records for your ERP, MES, and Supabase hosts pointing at the VPS (needed for Let's Encrypt). |
+| Repo | The Carbon repo checked out on the VPS (default `/opt/carbon`). |
+
+## Install
+
+<Steps>
+ <Step>
+ ### Harden the host (recommended)
+
+ Sets up a firewall (SSH + 80/443 only), fail2ban, swap, and automatic security updates.
+
+ ```bash
+ cd /opt/carbon/contrib/deploying/simple-docker-caddy
+ sudo ./scripts/harden.sh
+ ```
+ </Step>
+ <Step>
+ ### Initialize
+
+ Starts the Swarm, generates all the Docker secrets, and creates a `.env` from the template.
+
+ ```bash
+ ./deploy.sh init
+ ```
+ </Step>
+ <Step>
+ ### Configure
+
+ Edit `.env` — set `CARBON_REPO`, your `*_HOST` / `*_URL` hostnames, `ACME_EMAIL`, and SMTP settings.
+
+ ```bash
+ $EDITOR .env
+ ```
+ </Step>
+ <Step>
+ ### Set the operator secrets
+
+ `init` seeds placeholders so the stack deploys; replace them with real values. ERP **fails to boot** with an empty Resend key.
+
+ ```bash
+ printf '%s' 're_xxxxxxxx' | ./deploy.sh secret resend_api_key
+ printf '%s' 'your-smtp-password' | ./deploy.sh secret smtp_password
+ ```
+ </Step>
+ <Step>
+ ### Deploy
+
+ Builds the images, deploys the stack, waits for the database, and applies migrations.
+
+ ```bash
+ ./deploy.sh up
+ ```
+ </Step>
+ <Step>
+ ### Verify
+
+ ```bash
+ ./deploy.sh status
+ curl -fsS https://$ERP_HOST/health # -> 200
+ curl -fsS https://$MES_HOST/health # -> 200
+ ```
+ </Step>
+</Steps>
+
+<Callout type="note">
+First boot applies hundreds of migrations. The apps may restart a few times until the schema exists, then settle healthy — watch `./deploy.sh logs erp`.
+</Callout>
+
+## How secrets work
+
+Swarm delivers secrets as files under `/run/secrets/`, but the images read configuration from **environment variables** — several of them Postgres connection strings that embed the password. A small entrypoint shim bridges the two: it replaces `__SECRET_NAME__` placeholders in the environment with the contents of the matching secret file, then starts the service.
+
+```yaml
+PGRST_DB_URI: postgres://authenticator:__POSTGRES_PASSWORD__@postgres:5432/postgres
+GOTRUE_JWT_SECRET: __JWT_SECRET__
+```
+
+`deploy.sh init` generates `postgres_password`, `session_secret`, the Inngest keys, and the Supabase key trio (`jwt_secret`, `anon_key`, `service_role_key`). You supply `resend_api_key` and `smtp_password`.
+
+<Callout type="warn">
+`inngest_signing_key` must be **plain hex** — the self-hosted Inngest server rejects the `signkey-` prefix. `init` generates it correctly.
+</Callout>
+
+## Operating
+
+| Task | Command |
+| --- | --- |
+| Status | `./deploy.sh status` |
+| Follow logs | `./deploy.sh logs <service>` (e.g. `erp`, `caddy`) |
+| Update to a new release | `git pull && ./deploy.sh build && ./deploy.sh deploy && ./deploy.sh migrate` |
+| Back up | `./scripts/backup.sh` (Postgres dump + storage archive) |
+| Stop | `./deploy.sh down` (add `--volumes` to also wipe data) |
+
+**Database admin.** Studio is internal-only by default. Reach the database over SSH with `docker exec -it $(docker ps -qf name=carbon_postgres) psql -U postgres`, or expose Studio behind HTTP basic-auth by setting `STUDIO_HOST` and uncommenting the studio block in the `Caddyfile`.
+
+**Rotate a secret.** Swarm secrets are immutable while in use, so bring the stack down first:
+
+```bash
+./deploy.sh down
+printf '%s' 'new-value' | ./deploy.sh secret <name>
+./deploy.sh up
+```
+
+<Callout type="warn">
+A local backup on the same VPS is not a backup. Schedule `backup.sh` and ship its output **offsite**, and enable your provider's volume snapshots.
+</Callout>
+
+## Production checklist
+
+- Host hardened (`harden.sh`): firewall limited to SSH + 80/443, fail2ban, swap.
+- HTTPS issuing cleanly — `./deploy.sh logs caddy`.
+- Real `resend_api_key` and working SMTP set (Auth needs SMTP for invites and magic links).
+- Postgres tuning sized to the box (the `PG_*` values in `.env`).
+- Backups scheduled and shipped offsite.
+- Studio not publicly exposed (or behind basic-auth).
+
+See [Environment variables](/docs/platform/self-hosting/environment-variables) for the full configuration surface, or the managed [AWS deployment](/docs/platform/deployment) for the cloud path.
diff --git a/docs/content/docs/platform/environment-variables.mdx b/docs/content/docs/platform/self-hosting/environment-variables.mdx
similarity index 100%
rename from docs/content/docs/platform/environment-variables.mdx
rename to docs/content/docs/platform/self-hosting/environment-variables.mdx
diff --git a/docs/content/docs/platform/self-hosting/index.mdx b/docs/content/docs/platform/self-hosting/index.mdx
new file mode 100644
index 0000000000..c2ddbf3f4c
--- /dev/null
+++ b/docs/content/docs/platform/self-hosting/index.mdx
@@ -0,0 +1,18 @@
+---
+title: Self-hosting
+description: Run the whole Carbon stack on your own infrastructure instead of the managed AWS cloud.
+---
+
+Carbon can run entirely on hardware you control — the ERP and MES apps plus everything they need: the Supabase data plane (Postgres, Auth, REST, Realtime, Storage, Edge Functions), Redis, and Inngest. This is the alternative to the managed [AWS deployment](/docs/platform/deployment).
+
+## Recipes
+
+<Cards>
+ <Card title="Docker with Caddy" href="/docs/platform/self-hosting/docker-caddy">
+ The whole stack on a single Linux VPS — a single-node Docker Swarm behind an automatic-HTTPS Caddy reverse proxy. The simplest way to self-host.
+ </Card>
+</Cards>
+
+<Callout type="info">
+Self-hosted Carbon is **not plan-gated** — the Business/Partner tiers only apply to Carbon Cloud. See [Environment variables](/docs/platform/self-hosting/environment-variables) for the full configuration surface.
+</Callout>
diff --git a/docs/content/docs/platform/self-hosting/meta.json b/docs/content/docs/platform/self-hosting/meta.json
new file mode 100644
index 0000000000..0dd2d0382e
--- /dev/null
+++ b/docs/content/docs/platform/self-hosting/meta.json
@@ -0,0 +1,5 @@
+{
+ "title": "Self-hosting",
+ "defaultOpen": true,
+ "pages": ["docker-caddy", "environment-variables"]
+}
diff --git a/package.json b/package.json
index 35186f6ebd..2527b26cd6 100755
--- a/package.json
+++ b/package.json
@@ -69,7 +69,7 @@
"apps/*",
"ci",
"docs",
- "examples/*",
+ "contrib/building/examples/*",
"packages/*"
],
"packageManager": "[email protected]",
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index 885ae2d7af..e8c12780d7 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -654,7 +654,7 @@ importers:
version: 3.4.5([email protected])
'@react-router/remix-routes-option-adapter':
specifier: 'catalog:'
'@react-router/serve':
specifier: 'catalog:'
@@ -699,7 +699,7 @@ importers:
'@vercel/react-router':
specifier: 'catalog:'
'@visx/responsive':
specifier: 2.17.0
version: 2.17.0([email protected])
@@ -744,7 +744,7 @@ importers:
inngest:
specifier: ^3.52.7
intl-parse-accept-language:
specifier: 'catalog:'
version: 1.0.0
@@ -925,16 +925,16 @@ importers:
'@lingui/vite-plugin':
specifier: 'catalog:'
'@react-router/dev':
specifier: 'catalog:'
'@tailwindcss/typography':
specifier: 'catalog:'
version: 0.5.19([email protected])
'@tailwindcss/vite':
specifier: 'catalog:'
'@types/d3':
specifier: 7.4.3
version: 7.4.3
@@ -991,13 +991,13 @@ importers:
version: 5.8.3
vite:
specifier: 'catalog:'
vite-plugin-babel-macros:
specifier: 'catalog:'
vitest:
specifier: 'catalog:'
apps/mes:
dependencies:
@@ -1075,7 +1075,7 @@ importers:
'@lingui/vite-plugin':
specifier: 'catalog:'
'@nanostores/react':
specifier: 'catalog:'
@@ -1087,10 +1087,10 @@ importers:
version: 3.4.5([email protected])
'@react-router/dev':
specifier: 'catalog:'
'@react-router/remix-routes-option-adapter':
specifier: 'catalog:'
'@react-router/serve':
specifier: 'catalog:'
@@ -1111,7 +1111,7 @@ importers:
version: 0.5.19([email protected])
'@tailwindcss/vite':
specifier: 'catalog:'
'@tiptap/core':
specifier: 'catalog:'
version: 2.27.2(@tiptap/[email protected])
@@ -1153,7 +1153,7 @@ importers:
'@vercel/react-router':
specifier: 'catalog:'
'@xyflow/react':
specifier: 12.10.2
@@ -1271,10 +1271,10 @@ importers:
version: 5.8.3
vite:
specifier: 'catalog:'
vite-plugin-babel-macros:
specifier: 'catalog:'
wait-on:
specifier: 'catalog:'
version: 7.2.0
@@ -1446,108 +1446,20 @@ importers:
specifier: 'catalog:'
version: 4.6.9
- docs:
+ contrib/building/examples/quote-configurator:
dependencies:
- '@carbon/utils':
- specifier: workspace:*
- version: link:../packages/utils
- '@radix-ui/react-dialog':
- specifier: 1.1.15
- '@radix-ui/react-popover':
- specifier: 1.1.15
- fumadocs-core:
- specifier: ^16
- fumadocs-mdx:
- specifier: ^15
- fumadocs-ui:
- specifier: ^16
- motion:
- specifier: ^12
- next:
- specifier: ^16
- non.geist:
- specifier: 'catalog:'
- version: 1.0.4
- react:
- specifier: ^19.2.0
- version: 19.2.6
- react-dom:
- specifier: ^19.2.0
- version: 19.2.6([email protected])
- shiki:
- specifier: ^4.2.0
- version: 4.2.0
- simple-icons:
- specifier: ^16.23.0
- version: 16.23.0
- zod:
- specifier: ^4
- version: 4.4.3
- devDependencies:
'@carbon/config':
specifier: workspace:*
- version: link:../packages/config
- '@httptoolkit/httpsnippet':
- specifier: ^3.0.2
- version: 3.0.2([email protected])
- '@tailwindcss/postcss':
- specifier: ^4
- version: 4.3.1
- '@tailwindcss/typography':
- specifier: 'catalog:'
- version: 0.5.19([email protected])
- '@types/mdx':
- specifier: ^2.0.14
- version: 2.0.14
- '@types/node':
- specifier: ^22
- version: 22.19.7
- '@types/react':
- specifier: ^19
- version: 19.2.14
- '@types/react-dom':
- specifier: ^19
- version: 19.2.3(@types/[email protected])
- rimraf:
- specifier: 'catalog:'
- version: 5.0.10
- tailwind-scrollbar:
- specifier: 'catalog:'
- tailwind-scrollbar-hide:
- specifier: 'catalog:'
- version: 4.0.0([email protected])
- tailwindcss:
- specifier: 'catalog:'
- version: 4.3.0
- tailwindcss-animate:
- specifier: 'catalog:'
- version: 1.0.7([email protected])
- typescript:
- specifier: 'catalog:'
- version: 5.8.3
-
- examples/quote-configurator:
- dependencies:
- '@carbon/config':
- specifier: workspace:*
- version: link:../../packages/config
+ version: link:../../../../packages/config
'@carbon/form':
specifier: workspace:*
- version: link:../../packages/form
+ version: link:../../../../packages/form
'@carbon/react':
specifier: workspace:*
- version: link:../../packages/react
+ version: link:../../../../packages/react
'@carbon/utils':
specifier: workspace:*
- version: link:../../packages/utils
+ version: link:../../../../packages/utils
'@react-router/dev':
specifier: 'catalog:'
@@ -1616,17 +1528,17 @@ importers:
specifier: 'catalog:'
- examples/upload-3d-model:
+ contrib/building/examples/upload-3d-model:
dependencies:
'@carbon/config':
specifier: workspace:*
- version: link:../../packages/config
+ version: link:../../../../packages/config
'@carbon/react':
specifier: workspace:*
- version: link:../../packages/react
+ version: link:../../../../packages/react
'@carbon/utils':
specifier: workspace:*
- version: link:../../packages/utils
+ version: link:../../../../packages/utils
'@react-router/dev':
specifier: 'catalog:'
@@ -1692,6 +1604,94 @@ importers:
specifier: 'catalog:'
+ docs:
+ dependencies:
+ '@carbon/utils':
+ specifier: workspace:*
+ version: link:../packages/utils
+ '@radix-ui/react-dialog':
+ specifier: 1.1.15
+ '@radix-ui/react-popover':
+ specifier: 1.1.15
+ fumadocs-core:
+ specifier: ^16
+ fumadocs-mdx:
+ specifier: ^15
+ fumadocs-ui:
+ specifier: ^16
+ motion:
+ specifier: ^12
+ next:
+ specifier: ^16
+ non.geist:
+ specifier: 'catalog:'
+ version: 1.0.4
+ react:
+ specifier: ^19.2.0
+ version: 19.2.6
+ react-dom:
+ specifier: ^19.2.0
+ version: 19.2.6([email protected])
+ shiki:
+ specifier: ^4.2.0
+ version: 4.2.0
+ simple-icons:
+ specifier: ^16.23.0
+ version: 16.23.0
+ zod:
+ specifier: ^4
+ version: 4.4.3
+ devDependencies:
+ '@carbon/config':
+ specifier: workspace:*
+ version: link:../packages/config
+ '@httptoolkit/httpsnippet':
+ specifier: ^3.0.2
+ version: 3.0.2([email protected])
+ '@tailwindcss/postcss':
+ specifier: ^4
+ version: 4.3.1
+ '@tailwindcss/typography':
+ specifier: 'catalog:'
+ version: 0.5.19([email protected])
+ '@types/mdx':
+ specifier: ^2.0.14
+ version: 2.0.14
+ '@types/node':
+ specifier: ^22
+ version: 22.19.7
+ '@types/react':
+ specifier: ^19
+ version: 19.2.14
+ '@types/react-dom':
+ specifier: ^19
+ version: 19.2.3(@types/[email protected])
+ rimraf:
+ specifier: 'catalog:'
+ version: 5.0.10
+ tailwind-scrollbar:
+ specifier: 'catalog:'
+ tailwind-scrollbar-hide:
+ specifier: 'catalog:'
+ version: 4.0.0([email protected])
+ tailwindcss:
+ specifier: 'catalog:'
+ version: 4.3.0
+ tailwindcss-animate:
+ specifier: 'catalog:'
+ version: 1.0.7([email protected])
+ typescript:
+ specifier: 'catalog:'
+ version: 5.8.3
+
packages/auth:
dependencies:
'@carbon/database':
@@ -11925,11 +11925,6 @@ packages:
resolution: {integrity: sha512-z81GNO7nnYMEhrGh9LeymoE4+Yr0Wn5McHIZMK5cfQCl+NDX08sCZgUc9/6MHni9IWuFLm1Z3HTCXu2z9fN62Q==}
- resolution: {integrity: sha512-N8SpfPUnUp1bK+PMYW8qSWdl9U+wwNWI4QKxOYDy9JAro3WMX7p2OeVRF9v+347pnakNevPmiHhNmZ2HbFA76w==}
- engines: {node: ^10 || ^12 || ^13.7 || ^14 || >=15.0.1}
- hasBin: true
-
resolution: {integrity: sha512-ZB9RH/39qpq5Vu6Y+NmUaFhQR6pp+M2Xt76XBnEwDaGcVAqhlvxrl3B2bKS5D3NH3QR76v3aSrKaF/Kiy7lEtQ==}
engines: {node: ^10 || ^12 || ^13.7 || ^14 || >=15.0.1}
@@ -21718,14 +21713,6 @@ snapshots:
optionalDependencies:
- dependencies:
- '@vitest/spy': 4.1.6
- estree-walker: 3.0.3
- magic-string: 0.30.21
- optionalDependencies:
-
dependencies:
'@vitest/spy': 4.1.6
@@ -23898,7 +23885,7 @@ snapshots:
dependencies:
'@bufbuild/protobuf': 2.11.0
'@inngest/ai': 0.1.7
@@ -23927,7 +23914,7 @@ snapshots:
ulid: 2.4.0
zod: 3.25.76
optionalDependencies:
- express: 4.22.1
+ express: 5.2.1
hono: 4.12.14
typescript: 5.8.3
@@ -25213,8 +25200,6 @@ snapshots:
object-assign: 4.1.1
thenify-all: 1.6.0
-
@@ -25730,7 +25715,7 @@ snapshots:
dependencies:
- nanoid: 3.3.11
+ nanoid: 3.3.12
picocolors: 1.1.1
source-map-js: 1.2.1
@@ -25742,7 +25727,7 @@ snapshots:
dependencies:
- nanoid: 3.3.11
+ nanoid: 3.3.12
picocolors: 1.1.1
source-map-js: 1.2.1
@@ -28024,34 +28009,6 @@ snapshots:
transitivePeerDependencies:
- msw
- dependencies:
- '@vitest/expect': 4.1.6
- '@vitest/pretty-format': 4.1.6
- '@vitest/runner': 4.1.6
- '@vitest/snapshot': 4.1.6
- '@vitest/spy': 4.1.6
- '@vitest/utils': 4.1.6
- es-module-lexer: 2.0.0
- expect-type: 1.3.0
- magic-string: 0.30.21
- obug: 2.1.1
- pathe: 2.0.3
- picomatch: 4.0.4
- std-env: 4.0.0
- tinybench: 2.9.0
- tinyexec: 1.1.1
- tinyglobby: 0.2.16
- tinyrainbow: 3.1.0
- why-is-node-running: 2.3.0
- optionalDependencies:
- '@opentelemetry/api': 1.9.0
- '@types/node': 24.12.2
- transitivePeerDependencies:
- - msw
-
dependencies:
'@vitest/expect': 4.1.6
diff --git a/pnpm-workspace.yaml b/pnpm-workspace.yaml
index 71cd007e0d..64185002d6 100644
--- a/pnpm-workspace.yaml
+++ b/pnpm-workspace.yaml
@@ -2,7 +2,7 @@ packages:
- apps/*
- ci
- docs
- - examples/*
+ - contrib/building/examples/*
- packages/*
minimumReleaseAge: 4320