Theming

Use your shadcn theme, or one of six presets.

Fable blocks use only shadcn's semantic variables: --background, --foreground, --card, --primary, --secondary, --muted, --accent, --border, --ring, --destructive, --chart-1 to --chart-5 and --radius, plus font-heading. There are no hard-coded brand colors.

Use your own theme

Generate a theme in the shadcn customizer, paste its :root and .dark blocks into your global CSS, and you're done. Check that --chart-1…5 are distinguishable from each other: charts and donut slices use them in order.

Presets

pnpm dlx shadcn@latest add https://fable-ui.shobky.com/r/fable-themes.json
app/globals.css
@import "tailwindcss";
@import "../styles/fable-themes.css";

Then set the preset on <html>, or on any wrapper to theme just the chat:

<html data-fable-theme="cobalt">
PresetCharacterRadiusHeadings
neutralQuiet grayscale, multi-hue charts10pxSans
cobaltCool blue-gray, product UI12pxSans
mossDeep green, calm8pxSans
roseWarm raspberry, friendly16px--font-display
editorialInk on paper, high contrast4px--font-serif
midnightViolet, dark-first14px--font-display

Dark mode follows the .dark class, as in every shadcn app. When a preset lives on a wrapper rather than <html>, dialogs and menus render in a portal outside it; apply the preset to <html> if that matters.

Fonts

Presets point headings at --font-serif or --font-display when those exist and fall back to your sans. Load them with next/font:

app/layout.tsx
import { Bricolage_Grotesque, Newsreader } from "next/font/google"
 
const serif = Newsreader({ subsets: ["latin"], variable: "--font-serif" })
const display = Bricolage_Grotesque({ subsets: ["latin"], variable: "--font-display" })

Changing the components

Every block is a file in components/fable-ui/blocks. Change spacing, borders or type there; the shared surface style is one constant, surface, in blocks/shared.tsx.