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, and that your components remain consistent across themes.
Correct
<div class="bg-kumo-base text-kumo-default border-kumo-hairline"> <button class="bg-kumo-brand text-white">Primary</button> <button class="bg-kumo-control text-kumo-default">Secondary</button></div> Incorrect
{ /* Never use raw Tailwind colors */}<div class="bg-white dark:bg-gray-900 text-black dark:text-white"> <button class="bg-blue-500">Primary</button></div>; Lint rules enforce this: The
no-primitive-colorsrule will flag any raw Tailwind colors likebg-blue-500.
Mode
Set data-mode on a parent element to control light/dark mode. Never use Tailwind's dark: variant — semantic tokens handle dark mode automatically via CSS light-dark().
// Set mode on html or body<html data-mode="light"> // Light mode<html data-mode="dark"> // Dark mode// Components automatically adapt - no dark: variants needed<div class="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.
Available Themes
kumo— Default theme (no attribute needed)fedramp— Government compliance styling
// 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. The theme generator ensures consistency across all themes.
# List all tokens and their theme overridespnpm --filter @cloudflare/kumo codegen:themes --list# Generate theme CSS filespnpm --filter @cloudflare/kumo codegen:themes# Preview changes without writing filespnpm --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.tsexport 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 themesexport const AVAILABLE_THEMES = ["kumo", "fedramp", "myTheme"] as const; Then run pnpm codegen:themes to generate the CSS.
Semantic Tokens
We use semantic tokens to group colors by purpose. Use the token that matches the role of the element, not the color you want to achieve.
Semantic tokens are named by role, not by hue. A token like bg-kumo-danger communicates intent — it doesn't imply a specific shade of red, and its exact value can change per theme or color mode without touching your component code.
Surface Hierarchy
Surfaces establish depth and layering in the UI. Use them in order from the outermost background inward.
| Token | Purpose |
|---|---|
bg-kumo-canvas | The outermost page background — sits behind everything |
bg-kumo-base | Default component background |
bg-kumo-elevated | Slightly elevated surface, e.g. LayerCard.Secondary |
bg-kumo-recessed | Recessed surface with a subtly darker fill, e.g. segmented Tabs background |
bg-kumo-tint | Subtle tinted background for tables or hover states |
bg-kumo-contrast | High-contrast, inverted background |
Brand
| Token | Purpose |
|---|---|
bg-kumo-brand | Primary brand background |
bg-kumo-brand-hover | Hover state for brand backgrounds |
Semantic Status Colors
Each status color comes in two variants: a solid color for icons and indicators, and a -tint variant for background fills behind content such as Badge or Banner. Pair status text with the same semantic family so contrast stays consistent in light and dark mode.
| Token | Purpose |
|---|---|
bg-kumo-info | Info indicator (icon, dot, bar) |
bg-kumo-success | Success indicator |
bg-kumo-warning | Warning indicator |
bg-kumo-danger | Error/destructive indicator |
Use the solid token on icons, status dots, borders and rings. Banners and badges use the -tint variant with varying opacity values for the different instances.
Request failed
Destructive states use danger tokens for icon and contrast.
<script lang="ts">
import { Banner } from '$lib';
import { CheckCircle, Info, Warning, WarningCircle } from 'phosphor-svelte';
</script>
<div class="w-full space-y-3">
<Banner icon={Info} title="Information" description="Neutral system context uses the info status tokens." />
<Banner icon={CheckCircle} title="Deployment complete" description="Successful states use success tokens for indicators." />
<Banner icon={Warning} variant="alert" title="Usage approaching limit" description="Warnings use attention tokens with tinted surfaces." />
<Banner icon={WarningCircle} variant="error" title="Request failed" description="Destructive states use danger tokens for icon and contrast." />
</div> // Banner with tinted background and solid icon<div class="bg-kumo-danger-tint text-kumo-danger"> <AlertIcon class="text-kumo-danger" /> <p>Something went wrong.</p></div> Text Colors
| Token | Purpose |
|---|---|
text-kumo-default | Primary body text |
text-kumo-strong | Stronger text contrast than default for headers and important labels |
text-kumo-subtle | Muted text for descriptions, captions, or secondary labels |
text-kumo-inactive | Disabled or inactive text |
text-kumo-placeholder | Placeholder text in inputs |
text-kumo-inverse | Text intended for use on high-contrast or inverted backgrounds |
text-kumo-link | Link text |
text-kumo-info | Info-colored text |
text-kumo-success | Success-colored text |
text-kumo-warning | Warning-colored text |
text-kumo-danger | Error/destructive text |
Borders & Rings
| Token | Purpose |
|---|---|
kumo-hairline New | A border/ring color to distinguish between flat surfaces where no shadow is present (i.e. LayerCard). |
kumo-hairline | A thicker border/ring color that defines the edge of an elevated surface alongside a shadow. |
Token Reference
Toggle the theme in the header to see how tokens adapt. Tokens marked as "global" are explicit opt-in classes available regardless of theme.
Colors
Displaying 53 tokens