Bauhaus Token System
The site-wide design language: CSS variables + JS tokens, dark-aware.
Builders & toolkitsLiveCSSJavaScript
1design system
What it is
The visual identity in code: CSS custom properties plus a JS token object, with a light/dark theme that switches on a data attribute. Every non-Tailwind surface styles itself from these tokens.
Take it with you
The real, committed source behind this system — copy it or download the file. Plus a portable spec of everything on this page.
tokens.jsjavascript65 lines
The full Bauhaus design-token object (T) plus the alpha() helper — drop in and theme with var(--color-*) / T.*.
// ═══════════════════════════════════════════════════════
// DESIGN TOKENS — Bauhaus v2
// ═══════════════════════════════════════════════════════
export const T = {
// Backgrounds (light-first)
bg0: "#F5F0E8",
bg1: "#EDE8DF",
bg2: "#E5E0D7",
bg3: "#DDD8CF",
// Card
card: "#F5F0E8",
border: "#D6D1C9",
borderH: "#C0BBB2",
// Text
tx: "#111111",
tx2: "#4A4540",
tx3: "#9C9589",
tx4: "#B0ABA3",
tx5: "#D6D1C9",
// Bauhaus accent colors
red: "#D62828",
blue: "#003F88",
yellow: "#F7B538",
// Cluster colors (mapped to Bauhaus)
ai: "#003F88",
games: "#D62828",
writing: "#F7B538",
govtech: "#003F88",
other: "#9C9589",
// Status
live: "#34D399",
wip: "#F7B538",
dim: "#D6D1C9",
// Fonts — CSS variables set by next/font in layout.jsx
ff: "var(--font-display), serif",
fb: "var(--font-body), sans-serif",
fm: "var(--font-mono), monospace",
};
// ═══════════════════════════════════════════════════════
// HELPERS — keep inline color computations consistent
// ═══════════════════════════════════════════════════════
// alpha(color, a) — append an 8-bit alpha byte to a #RRGGBB color.
//
// alpha(T.ai, 0.08) → "#003F8814" (numeric form, rounded to nearest byte)
// alpha(T.ai, "15") → "#003F8815" (hex-byte form, exact)
//
// Prefer the numeric form in new code. The string form exists so existing
// `${T.ai}15` patterns can be replaced byte-for-byte during sweeps.
export const alpha = (color, a) => {
const hex =
typeof a === "string"
? a
: Math.round(Math.max(0, Math.min(1, a)) * 255)
.toString(16)
.padStart(2, "0");
return `${color}${hex}`;
};
Where it lives
- src/lib/tokens.js
- src/styles/globals.css
See it in action
Architecture map →FAQ
How does dark mode work?
The theme switches via a data-theme attribute on the document and is persisted in local storage; tokens resolve to the right values automatically.
Part of these stacks
Related systems
Want a system like this built for you?Work with me →