## Problem The design-system Sidebar page was mostly an upstream shadcn paste: first-person voice, a broken `/blocks` link, missing structure images, CLI install steps that do not match this monorepo, and a long changelog / data-fetching tutorial that do not apply here. Separately, it still taught classic shadcn **HSL channel** variables plus `hsl(var(--sidebar-*))`. In this monorepo those tokens are **full colours**. Mixing the two patterns produces invalid CSS. Related call-site cleanup: https://github.com/supabase/supabase/pull/51161 ## Solution - Rewrite the Sidebar docs as a shorter monorepo guide: import from `'ui'`, structure, theming, provider / sidebar props, menu building blocks, controlled mode, state styling. - Move Studio’s `--sidebar-*` aliases into shared `packages/ui` compat CSS so every app on the shared theme gets working `bg-sidebar` utilities. - Drop the duplicate definitions from Studio `globals.css`. Left alone on purpose: brand / destructive channel tokens and docs that correctly use `hsl(var(--brand-…))`. ## Review instructions Design-system preview: [design-system](https://design-system-git-dnywh-docssidebar-full-colour-tokens-supabase.vercel.app/) 1. [Live Sidebar docs](https://supabase.com/design-system/docs/components/sidebar) · [Preview Sidebar docs](https://design-system-git-dnywh-docssidebar-full-colour-tokens-supabase.vercel.app/design-system/docs/components/sidebar). Confirm the page is no longer the upstream essay: no broken images, no `/blocks` link, imports from `'ui'`, theming shows full-colour aliases. 2. Smoke Studio: left nav should look unchanged (same aliases, now from compat.css). 3. Optional: in DevTools, confirm `--sidebar-background` resolves to a full `oklch(...)` colour. ## Checklist - [x] I have read [CONTRIBUTING.md](https://github.com/supabase/supabase/blob/master/CONTRIBUTING.md) - [ ] If I wrote a new docs topic or edited an existing topic, I used the `/write-the-docs` or `/edit-the-docs` skill, which applies the docs [style guide](https://github.com/supabase/supabase/tree/master/apps/docs/style-guide)
Supabase Design System
Design resources for building consistent user experiences at Supabase.
Getting started
From the repo root:
# Copy local env vars (sets NEXT_PUBLIC_BASE_PATH for asset URLs)
cp apps/design-system/.env.local.example apps/design-system/.env.local
# Move into the design-system app
cd apps/design-system
# Install dependencies
pnpm i
# Build the registry and Velite content, then start the dev servers
pnpm dev
Or from apps/design-system:
# Copy local env vars (sets NEXT_PUBLIC_BASE_PATH for asset URLs)
cp .env.local.example .env.local
# Install dependencies
pnpm i
# Build the registry and Velite content, then start the dev servers
pnpm dev
The dev command builds the registry and Velite content, then runs the Next.js dev server and Velite watcher in parallel.
Open http://localhost:3003/design-system in your browser to see the result.
Doc pages load compiled MDX from .velite/codes/*.json per document. Metadata lives in the smaller allDocs.json index (~367KB instead of ~27MB), so content edits only reload the changed doc's code.
Alternative commands
You can also run the development server and content watcher separately. Build the registry and content first, because dev:next and dev:content do not:
pnpm build:registry
pnpm build:content
# Run only the Next.js development server
pnpm dev:next
# Run only the Velite content watcher (in a separate terminal shell)
pnpm dev:content
From the repo root, pnpm dev:design-system runs the same dev script. If you split the watchers from the root, build first:
pnpm --filter=design-system build:registry
pnpm --filter=design-system build:content
pnpm --filter=design-system dev:next
pnpm --filter=design-system dev:content
Watching for MDX changes
The dev command watches MDX files and hot-reloads them. If you are running pnpm dev:next on its own, also run pnpm dev:content in another terminal.
Adding components
The design system references components rather than housing them. That distinction matters: everything below is about documenting components, not implementing them. Add or edit the components themselves in one of these two places:
packages/ui: basic UI componentspackages/ui-patterns: components built from libraries or frompackages/ui
After you add or remove documented components, update these source files:
config/docs.ts: list of components in the sidebarcontent/docs: the component documentationregistry/examples.ts: example componentsregistry/fragments.ts: fragment componentsregistry/charts.ts: chart componentsregistry/copy-writing.ts: copywriting examplesregistry/default/example/*: the example component implementationsregistry/default/block/*: chart block implementations, when you add a chart
Do not edit __registry__. pnpm dev, pnpm typecheck, and pnpm build generate it from the files above, and it is gitignored. If you add registry entries while the app is already running, regenerate it:
cd apps/design-system
pnpm build:registry