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-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 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.

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 such as Badge or Banner. Pair status text with the same semantic family so contrast stays consistent in light and dark mode.

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.

Information

Neutral system context uses the info status tokens.

Deployment complete

Successful states use success tokens for indicators.

Usage approaching limit

Warnings use attention tokens with tinted surfaces.

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

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
kumo-hairline NewA border/ring color to distinguish between flat surfaces where no shadow is present (i.e. LayerCard).
kumo-hairlineA 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

Text Colors (12)

--text-color-kumo-default
Light
Dark
--text-color-kumo-inverse
Light
Dark
--text-color-kumo-strong
Light
Dark
--text-color-kumo-subtle
Light
Dark
--text-color-kumo-inactive
Light
Dark
--text-color-kumo-placeholder
Light
Dark
--text-color-kumo-brand
Light
Dark
--text-color-kumo-link
Light
Dark
--text-color-kumo-info
Light
Dark
--text-color-kumo-success
Light
Dark
--text-color-kumo-danger
Light
Dark
--text-color-kumo-warning
Light
Dark

Surface, State & Theme Colors (28)

--color-kumo-canvas
Light
Dark
--color-kumo-elevated
Light
Dark
--color-kumo-recessed
Light
Dark
--color-kumo-base
Light
Dark
--color-kumo-tint
Light
Dark
--color-kumo-contrast
Light
Dark
--color-kumo-overlay
Light
Dark
--color-kumo-control
Light
Dark
--color-kumo-interact
Light
Dark
--color-kumo-fill
Light
Dark
--color-kumo-fill-hover
Light
Dark
--color-kumo-brand
Light
Dark
--color-kumo-brand-hover
Light
Dark
--color-kumo-line
Light
Dark
--color-kumo-hairline
Light
Dark
--color-kumo-focus
Light
Dark
--color-kumo-shadow-edge
Light
Dark
--color-kumo-shadow-drop
Light
Dark
--color-kumo-tip-shadow
Light
Dark
--color-kumo-tip-stroke
Light
Dark
--color-kumo-info-tint
Light
Dark
--color-kumo-info
Light
Dark
--color-kumo-warning-tint
Light
Dark
--color-kumo-warning
Light
Dark
--color-kumo-danger-tint
Light
Dark
--color-kumo-danger
Light
Dark
--color-kumo-success-tint
Light
Dark
--color-kumo-success
Light
Dark

Component Colors (13)

Badge (11)

--text-color-kumo-badge-orange-subtle
Light
Dark
--text-color-kumo-badge-teal-subtle
Light
Dark
--text-color-kumo-badge-neutral-subtle
Light
Dark
--text-color-kumo-badge-inverted
Light
Dark
--color-kumo-badge-red
Light
Dark
--color-kumo-badge-orange
Light
Dark
--color-kumo-badge-purple
Light
Dark
--color-kumo-badge-teal
Light
Dark
--color-kumo-badge-blue
Light
Dark
--color-kumo-badge-neutral
Light
Dark
--color-kumo-badge-inverted
Light
Dark

Banner (2)

--color-kumo-banner-info
Light
Dark
--color-kumo-banner-warning
Light
Dark