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 className="bg-kumo-base text-kumo-default border-kumo-hairline">
  <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>;

Lint rules enforce this: The no-primitive-colors rule will flag any raw Tailwind colors like bg-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 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.

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 overrides

pnpm --filter @cloudflare/kumo codegen:themes --list

# Generate theme CSS files

pnpm --filter @cloudflare/kumo codegen:themes

# 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

// Add to available themes

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.

TokenPurpose
bg-kumo-canvasThe outermost page background — sits behind everything
bg-kumo-baseDefault component background
bg-kumo-elevatedSlightly elevated surface, e.g. LayerCard.Secondary
bg-kumo-recessedRecessed surface with a subtly darker fill, e.g. segmented Tabs background
bg-kumo-tintSubtle tinted background for tables or hover states
bg-kumo-contrastHigh-contrast, inverted background

Brand

TokenPurpose
bg-kumo-brandPrimary brand background
bg-kumo-brand-hoverHover 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 (i.e. Badge or Banner).

TokenPurpose
bg-kumo-infoInfo indicator (icon, dot, bar)
bg-kumo-successSuccess indicator
bg-kumo-warningWarning indicator
bg-kumo-dangerError/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.

// Banner with tinted background and solid icon
<div className="bg-kumo-danger-tint text-kumo-danger">
  <AlertIcon className="text-kumo-danger" />
  <p>Something went wrong.</p>
</div>

Text Colors

TokenPurpose
text-kumo-defaultPrimary body text
text-kumo-strongStronger text contrast than default for headers and important labels
text-kumo-subtleMuted text for descriptions, captions, or secondary labels
text-kumo-inactiveDisabled or inactive text
text-kumo-placeholderPlaceholder text in inputs
text-kumo-inverseText intended for use on high-contrast or inverted backgrounds
text-kumo-linkLink text
text-kumo-infoInfo-colored text
text-kumo-successSuccess-colored text
text-kumo-warningWarning-colored text
text-kumo-dangerError/destructive text

Borders & Rings

TokenPurpose
        <code>kumo-hairline</code>
        <div class="not-prose my-4 rounded-lg border border-kumo-hairline bg-kumo-canvas p-4 text-sm text-kumo-subtle">New</div>
      
    </td>
    <td>A border/ring color to distinguish between flat surfaces where no shadow is present (i.e. <code>LayerCard</code>).</td>
  </tr>
  <tr>
    <td><code>kumo-hairline</code></td>
    <td>A thicker border/ring color that defines the edge of an elevated surface alongside a shadow.</td>
  </tr>
</tbody>

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.

TailwindColorTokens