Home
Reference

Theme Tokens

Colors, fonts, layout dimensions, and CSS overrides.

The theme field in sourcey.config.ts controls the visual appearance of your documentation site. Every token has a sensible default; you only need to set what you want to change.

ThemeConfig interface

interface ThemeConfig {
  preset?: "default" | "minimal" | "api-first";
  colors?: {
    primary: string;
    light?: string;
    dark?: string;
  };
  fonts?: {
    sans?: string;
    mono?: string;
  };
  layout?: {
    sidebar?: string;
    toc?: string;
    content?: string;
  };
  css?: string[];
}

Preset defaults

Sidebar + content + table of contents. The standard documentation layout.

TokenValue
layout.sidebar"18rem"
layout.toc"19rem"
layout.content"44rem"

Single-column, centered content. No sidebar, no table of contents.

TokenValue
layout.sidebarN/A
layout.tocN/A
layout.content"44rem"

Three-column layout with code samples pinned to the right.

TokenValue
layout.sidebar"18rem"
layout.tocN/A
layout.content"44rem"

Color tokens

TokenDefaultUsage
primary#6366f1 (indigo)Links, active sidebar items, accent borders, focus rings
lightSame as primaryHover states, lighter accent backgrounds
darkSame as primaryPressed/active states, darker accent elements

Colors must be 6-digit hex values. Sourcey converts them to space-separated RGB values for CSS custom properties, enabling opacity modifiers.

Font stacks

TokenDefault
sans'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif
mono'Geist Mono', 'SF Mono', 'Fira Code', 'Cascadia Code', Consolas, monospace

When you set a custom font name, sourcey uses it as the first entry in the stack with the system fallbacks appended.

CSS overrides

The css array accepts paths to CSS files loaded after the default theme:

theme: {
  css: ["./overrides.css", "./syntax.css"],
}

Paths are relative to sourcey.config.ts. Files are concatenated in order.