Documentation menu

Theming

Components never hardcode colors, fonts, or easing — only var(--moco-*). Override any token to retheme the whole library.

Color tokens

TokenLight valueRole
--moco-bg#fcfbf9Page ground — warm paper
--moco-panel#f4f2eeRaised panels and code blocks
--moco-inkrgba(0,0,0,0.88)Headings, strongest text
--moco-bodyrgba(0,0,0,0.76)Body text
--moco-mutedrgba(0,0,0,0.6)Secondary text
--moco-faintrgba(0,0,0,0.48)Captions, tertiary text
--moco-linergba(0,0,0,0.12)Hairline borders
--moco-accent#c6f24eLime accent — fills only on paper
--moco-accent-dk#5b770cAccent for text and strokes (4.9:1)
--moco-on-accent#14180aText on top of accent fills
--moco-warn#b8437aWarning / highlight color
--moco-accent-washrgba(198,242,78,0.34)Translucent accent wash
--moco-warn-washrgba(184,67,122,0.1)Translucent warn wash
--moco-hover-washrgba(0,0,0,0.04)Hover backgrounds

Fonts and motion

TokenRole
--moco-serifLong-form prose
--moco-monoCode, numbers, technical labels
--moco-sansUI text
--moco-displayDisplay headings and the wordmark
--moco-easeThe single easing curve used for all motion

The font slots default to system stacks. Point them at your loaded webfonts (this site wires next/font variables into them in one CSS rule).

Dark mode

The library ships a full dark palette that activates via prefers-color-scheme: dark. To force a theme regardless of system preference, set data-theme on <html>:

  • <html data-theme="dark"> — always dark
  • <html data-theme="light"> — always light (the dark media query is guarded with :root:not([data-theme="light"]), so this wins)

This docs site pins itself light exactly this way.

Overriding tokens

Declare your overrides after tokens.css. For example, swapping the accent:

globals.css
/* your globals.css, after tokens.css */
:root {
  --moco-accent: #ffd166;      /* lime → amber */
  --moco-accent-dk: #8a6a00;   /* keep ~4.5:1 on --moco-bg for text duty */
}

The one rule worth keeping: on light backgrounds the bright accent is a fill color — text and strokes use --moco-accent-dk, which should hold roughly 4.5:1 contrast against --moco-bg. See the tokens item for the full source.