Skip to content
Animated Visuals

Themes

A theme is a set of --fs-* CSS variables that controls a figure's colors, type and shape. Each card previews one theme; Use applies it to this page.

Default is monochrome, with ink as the accent. Notebook swaps in mono figure text, uppercase heads, square corners and an amber focus, for paper explainers. The other 23 are palettes from Omarchy's themes, with contrast fixed where needed: muted text reaches 4.5:1, the accent and categories 3:1.

Tokens

These tokens are the theme contract. Canvas figures read the colors as f.C (f.C.fg, f.C.accent, f.C.c[0]); SVG and HTML use var(--fs-…). The swatches show the active theme and change with it.

TokenNowUsed for
--fs-bgThe page around plates.
--fs-surfaceThe plate, and the halo behind labels drawn over marks.
--fs-surface-2Hover and raised surfaces. Also the default color of the 4px frame band.
--fs-lineHairlines: grids, dividers, toolbar rules.
--fs-line-strongNode outlines, slider tracks, idle marks.
--fs-faintFar-background marks and disabled things.
--fs-mutedSecondary text, ticks, connectors. At least 4.5:1 on the page.
--fs-fgText and the main marks.
--fs-strongThe strongest ink: playheads and emphasis.
--fs-accentFocus: the one or two things that matter now, handles, focus rings. At least 3:1 on the plate.
--fs-c1 to --fs-c6 Categories, each at least 3:1. Grays in Default, so pair them with labels or textures.
--fs-good, --fs-bad Outcomes, when a figure needs them.
--fs-font-figureText inside figures. Also --fs-font-body, --fs-font-display, --fs-font-mono.
--fs-size-*title, status, label, tick, caption; plus --fs-weight-title, --fs-head-case, --fs-head-tracking.
--fs-radiusPlate corner (12px). --fs-radius-inner and --fs-radius-control for what sits inside.
--fs-frame-widthThe frame band (4px). --fs-frame sets its color.
--fs-stroke-*hair 1, edge 1.1, series 1.75: line widths for grids, connectors and data.
--fs-dimOpacity for context that is not the point right now (0.28).
--fs-dur, --fs-easeControl feedback timing (240ms, a soft ease out). Also --fs-dur-step, --fs-ease-spring, --fs-shadow, --fs-control-size.

Write a theme

Copy a block, rename it and change the values. Colors are written in OKLCH (lightness 0 to 1, chroma, hue in degrees); scripts/hex-to-oklch.mjs converts a theme written in hex. Keep muted text at 4.5:1 on the page and the accent and categories at 3:1 on the plate. This one is defined in this page's own CSS, and the figure under it uses it:


  

Harbor, an example theme

Illustration
Drag across the chart to replay it

Apply it

FS.setTheme("harbor");      // the whole page: sets data-fs-theme on <html>
FS.setTheme(null);          // back to Default
FS.setMode("light");        // Default and Notebook come in light and dark
<!-- one figure only -->
<figure class="fs-plate" data-fs-theme="nord"> … </figure>
/* or override single tokens after the theme layer, for the page or one plate */
.fs-plate { --fs-radius: 4px; --fs-accent: oklch(0.70393 0.19154 37.126); }

Animate the switch

This site tweens every theme change. The color tokens are registered with @property so they can transition, and the transition runs on <html>. While <html> has a running animation, the runtime re-reads the tokens every frame and redraws, so canvases change with the page instead of snapping at the end.

@property --fs-bg { syntax: "<color>"; inherits: true; initial-value: oklch(0.21342 0 0); }
/* … one per color token … */
:root { transition: --fs-bg 520ms cubic-bezier(0.16, 1, 0.3, 1) /* , … */; }

Bridge to your site's tokens

Inside a site that already has a palette, map the figure tokens to the site's variables instead of loading default.css. The site's light and dark modes and palettes then apply to every figure. The runtime resolves var() chains and color-mix() through a probe element, so canvas figures follow too, and it re-reads tokens when <html> changes its class, data-fs-theme, data-fs-mode or data-style-palette. This is the example bridge, themes/site-bridge.css; replace the --site-* names with your site's variables:

/* Example bridge: load this instead of default.css inside a site that already has design tokens, so the
   figure tokens follow the site's own variables and its light/dark modes and palettes flow into every figure.
   The --site-* names on the right are placeholders: replace them with your site's variables.
   The runtime resolves var() chains and color-mix() through a probe, so canvas figures follow too. */
:root {
  --fs-bg: var(--site-bg);
  --fs-surface: var(--site-panel);
  --fs-block: var(--site-block, var(--site-panel-raised));
  --fs-node: var(--site-figure-node, var(--site-panel-raised));
  --fs-surface-2: var(--site-panel-raised);
  --fs-line: var(--site-border);
  --fs-line-strong: var(--site-border-strong);
  --fs-faint: var(--site-text-faint);
  --fs-muted: var(--site-text-muted);
  --fs-fg: var(--site-text);
  --fs-strong: var(--site-text-strong);
  --fs-accent: var(--site-accent);
  --fs-link: var(--site-link, var(--site-text-strong));
  --fs-link-underline: var(--site-link-underline, var(--site-accent));
  --fs-c1: var(--site-blue);
  --fs-c2: var(--site-green);
  --fs-c3: var(--site-yellow);
  --fs-c4: var(--site-purple);
  --fs-c5: var(--site-teal);
  --fs-c6: var(--site-gray);
  --fs-good: var(--site-green);
  --fs-bad: var(--site-text-muted);
  --fs-font-body: var(--site-font-body), system-ui, sans-serif;
  --fs-font-display: var(--site-font-heading), system-ui, sans-serif;
  --fs-font-mono: var(--site-font-mono), ui-monospace, monospace;
  --fs-font-figure: var(--fs-font-body);
  --fs-size-title: 14px;
  --fs-weight-title: 600;
  --fs-size-status: 11px;
  --fs-size-label: 11px;
  --fs-size-tick: 11px;
  --fs-size-caption: 12px;
  --fs-head-case: none;
  --fs-head-tracking: -0.01em;
  --fs-radius: var(--site-radius-large, 12px);
  --fs-radius-inner: var(--site-radius, 6px);
  --fs-radius-control: 4px;
  --fs-border: 1px;
  --fs-frame-width: var(--site-frame-width, 4px);
  --fs-frame: var(--site-frame-color, var(--fs-surface-2));
  --fs-control-size: 44px;
  --fs-stroke-hair: 1;
  --fs-stroke-edge: 1.1;
  --fs-stroke-series: 1.75;
  --fs-dim: 0.28;
  --fs-dur: var(--site-transition-duration, 240ms);
  --fs-dur-step: 480ms;
  --fs-ease: var(--site-transition-ease, cubic-bezier(0.16, 1, 0.3, 1));
  --fs-ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --fs-shadow: var(--site-shadow, 0 2px 8px oklch(0 0 0 / 24%), 0 14px 32px -6px oklch(0 0 0 / 44%));
}

More in references/theming.md. To regenerate the Omarchy palettes from upstream, see scripts/build-themes.mjs.