Make a Theme
A full light and dark theme from one brand colour, checked for WCAG contrast.
Install
npm i @dapplelight/signet-tokensGenerate it from the CLI
bun path/to/signet/packages/cli/src/index.ts theme "#e11d48" --base cinematic > src/brand.cssImport src/brand.css in place of the base theme.
Or build it in code
import { buildTheme, toCss, toDesignTokens, toFigmaVariables } from "@dapplelight/signet-tokens/theme"
const theme = buildTheme({ brand: "#e11d48", base: "cinematic" }) // mode: "light" | "dark" | "both"
console.log(toCss(theme)) // overrides the base's colours in light and dark
console.log(theme.adjustments) // tokens moved to reach WCAG 4.5:1 (text) or 3:1 (focus, charts)
const json = toDesignTokens(theme) // W3C Design Tokens JSON
const figma = toFigmaVariables(theme) // body for Figma's POST /v1/files/:key/variablesA pale brand comes back darker in light mode, with the change listed.
Write one by hand
@import "@dapplelight/signet-tokens/editorial.css";
@theme inline {
--color-primary: #e11d48;
--color-primary-foreground: #ffffff;
--color-ring: #e11d48;
}Keep every variable the contract lists; @dapplelight/signet-ui reads only those.