@farming-labs/docs

Colors

Override any color token directly from your config. Colors are mapped to --color-fd-* CSS variables at runtime.

Setting Colors

docs.config.tsx
theme: pixelBorder({
  ui: {
    colors: {
      primary: "oklch(0.72 0.19 149)",
      accent: "hsl(220 80% 60%)",
    },
  },
}),

Available Tokens

TokenCSS VariableDescription
primary--color-fd-primaryPrimary brand color
primaryForeground--color-fd-primary-foregroundText on primary backgrounds
background--color-fd-backgroundPage background
foreground--color-fd-foregroundDefault text color
muted--color-fd-mutedMuted background
mutedForeground--color-fd-muted-foregroundMuted text
border--color-fd-borderBorder color
card--color-fd-cardCard background
accent--color-fd-accentAccent background
accentForeground--color-fd-accent-foregroundText on accent
secondary--color-fd-secondarySecondary background
ring--color-fd-ringFocus ring color

How It Works

Only colors you explicitly set are emitted as inline CSS variables. Theme preset defaults stay in the CSS file — your overrides don't break light/dark mode handling.

// Only primary gets overridden — everything else stays as the theme defines
colors: { primary: "oklch(0.72 0.19 149)" }

Color Formats

Any valid CSS color value works:

colors: {
  primary: "#22c55e",                    // hex
  primary: "rgb(34, 197, 94)",           // rgb
  primary: "hsl(142 71% 45%)",           // hsl
  primary: "oklch(0.72 0.19 149)",       // oklch
}

On this page

No Headings