Theming

Twelve tokens, light and dark. Change them once and every component follows, or override one instance with a className.

init adds the tokens to your global.css. Components take their colors from classes like bg-dissolve-surface or text-dissolve-foreground, so they follow your palette. On the web, components read the same --dissolve-* variables directly, with or without Tailwind.

Tokens

TokenLightDarkUsed for
--dissolve-background255 255 2550 0 0Screen behind the components
--dissolve-surface242 242 24728 28 30Tracks, pads, bubbles, frames
--dissolve-surface-2229 229 23444 44 46Raised pills and controls
--dissolve-foreground28 28 30242 242 247Text, digits, ink
--dissolve-muted142 142 147152 152 157Secondary text, idle icons, placeholders
--dissolve-primary28 28 30242 242 247Main buttons, knobs, toasts
--dissolve-primary-foreground255 255 25528 28 30Content on primary
--dissolve-success52 199 8948 209 88Done and verified states
--dissolve-danger255 59 48255 69 58Destructive actions, wrong codes
--dissolve-danger-foreground255 255 255255 255 255Content on danger
--dissolve-accent10 132 25510 132 255Your own voice notes, highlights
--dissolve-border60 60 67 / 0.1284 84 88 / 0.5Hairlines, the signing line
--dissolve-chart-1255 55 135255 79 152First chart series, pink
--dissolve-chart-2124 92 255142 114 255Second chart series, violet
--dissolve-chart-3255 196 0255 210 51Third chart series, yellow

Each token is also a Tailwind color: bg-dissolve-primary, text-dissolve-muted, border-dissolve-border. Use them in your own screens too.

Change them

Edit the values in global.css. Light values live on :root, dark ones in the prefers-color-scheme: dark block below.

global.css
/* global.css, after init */
:root {
  --dissolve-primary: rgb(120 72 40);
  --dissolve-primary-foreground: rgb(255 248 240);
  --dissolve-accent: rgb(196 120 60);
}

@media (prefers-color-scheme: dark) {
  :root {
    --dissolve-primary: rgb(232 200 168);
    --dissolve-primary-foreground: rgb(40 24 12);
  }
}

Dark mode

Nothing to wire: the dark block follows the system color scheme and components switch live. Keep the :root plus media query pattern, light-dark() does not resolve on native.

Why @theme inline

The tokens are mapped to Tailwind colors with @theme inline. Without inline, a class points at a --color-* variable that can be resolved once at the root, and on native it keeps the light value. With it, each class reads var(--dissolve-*) directly and picks the value of the current color scheme.

global.css
@layer theme {
  @theme inline {
    --color-dissolve-surface: var(--dissolve-surface);
    /* ... one line per token */
  }
}

Override one instance

Every component takes className, plus a className per part: textClassName, knobClassName, boxClassName and so on, listed in its props. Classes are merged with tailwind-merge, so yours win over the default of the same kind.

Order.tsx
// Defaults: track bg-dissolve-surface, number text-dissolve-foreground
<SlideToConfirm
  label="Slide to order"
  onConfirm={order}
  className="bg-amber-100"                      // replaces bg-dissolve-surface
/>

<NumberTicker
  value={total}
  textClassName="text-emerald-600 font-bold"    // replaces the color and the weight
/>

Some colors are animated or drawn by Skia (OTP boxes, signature ink, waveform). They read the tokens through useToken(), so change the token, or edit the file: it is yours.

Your own Skia drawing
import { useToken } from '@/components/dissolve/tw';

const ink = useToken('foreground'); // live color string, light or dark
<Path path={stroke} color={ink} />

dissolve is MIT licensed. Source on GitHub, package on npm. This page as markdown. For AI agents: llms.txt.