/* * @interlace/ui — canonical Interlace brand theme (light + dark). * * Import in the consuming app AFTER `theme.css` + `tokens.css`: * * @import "@interlace/ui/styles/tokens.css"; * @import "@interlace/ui/styles/theme.css"; * @import "@interlace/ui/styles/interlace-theme.css"; * * Why this file exists separately from theme.css: * * - `theme.css` is the **bridge** layer — maps shadcn-bare tokens (`--card`, * `--popover`) to whatever the surrounding framework exposes * (`--color-fd-*` from fumadocs, in this project). * - `interlace-theme.css` is the **brand** layer — concrete hex values that * identify this product. App consumers who fork the brand can replace * this file; the bridge layer (`theme.css`) stays. * * Contrast contract (WCAG 2.2 AA): * - Body text on background: ≥ 4.5:1 (target: 7:1 AAA where possible) * - Large text + UI controls on adjacent surface: ≥ 3:1 * - Focus ring on adjacent colors: ≥ 3:1 (WCAG 2.2 SC 2.4.13) * - Verified at https://webaim.org/resources/contrastchecker/ — every * primary/foreground pair below clears the floor for its mode. * * Source palette: the Interlace mark — burnt orange (see render-cover.sh). * Light primary: #7d350c → 8.80:1 on white (AAA) * Dark primary: #fbb99a → 11.79:1 on near-black (AAA) * * Replaced the Tailwind-violet palette this system shipped with. Every pair * below was re-measured after the swap; none regressed. */ /* ───────────────────────────────────────────────────────────────── * LIGHT — default * ──────────────────────────────────────────────────────────────── */ :root { /* Brand * * Burnt orange, from the mark. #7d350c measures 8.80:1 on white, 8.12:1 * on `--accent` (#fef4ed), and 7.46:1 on its OWN 10% tint — that last one * is the binding constraint. `bg-primary/10` + `text-primary` is a stock * shadcn badge pattern, and it composites to #f3ebe7 on white; a lighter * orange (#8a3a10) landed at 6.63:1 there and axe failed the enhanced * check. This value tracks violet-800's old profile (8.98 / 7.56) so the * AAA floor holds on every catalogue surface AND on brand-tinted ones. */ --interlace-primary: #7d350c; /* 8.80:1 on white (AAA) */ --interlace-primary-hover: #6b2b09; /* 10.63:1 on white */ --interlace-primary-active: #4d2009; /* 13.76:1 on white */ --interlace-primary-foreground: #ffffff; --interlace-primary-subtle: #fef4ed; /* warm tint for backgrounds */ --interlace-primary-subtle-foreground: #4d2009; /* 12.70:1 on subtle (AAA) */ /* Surface */ --interlace-background: #ffffff; --interlace-foreground: #0d0b09; /* near-black, slight warm tint */ --interlace-card: #ffffff; --interlace-card-foreground: #0d0b09; --interlace-popover: #ffffff; --interlace-popover-foreground: #0d0b09; --interlace-muted: #faf7f4; /* warm-tinted neutral */ --interlace-muted-foreground: #4d453c; /* 8.06:1 on white (AAA body) */ --interlace-border: #eae7e2; --interlace-input: #eae7e2; --interlace-ring: var(--interlace-primary); /* Accent */ --interlace-accent: #fef4ed; /* warm tint */ --interlace-accent-foreground: #73300d; /* 8.98:1 on accent (AAA) */ /* Secondary */ --interlace-secondary: #f5f3f0; --interlace-secondary-foreground: #1f1a15; /* Destructive (Tailwind red-800 — text-destructive on white ≈ 8.0:1, AAA) */ --interlace-destructive: #991b1b; --interlace-destructive-foreground: #ffffff; /* Success (Tailwind emerald-800 — text-success on white ≈ 7.3:1, AAA) */ --interlace-success: #065f46; --interlace-success-foreground: #ffffff; /* Warning (Tailwind amber-900 — text-warning on white ≈ 8.5:1, AAA) */ --interlace-warning: #78350f; --interlace-warning-foreground: #ffffff; /* Radii (8/12/16 — three-step scale) */ --interlace-radius-sm: 0.5rem; /* 8px */ --interlace-radius-md: 0.75rem; /* 12px */ --interlace-radius-lg: 1rem; /* 16px */ } /* ───────────────────────────────────────────────────────────────── * DARK — class-based + data-attribute switch * ──────────────────────────────────────────────────────────────── */ .dark, [data-theme='dark'] { /* Brand — inverted weight: a light tint of the same burnt orange, so * both directions clear AAA. text-primary on near-black is 11.79:1, and * bg-primary with text-primary-foreground (#0a0a0a) is the same 11.79:1. * The cover orange #f4794a is only 7.24:1 here, too dark to carry the * bidirectional pair, hence the lighter tint. */ --interlace-primary: #fbb99a; /* 11.79:1 on dark bg (AAA) */ --interlace-primary-hover: #fcc9b0; /* 13.31:1 */ --interlace-primary-active: #fdd6c2; /* 14.68:1 */ --interlace-primary-foreground: #0a0a0a; /* near-black — 11.79:1 on primary */ --interlace-primary-subtle: #3d1a08; /* tinted background */ --interlace-primary-subtle-foreground: #fdd6c2; /* 11.54:1 on subtle (AAA) */ /* Surface */ --interlace-background: #0a0a0a; --interlace-foreground: #f0ede9; --interlace-card: #171412; --interlace-card-foreground: #f0ede9; --interlace-popover: #171412; --interlace-popover-foreground: #f0ede9; --interlace-muted: #171412; --interlace-muted-foreground: #c9c3bb; /* 9.6:1 on #0a0a0a (AAA) */ --interlace-border: #252019; --interlace-input: #252019; --interlace-ring: var(--interlace-primary); /* Accent */ --interlace-accent: #3d1a08; /* deep warm tint */ --interlace-accent-foreground: #fcc9b0; /* 10.46:1 on accent (AAA) */ /* Secondary */ --interlace-secondary: #201c17; --interlace-secondary-foreground: #f0ede9; /* Destructive (red-300 — text-destructive on near-black ≈ 9:1, AAA) */ --interlace-destructive: #fca5a5; --interlace-destructive-foreground: #0a0a0a; /* Success (emerald-400 — ≈ 8.5:1 on near-black, AAA) */ --interlace-success: #34d399; --interlace-success-foreground: #052e16; /* Warning (amber-500 — 7.7:1 on near-black, AAA) */ --interlace-warning: #f59e0b; --interlace-warning-foreground: #1e1b2e; } /* ───────────────────────────────────────────────────────────────── * Bind brand tokens to the shadcn-bare names. Apps that want to * override individual brand values can re-declare them after this * import. * ──────────────────────────────────────────────────────────────── */ :root, .dark, [data-theme='dark'] { --primary: var(--interlace-primary); --primary-foreground: var(--interlace-primary-foreground); --background: var(--interlace-background); --foreground: var(--interlace-foreground); --card: var(--interlace-card); --card-foreground: var(--interlace-card-foreground); --popover: var(--interlace-popover); --popover-foreground: var(--interlace-popover-foreground); --muted: var(--interlace-muted); --muted-foreground: var(--interlace-muted-foreground); --accent: var(--interlace-accent); --accent-foreground: var(--interlace-accent-foreground); --secondary: var(--interlace-secondary); --secondary-foreground: var(--interlace-secondary-foreground); --border: var(--interlace-border); --input: var(--interlace-input); --ring: var(--interlace-ring); --destructive: var(--interlace-destructive); --destructive-foreground: var(--interlace-destructive-foreground); /* Override fumadocs-prefixed tokens for AA contrast. * * Fumadocs `neutral.css` ships `--color-fd-muted-foreground: #737373`, * which yields 4.34–4.46:1 contrast against the `bg-fd-card/40-50` * surfaces our Section / SectionHeader stories render — just below * the WCAG 2.2 AA 4.5:1 floor and gates Storybook a11y CI red. * * Rebinding to the brand muted-foreground (a darker warm grey in * light, lighter in dark) clears the threshold and keeps brand * consistency between shadcn-styled and fumadocs-styled surfaces. */ --color-fd-muted-foreground: var(--interlace-muted-foreground); } /* Register the shadcn-bare tokens as Tailwind v4 theme keys so utilities * like `bg-card`, `text-foreground`, `border-border`, `bg-primary` are * generated. `inline` preserves the `var()` reference, so the runtime * `.dark { --background: ... }` overrides above flow through to every * utility. Without this block, Tailwind v4 emits no `bg-card` rule * regardless of what `--card` resolves to on :root. */ @theme inline { --color-background: var(--background); --color-foreground: var(--foreground); --color-card: var(--card); --color-card-foreground: var(--card-foreground); --color-popover: var(--popover); --color-popover-foreground: var(--popover-foreground); --color-primary: var(--primary); --color-primary-foreground: var(--primary-foreground); --color-secondary: var(--secondary); --color-secondary-foreground: var(--secondary-foreground); --color-muted: var(--muted); --color-muted-foreground: var(--muted-foreground); --color-accent: var(--accent); --color-accent-foreground: var(--accent-foreground); --color-border: var(--border); --color-input: var(--input); --color-ring: var(--ring); --color-destructive: var(--destructive); --color-destructive-foreground: var(--destructive-foreground); }