Colors
Kumo uses semantic color tokens that automatically adapt to light and dark mode. Use these classes in your Tailwind CSS instead of raw color values.
Usage
Always use semantic tokens instead of raw Tailwind colors. This ensures your UI automatically adapts to light and dark mode.
Correct
<div className="bg-kumo-base text-kumo-default border-kumo-line">
<button className="bg-kumo-brand text-white">Primary</button>
<button className="bg-kumo-control text-kumo-default">Secondary</button>
</div> Incorrect
<!-- Never use raw Tailwind colors -->
<div className="bg-white dark:bg-gray-900 text-black dark:text-white">
<button className="bg-blue-500">Primary</button>
</div> no-primitive-colors
rule will flag any raw Tailwind colors like bg-blue-500.
Mode
Set data-mode on a parent element to force light or dark.
If you omit it in your app, Kumo's shipped CSS follows the current browser/system preference by default.
data-mode="light"
data-mode="dark"
data-mode omitted
follows browser / OS preference
// Default: follow browser / system preference
<html data-theme="kumo">
// Optional overrides
<html data-theme="kumo" data-mode="light">
<html data-theme="kumo" data-mode="dark">
// Components automatically adapt - no dark: variants needed
<div className="bg-kumo-base text-kumo-default" /> Themes
Themes override semantic token values while preserving the same token names.
Set data-theme on a parent element to apply a theme.
data-theme="kumo"
data-theme="fedramp"
// Apply a theme to a section or the whole app
<div data-theme="fedramp">
{/* All Kumo components inside use fedramp token overrides */}
<Button>fedramp Styled</Button>
</div>
// Themes work with both light and dark mode
<html data-mode="dark" data-theme="fedramp"> Theme Generator
Themes are defined in a centralized config and generated as CSS files plus machine-readable metadata. The generator keeps package exports and docs in sync.
# List all tokens and their theme overrides
pnpm --filter @cloudflare/kumo codegen:themes --list
# Generate theme CSS files
pnpm --filter @cloudflare/kumo codegen:themes
# Inspect generated theme metadata
cat packages/kumo/ai/theme-metadata.json
# Preview changes without writing files
pnpm --filter @cloudflare/kumo codegen:themes --dry-run
Theme config: packages/kumo/scripts/theme-generator/config.ts
Creating a New Theme
Add theme overrides in the config file. Only override tokens that need to change—all other tokens inherit from the base kumo theme.
// In scripts/theme-generator/config.ts
export const THEME_CONFIG: ThemeConfig = {
color: {
"kumo-base": {
newName: "",
theme: {
kumo: {
light: "var(--color-white, #fff)",
dark: "var(--color-black, #000)",
},
// Add your theme override
myTheme: {
light: "#f0f4f8",
dark: "#1a1f2e",
},
},
},
// ... other tokens
},
};
// Add to available themes
export const AVAILABLE_THEMES = ["kumo", "fedramp", "myTheme"] as const;
Then run pnpm codegen:themes to generate the CSS and metadata. Make sure the generated theme stylesheet is imported before using the new data-theme value.
Adding Tokens
If no existing semantic token fits, add a new token in the theme config instead of hardcoding a hex value in a component.
// 1. Add the token in packages/kumo/scripts/theme-generator/config.ts
"kumo-card": {
newName: "",
theme: {
kumo: {
light: "var(--color-kumo-neutral-25, oklch(98.5% 0 0))",
dark: "var(--color-kumo-neutral-900, oklch(20% 0 0))",
},
},
}
// 2. Regenerate theme outputs
pnpm --filter @cloudflare/kumo codegen:themes
// 3. Use the semantic class in components
<div className="bg-kumo-base border-kumo-line text-kumo-default" /> - Source of truth:
config.ts - Generated outputs:
src/styles/theme-*.cssandai/theme-metadata.json - Available classnames follow the token name:
bg-kumo-base,text-kumo-default,border-kumo-line,ring-kumo-ring
Token Reference
Use the mode toggle in the header to inspect light and dark values. The token values shown below are generated from Kumo theme metadata.