Repository Public
1import type { Tone } from "@/schema";23/** CSS references to the theme tokens. export-svg.ts resolves them to concrete colours for standalone files. */4export const toneVar = (tone: Tone): string => `var(--sh-t-${tone})`;5export const toneSoftVar = (tone: Tone): string => `var(--sh-t-${tone}-soft)`;6export const V = {7 bg: "var(--sh-bg)", surface: "var(--sh-surface)", raised: "var(--sh-raised)",8 ink: "var(--sh-ink)", muted: "var(--sh-muted)", faint: "var(--sh-faint)",9 line: "var(--sh-line)", grid: "var(--sh-grid)", accent: "var(--sh-accent)", accentSoft: "var(--sh-accent-soft)",10 fontBody: "var(--sh-font-body)", fontDisplay: "var(--sh-font-display)", fontMono: "var(--sh-font-mono)",11} as const;12/** `in srgb` on purpose: export-svg.ts computes the same mix arithmetically. */13export const mix = (a: string, percent: number, b: string): string => `color-mix(in srgb, ${a} ${Math.round(percent)}%, ${b})`;14export const toneClass = (tone: Tone): string => `sh-tone-${tone}`;15