Your next page is taking shape...

Opening Your Next Page…

Loading the guide and preparing its examples for you to explore. The page will appear here automatically when it’s ready, so you can keep this view open without refreshing.

Made for Preact. Built to be yours.

Shared Design Foundation

Theming & Tailwind for Your Entire App

Connect Tailwind CSS v4 and @kamod-ch/themes once, then share colors, typography and appearance preferences across your interface. Start with a preset, refine its semantic roles and keep Light, Dark and System working together. For copied layouts, continue with Block Theming.


Choose Your Theme Foundation

Choose a brand preset and an appearance scheme separately. Ocean, for example, works in Light or Dark; System follows the device. Static CSS needs no provider. Add runtime controls only when users need a saved choice.

Install PackagesTerminal
pnpm add @kamod-ch/ui preact @preact/signals @kamod-ch/themes

Pin these versions to match @kamod-ch/ui's peer contract. @preact/signals is a required peer (it is not @kamod-ch/signals). @kamod-ch/themes@^0.2.2 supplies the full preset foundation this guide uses — including ThemeToggle and @kamod-ch/themes/theme.css. That is separate from the UI-only minimum in Getting Started, which can use @kamod-ch/ui/theme.css without installing @kamod-ch/themes.

Keep your existing Preact and Tailwind setup. For this guide, use the complete @kamod-ch/themes/theme.css foundation: it includes the application presets and sidebar roles. CSS setup covers the import order and source scanning; Getting Started covers a first installation.

Style Components through Their Roles

Use the component’s supported variant and size, local utilities for layout, and semantic colors for shared design decisions. A surface and its text need an explicit pair:

src/components/ProjectSummary.tsx13 lines
import { Button } from "@kamod-ch/ui/button";

export function ProjectSummary() {
  return (
    <section class="rounded-lg border border-border bg-card p-4 text-card-foreground">
      <h2 class="font-semibold">Your next workspace</h2>
      <p class="mt-2 text-sm text-muted-foreground">A shared palette, applied by role.</p>
      <Button type="button" variant="outline" class="mt-4">
        View projects
      </Button>
    </section>
  );
}

bg-card supplies the surface; text-card-foreground supplies its ink. Components choose their own combinations: the default Button uses text-background, so changing --primary-foreground alone will not change that label.

Change Where it belongs
Spacing and arrangement Parent layout, such as grid gap-4
Supported control treatment Component props, such as variant="outline"
App-wide color or shape Shared tokens
Copied navigation and shells Block theming
Syntax colors in a reader Code palettes

Set Up Tailwind and Theme CSS

Keep the foundation in one global stylesheet: load Tailwind, choose a theme entry and include the sources that contain your utility classes. For a complete app scaffold, follow Set Up Your App.

Choose a Theme Entry

Use @kamod-ch/themes/theme.css for the full component-and-block foundation. The smaller UI entry is useful when you deliberately own the additional preset and sidebar mappings.

Entry What it supplies When to use it
@kamod-ch/themes/theme.css Semantic mappings, eight presets, sidebar roles and local scope resets. A shared application foundation.
@kamod-ch/ui/theme.css Common component defaults, source discovery, Code, CopyButton and Tabs styles. A smaller UI baseline with app-owned additions.
@kamod-ch/ui/code/styles.css Reader layout, syntax palettes and CopyButton feedback; no theme foundation. Additive reader styles alongside the full themes entry.

Choose one foundation: the first two entries contain overlapping defaults. The dedicated Code stylesheet can accompany the full theme; the UI entry already includes it.

Connect Tailwind CSS v4

In Vite, enable @tailwindcss/vite alongside your existing Preact plugin. Import this stylesheet once from your application entry:

src/app.css6 lines
@import "tailwindcss";
@import "@kamod-ch/themes/theme.css";
/* Include when your app uses the Code reader. */
@import "@kamod-ch/ui/code/styles.css";

@source "../node_modules/@kamod-ch/ui/dist/**/*.{js,mjs}";

The full theme uses @theme inline to expose utilities such as bg-card, and supplies the class-based dark variant. Keep product overrides after these imports. The optional Tailwind preset is for configuration-driven integrations; it is unnecessary for this CSS-first setup.

Make Source Detection Explicit

The @source path above is relative to src/app.css. Adjust it when your stylesheet, dependency installation or shared source lives elsewhere. Local application files are normally detected automatically; installed dependencies and external workspace folders may need explicit paths.

Keep complete class names visible to Tailwind. Use a finite mapping such as ready: "bg-success text-success-foreground" instead of assembling utility names from fragments. When styles disappear only in production, inspect source detection and generated CSS before adding overrides.

Optional Tailwind Preset

For a compatible config-driven pipeline, the package also exports a preset. Skip this for the CSS-first v4 setup above.

tailwind.config.ts3 lines
import kamodThemes from "@kamod-ch/themes/tailwind-preset";

export default { presets: [kamodThemes] };

This does not replace theme CSS or source scanning.

Color Theme Presets

Explore Eight Palettes from Color to Working Interface. Start with the main colors, inspect the complete light and dark token reference, then see those roles in the same compositions and an interactive workspace. Every study includes copyable color values, practical design notes, typography and shape.

Start with the direction that suits your content. Use theme applies a preset to this documentation while keeping your current appearance preference; comparisons and playgrounds keep their own local appearance. The complete TSX example is always visible. Suggested uses are starting points, not restrictions.

For source code, open the Prism syntax themes group after the application presets. Compare 24 locally saved palettes, inspect token colors and copy a scoped reader recipe. Each study credits its source; the collection ends with integration, licensing and contrast guidance.

Neutral foundation · Fuchsia detail

Kamodkamod

Let contrast do the talking.

  • Settings
  • Documentation
  • Everyday tools

Core Colors·The palette at a glance

Eight roles that set the tone. Explore a swatch, copy a value, then keep its matching text color with it.

Hover or focus for the role, pairing and source.
Available in browser
Available in browser
Available in browser
Available in browser
Available in browser
Available in browser
Available in browser
Available in browser

The variable follows your app's appearance; fixed HEX and RGB values do not. Those exports are 8-bit sRGB conversions, with alpha preserved. Resolved CSS keeps the browser's color space.

Every Color·Light and dark, side by side

All 43 semantic colors, including text, focus and feedback. Choose a color below to inspect and copy it.

43 / 43 colors
Surfaces & reading

Canvas, layers and the text that belongs on each one.

8
Role / token Light Dark
Canvas--background
Page text--foreground
Surface--card
Surface text--card-foreground
Floating surface--popover
Floating text--popover-foreground
Quiet surface--muted
Quiet text--muted-foreground
Brand & interaction

Primary intent, supporting actions and quieter selected states.

8
Role / token Light Dark
Primary--primary
Primary / Light--primary
CSS variablevar(--primary)
Resolved CSSAvailable in browser
HEX · sRGB exportAvailable in your browser

The strongest action in the current flow. It can be near-black, white or a saturated hue; it describes importance rather than a fixed brand color.

Read source declaration
Primary text--primary-foreground
Primary emphasis--primary-accent
Secondary--secondary
Secondary text--secondary-foreground
Secondary emphasis--secondary-accent
Selection surface--accent
Selection text--accent-foreground
Feedback & status

Meaningful messages, always paired with words or icons.

10
Role / token Light Dark
Information--info
Information text--info-foreground
Success--success
Success text--success-foreground
Warning--warning
Warning text--warning-foreground
Error--error
Error text--error-foreground
Danger--destructive
Danger text--destructive-foreground
Borders & focus

Structure and keyboard focus; translucent values keep their alpha.

4
Role / token Light Dark
Boundary--border
Input edge--input
Focus ring--ring
Focus outline--outline
Charts & data

Five ordered series colors. Keep labels or patterns alongside color.

5
Role / token Light Dark
Series 1--chart-1
Series 2--chart-2
Series 3--chart-3
Series 4--chart-4
Series 5--chart-5
Sidebar & navigation

A complete local palette for navigation surfaces and selection.

8
Role / token Light Dark
Sidebar surface--sidebar-background
Sidebar text--sidebar-foreground
Sidebar primary--sidebar-primary
Sidebar primary text--sidebar-primary-foreground
Sidebar selection--sidebar-accent
Sidebar selected text--sidebar-accent-foreground
Sidebar boundary--sidebar-border
Sidebar focus--sidebar-outline

Each appearance is isolated from the page theme. Equal swatches can still have different roles. bg-sidebar maps to --sidebar-background; ring-sidebar-ring maps to --sidebar-outline. Optional source shades stay separate from the reusable semantic roles; Watson's source shades are the same in both appearances. Variable copies include a fallback for optional shades.

The palette in context

One layout, two appearances. Compare the action, the surface and the space between them.

Token guide
Light appearance3 composition studies

Workspace

Action card

Feature

Dark appearance3 composition studies

Workspace

Action card

Feature

Put the Palette to Work

Edit a release, check its states, then switch appearances. Only this workspace changes.

Release studioKamod · Local experiment
Inspect a state
Next releaseDraft
Before it goes live
Five colors, one visual rhythmChart roles stay separate from action and feedback colors.

A little room for your next idea. Trace these roles back to the tokens

Typography

Make room for good ideas.

Clear text. A little contrast.

const theme = { color, type, radius }

Body
Application / system
Display
Application / system
Mono
Application / system mono
Font setup & usage

Samples use native fonts; named stacks above need their font files in your app. The foundation leaves font choice to your app. Start with a native stack, establish a readable scale, then add a product typeface only if it improves the content.

Shape & rhythm 0.625rem

smlgxl

One corner family, from compact controls to larger panels.

Notes on shape

A balanced default: round enough for friendly controls, restrained enough for dense tools. Keep the same radius family across menus, inputs and cards.

Design notes & practical checks

Kamod starts with white and neutral surfaces, a near-black primary action and a fuchsia secondary accent. Its strongest contrast belongs to the main action rather than to a colored page background. This makes it a useful baseline for comparing component hierarchy before choosing a more expressive palette.

In light & dark

Dark mode reverses the primary action to a light surface and separates cards from the darker page with neutral layers. Fuchsia remains the secondary identity; the primary color is not always a hue.

Put it to work

Use it for documentation, settings and interfaces where content should lead. Keep the strongest fill for the action that completes the current task; use secondary color for a distinct supporting role.

Small choices, big difference

  1. Give the strongest fill one job

    Let a near-black action finish the task while the surrounding page stays quiet. If several controls compete for that fill, promote the most consequential one and simplify its neighbors.

    --primary--foreground
  2. Make the accent intentional

    Fuchsia can identify a supporting action or a small point of interest. Repeating it across every heading, badge and border would remove the calm that makes this preset useful.

    --secondary--accent

Try a real task

One preference, one clear action

Give a settings form one primary Save action. Keep reset and help secondary, then add a visible saved message.

The main action, keyboard focus and saved result remain distinct.

Before you ship

Check subtle borders and disabled controls against neighboring neutral surfaces. A quiet palette still needs a visible selected state and keyboard focus.

Try Kamod in your app

TSX · Local scope

Inside a component’s return, scope this palette to a small region. Keep your full theme stylesheet at the app entry. Change light to dark for the other appearance; this wrapper does not save a page preference.

ThemeRegion.tsx8 lines
<section data-theme-scope="" data-theme="kamod" class="light">
  <div class="rounded-lg border border-border bg-card p-4 text-card-foreground">
    <h2 class="font-semibold">A little room for your next idea.</h2>
    <p class="mt-2 text-sm text-muted-foreground">
      One shared palette, applied through component roles.
    </p>
  </div>
</section>

Monochrome structure · Compact shape

shadcn (Geist)shadcn

Build the hierarchy before the decoration.

  • Data tables
  • Admin screens
  • Utility panels

Core Colors·The palette at a glance

Eight roles that set the tone. Explore a swatch, copy a value, then keep its matching text color with it.

Hover or focus for the role, pairing and source.
Available in browser
Available in browser
Available in browser
Available in browser
Available in browser
Available in browser
Available in browser
Available in browser

The variable follows your app's appearance; fixed HEX and RGB values do not. Those exports are 8-bit sRGB conversions, with alpha preserved. Resolved CSS keeps the browser's color space.

Every Color·Light and dark, side by side

All 43 semantic colors, including text, focus and feedback. Choose a color below to inspect and copy it.

43 / 43 colors
Surfaces & reading

Canvas, layers and the text that belongs on each one.

8
Role / token Light Dark
Canvas--background
Page text--foreground
Surface--card
Surface text--card-foreground
Floating surface--popover
Floating text--popover-foreground
Quiet surface--muted
Quiet text--muted-foreground
Brand & interaction

Primary intent, supporting actions and quieter selected states.

8
Role / token Light Dark
Primary--primary
Primary / Light--primary
CSS variablevar(--primary)
Resolved CSSAvailable in browser
HEX · sRGB exportAvailable in your browser

The strongest action in the current flow. It can be near-black, white or a saturated hue; it describes importance rather than a fixed brand color.

Read source declaration
Primary text--primary-foreground
Primary emphasis--primary-accent
Secondary--secondary
Secondary text--secondary-foreground
Secondary emphasis--secondary-accent
Selection surface--accent
Selection text--accent-foreground
Feedback & status

Meaningful messages, always paired with words or icons.

10
Role / token Light Dark
Information--info
Information text--info-foreground
Success--success
Success text--success-foreground
Warning--warning
Warning text--warning-foreground
Error--error
Error text--error-foreground
Danger--destructive
Danger text--destructive-foreground
Borders & focus

Structure and keyboard focus; translucent values keep their alpha.

4
Role / token Light Dark
Boundary--border
Input edge--input
Focus ring--ring
Focus outline--outline
Charts & data

Five ordered series colors. Keep labels or patterns alongside color.

5
Role / token Light Dark
Series 1--chart-1
Series 2--chart-2
Series 3--chart-3
Series 4--chart-4
Series 5--chart-5
Sidebar & navigation

A complete local palette for navigation surfaces and selection.

8
Role / token Light Dark
Sidebar surface--sidebar-background
Sidebar text--sidebar-foreground
Sidebar primary--sidebar-primary
Sidebar primary text--sidebar-primary-foreground
Sidebar selection--sidebar-accent
Sidebar selected text--sidebar-accent-foreground
Sidebar boundary--sidebar-border
Sidebar focus--sidebar-outline

Each appearance is isolated from the page theme. Equal swatches can still have different roles. bg-sidebar maps to --sidebar-background; ring-sidebar-ring maps to --sidebar-outline. Optional source shades stay separate from the reusable semantic roles; Watson's source shades are the same in both appearances. Variable copies include a fallback for optional shades.

The palette in context

One layout, two appearances. Compare the action, the surface and the space between them.

Token guide
Light appearance3 composition studies

Workspace

Action card

Feature

Dark appearance3 composition studies

Workspace

Action card

Feature

Put the Palette to Work

Edit a release, check its states, then switch appearances. Only this workspace changes.

Release studioshadcn (Geist) · Local experiment
Inspect a state
Next releaseDraft
Before it goes live
Five colors, one visual rhythmChart roles stay separate from action and feedback colors.

Clear structure. A useful next step. Trace these roles back to the tokens

Typography

Make room for good ideas.

Clear text. A little contrast.

const theme = { color, type, radius }

Body
Geist / Geist Variable
Display
Geist / Geist Variable
Mono
Fira Code / Fira Code Variable
Font setup & usage

Samples use native fonts; named stacks above need their font files in your app. A clear sans and a distinct mono make dense interfaces easier to scan. These are declared stacks; the comparison stays in native type rather than downloading fonts.

Shape & rhythm 0.5rem

smlgxl

One corner family, from compact controls to larger panels.

Notes on shape

Compact corners keep rows, tables and utility panels feeling direct. Preserve breathing room inside the component even when the outline is tighter.

Design notes & practical checks

The shadcn preset uses zinc-like neutrals, black-and-white primary actions and a 0.5rem radius. Page and card surfaces sit close together, so spacing, boundaries and typography carry much of the structure. It is a familiar starting point when adapting an existing neutral component system.

In light & dark

Dark mode keeps the page and card very dark, with white primary actions and lighter borders. This preset overrides a focused subset of tokens: unspecified roles inherit the theme foundation. Its secondary role therefore still includes the default fuchsia; monochrome primary styling does not mean every semantic color is gray.

Put it to work

Use it when your product already has a neutral visual foundation. Compare the same card with Kamod to decide whether the tighter shape and lower surface separation suit your content.

Small choices, big difference

  1. Separate with rhythm

    Close page and card values benefit from clear spacing and a thin boundary. Try a consistent section gap before adding darker shadows or another surface color.

    --card--border
  2. Review inherited color too

    The black-and-white primary treatment is only part of this preset. Secondary and feedback roles can inherit values from the foundation, so include them when reviewing a real form or menu.

    --secondary--success

Try a real task

Make a dense list easy to follow

Place a search field above a record list. Use spacing and boundaries to separate the selected row from nearby actions.

Selection, hover and focus are recognizable without extra shadows.

Before you ship

Check input boundaries, selected navigation and keyboard focus against neighboring neutral surfaces. Review secondary and status roles too; a monochrome main action does not make every role neutral.

Try shadcn (Geist) in your app

TSX · Local scope

Inside a component’s return, scope this palette to a small region. Keep your full theme stylesheet at the app entry. Change light to dark for the other appearance; this wrapper does not save a page preference.

ThemeRegion.tsx8 lines
<section data-theme-scope="" data-theme="shadcn" class="light">
  <div class="rounded-lg border border-border bg-card p-4 text-card-foreground">
    <h2 class="font-semibold">Clear structure. A useful next step.</h2>
    <p class="mt-2 text-sm text-muted-foreground">
      One shared palette, applied through component roles.
    </p>
  </div>
</section>

Cool cyan · Indigo counterpart

Oceanocean

Give a cool palette a clear sense of depth.

  • Workspaces
  • Account settings
  • Dashboards

Core Colors·The palette at a glance

Eight roles that set the tone. Explore a swatch, copy a value, then keep its matching text color with it.

Hover or focus for the role, pairing and source.
Available in browser
Available in browser
Available in browser
Available in browser
Available in browser
Available in browser
Available in browser
Available in browser

The variable follows your app's appearance; fixed HEX and RGB values do not. Those exports are 8-bit sRGB conversions, with alpha preserved. Resolved CSS keeps the browser's color space.

Every Color·Light and dark, side by side

All 43 semantic colors, including text, focus and feedback. Choose a color below to inspect and copy it.

43 / 43 colors
Surfaces & reading

Canvas, layers and the text that belongs on each one.

8
Role / token Light Dark
Canvas--background
Page text--foreground
Surface--card
Surface text--card-foreground
Floating surface--popover
Floating text--popover-foreground
Quiet surface--muted
Quiet text--muted-foreground
Brand & interaction

Primary intent, supporting actions and quieter selected states.

8
Role / token Light Dark
Primary--primary
Primary / Light--primary
CSS variablevar(--primary)
Resolved CSSAvailable in browser
HEX · sRGB exportAvailable in your browser

The strongest action in the current flow. It can be near-black, white or a saturated hue; it describes importance rather than a fixed brand color.

Read source declaration
Primary text--primary-foreground
Primary emphasis--primary-accent
Secondary--secondary
Secondary text--secondary-foreground
Secondary emphasis--secondary-accent
Selection surface--accent
Selection text--accent-foreground
Feedback & status

Meaningful messages, always paired with words or icons.

10
Role / token Light Dark
Information--info
Information text--info-foreground
Success--success
Success text--success-foreground
Warning--warning
Warning text--warning-foreground
Error--error
Error text--error-foreground
Danger--destructive
Danger text--destructive-foreground
Borders & focus

Structure and keyboard focus; translucent values keep their alpha.

4
Role / token Light Dark
Boundary--border
Input edge--input
Focus ring--ring
Focus outline--outline
Charts & data

Five ordered series colors. Keep labels or patterns alongside color.

5
Role / token Light Dark
Series 1--chart-1
Series 2--chart-2
Series 3--chart-3
Series 4--chart-4
Series 5--chart-5
Sidebar & navigation

A complete local palette for navigation surfaces and selection.

8
Role / token Light Dark
Sidebar surface--sidebar-background
Sidebar text--sidebar-foreground
Sidebar primary--sidebar-primary
Sidebar primary text--sidebar-primary-foreground
Sidebar selection--sidebar-accent
Sidebar selected text--sidebar-accent-foreground
Sidebar boundary--sidebar-border
Sidebar focus--sidebar-outline

Each appearance is isolated from the page theme. Equal swatches can still have different roles. bg-sidebar maps to --sidebar-background; ring-sidebar-ring maps to --sidebar-outline. Optional source shades stay separate from the reusable semantic roles; Watson's source shades are the same in both appearances. Variable copies include a fallback for optional shades.

The palette in context

One layout, two appearances. Compare the action, the surface and the space between them.

Token guide
Light appearance3 composition studies

Workspace

Action card

Feature

Dark appearance3 composition studies

Workspace

Action card

Feature

Put the Palette to Work

Edit a release, check its states, then switch appearances. Only this workspace changes.

Release studioOcean · Local experiment
Inspect a state
Next releaseDraft
Before it goes live
Five colors, one visual rhythmChart roles stay separate from action and feedback colors.

A calmer place to bring work together. Trace these roles back to the tokens

Typography

Make room for good ideas.

Clear text. A little contrast.

const theme = { color, type, radius }

Body
Application / system
Display
Application / system
Mono
Application / system mono
Font setup & usage

Samples use native fonts; named stacks above need their font files in your app. Ocean changes color and shape without prescribing a font stack. A restrained sans works well with the softer corners; keep mono for identifiers and source.

Shape & rhythm 0.75rem

smlgxl

One corner family, from compact controls to larger panels.

Notes on shape

The softest base radius in this set. Repeat it deliberately; a few clearly separated cards usually explain depth better than many rounded boxes inside one another.

Design notes & practical checks

Ocean pairs cyan primary actions with indigo secondary actions, slate text and pale cyan cards. The two accent families distinguish the main action from its companion without coloring every surface. Its 0.75rem radius gives cards and controls a slightly softer outline than the other presets.

In light & dark

Dark mode uses a deep slate page and card surfaces, with brighter cyan and indigo accents. Sky-tinted selection surfaces and cyan outlines keep the cool identity visible beyond the main button.

Put it to work

Use it for workspaces, account settings and dashboards that benefit from two clear action roles. Keep indigo for supporting actions, and let slate surfaces carry long reading sessions.

Small choices, big difference

  1. Keep cyan and indigo in different roles

    Cyan can lead the task and indigo can support it. Keep that assignment stable across the flow; switching their meaning from screen to screen makes two useful accents harder to learn.

    --primary--secondary
  2. Let slate carry the reading

    Use the quieter page and muted text for longer explanations. A pale card or a narrow selected surface can provide enough color without tinting the entire workspace.

    --background--muted-foreground

Try a real task

Give two actions different jobs

Pair a cyan Save action with an indigo supporting action. Keep the same assignment in the following confirmation panel.

Primary and supporting actions keep their meaning in both appearances.

Before you ship

Cyan is also present in informational feedback. Retain labels and icons so a primary action and an information message are distinguishable by purpose, not hue alone.

Try Ocean in your app

TSX · Local scope

Inside a component’s return, scope this palette to a small region. Keep your full theme stylesheet at the app entry. Change light to dark for the other appearance; this wrapper does not save a page preference.

ThemeRegion.tsx8 lines
<section data-theme-scope="" data-theme="ocean" class="light">
  <div class="rounded-lg border border-border bg-card p-4 text-card-foreground">
    <h2 class="font-semibold">A calmer place to bring work together.</h2>
    <p class="mt-2 text-sm text-muted-foreground">
      One shared palette, applied through component roles.
    </p>
  </div>
</section>

Rose action · Amber warmth

Sunsetsunset

Keep the welcome warm and the next step obvious.

  • Onboarding
  • Creative tools
  • Welcoming flows

Core Colors·The palette at a glance

Eight roles that set the tone. Explore a swatch, copy a value, then keep its matching text color with it.

Hover or focus for the role, pairing and source.
Available in browser
Available in browser
Available in browser
Available in browser
Available in browser
Available in browser
Available in browser
Available in browser

The variable follows your app's appearance; fixed HEX and RGB values do not. Those exports are 8-bit sRGB conversions, with alpha preserved. Resolved CSS keeps the browser's color space.

Every Color·Light and dark, side by side

All 43 semantic colors, including text, focus and feedback. Choose a color below to inspect and copy it.

43 / 43 colors
Surfaces & reading

Canvas, layers and the text that belongs on each one.

8
Role / token Light Dark
Canvas--background
Page text--foreground
Surface--card
Surface text--card-foreground
Floating surface--popover
Floating text--popover-foreground
Quiet surface--muted
Quiet text--muted-foreground
Brand & interaction

Primary intent, supporting actions and quieter selected states.

8
Role / token Light Dark
Primary--primary
Primary / Light--primary
CSS variablevar(--primary)
Resolved CSSAvailable in browser
HEX · sRGB exportAvailable in your browser

The strongest action in the current flow. It can be near-black, white or a saturated hue; it describes importance rather than a fixed brand color.

Read source declaration
Primary text--primary-foreground
Primary emphasis--primary-accent
Secondary--secondary
Secondary text--secondary-foreground
Secondary emphasis--secondary-accent
Selection surface--accent
Selection text--accent-foreground
Feedback & status

Meaningful messages, always paired with words or icons.

10
Role / token Light Dark
Information--info
Information text--info-foreground
Success--success
Success text--success-foreground
Warning--warning
Warning text--warning-foreground
Error--error
Error text--error-foreground
Danger--destructive
Danger text--destructive-foreground
Borders & focus

Structure and keyboard focus; translucent values keep their alpha.

4
Role / token Light Dark
Boundary--border
Input edge--input
Focus ring--ring
Focus outline--outline
Charts & data

Five ordered series colors. Keep labels or patterns alongside color.

5
Role / token Light Dark
Series 1--chart-1
Series 2--chart-2
Series 3--chart-3
Series 4--chart-4
Series 5--chart-5
Sidebar & navigation

A complete local palette for navigation surfaces and selection.

8
Role / token Light Dark
Sidebar surface--sidebar-background
Sidebar text--sidebar-foreground
Sidebar primary--sidebar-primary
Sidebar primary text--sidebar-primary-foreground
Sidebar selection--sidebar-accent
Sidebar selected text--sidebar-accent-foreground
Sidebar boundary--sidebar-border
Sidebar focus--sidebar-outline

Each appearance is isolated from the page theme. Equal swatches can still have different roles. bg-sidebar maps to --sidebar-background; ring-sidebar-ring maps to --sidebar-outline. Optional source shades stay separate from the reusable semantic roles; Watson's source shades are the same in both appearances. Variable copies include a fallback for optional shades.

The palette in context

One layout, two appearances. Compare the action, the surface and the space between them.

Token guide
Light appearance3 composition studies

Workspace

Action card

Feature

Dark appearance3 composition studies

Workspace

Action card

Feature

Put the Palette to Work

Edit a release, check its states, then switch appearances. Only this workspace changes.

Release studioSunset · Local experiment
Inspect a state
Next releaseDraft
Before it goes live
Five colors, one visual rhythmChart roles stay separate from action and feedback colors.

A warm start for something worth making. Trace these roles back to the tokens

Typography

Make room for good ideas.

Clear text. A little contrast.

const theme = { color, type, radius }

Body
Application / system
Display
Application / system
Mono
Application / system mono
Font setup & usage

Samples use native fonts; named stacks above need their font files in your app. Use a clear text face to balance the expressive colors. Avoid adding decorative typography to every small label; a strong heading and calm body copy already create contrast.

Shape & rhythm 0.5rem

smlgxl

One corner family, from compact controls to larger panels.

Notes on shape

Warm color meets a relatively compact shape. Keeping the corners consistent helps a colorful onboarding flow still feel organized and dependable.

Design notes & practical checks

Sunset places rose primary actions and orange secondary actions on warm orange and amber surfaces, with stone text. Its pink primary accent and amber secondary accent extend that warmth into interaction states.

In light & dark

Dark mode switches to stone surfaces and orange-white text, while rose and orange actions become lighter. The background becomes quieter rather than remaining a bright orange sheet. Violet information and lime success colors offer useful separation from the warm brand accents.

Put it to work

Consider it for creative tools, welcoming onboarding and content with a warmer tone. Reserve the boldest rose fill for a clear next step rather than surrounding every paragraph with color.

Small choices, big difference

  1. Use warmth around the action

    Let the orange and amber surfaces set the tone while the rose action gives the reader a destination. Small warm details usually do more than a full-strength colored container.

    --card--primary
  2. Keep brand and feedback separate

    Rose can be both an action color and part of an error treatment. Add a clear message and a meaningful icon to an error; a familiar brand hue alone should never carry that distinction.

    --error--error-foreground

Try a real task

Welcome someone through a real form

Build a short welcome form with one rose Continue action. Use warm supporting surfaces and show an explicit validation message.

An error reads as feedback rather than another brand-colored action.

Before you ship

Rose also appears in error feedback. Use explicit error wording and a meaningful icon so an error cannot be confused with an ordinary brand-colored action.

Try Sunset in your app

TSX · Local scope

Inside a component’s return, scope this palette to a small region. Keep your full theme stylesheet at the app entry. Change light to dark for the other appearance; this wrapper does not save a page preference.

ThemeRegion.tsx8 lines
<section data-theme-scope="" data-theme="sunset" class="light">
  <div class="rounded-lg border border-border bg-card p-4 text-card-foreground">
    <h2 class="font-semibold">A warm start for something worth making.</h2>
    <p class="mt-2 text-sm text-muted-foreground">
      One shared palette, applied through component roles.
    </p>
  </div>
</section>

Warm paper · Orange emphasis

Cursor Warmcursor-warm

Leave some paper around the ink.

  • Editors
  • Project spaces
  • Long-form content

Core Colors·The palette at a glance

Eight roles that set the tone. Explore a swatch, copy a value, then keep its matching text color with it.

Hover or focus for the role, pairing and source.
Available in browser
Available in browser
Available in browser
Available in browser
Available in browser
Available in browser
Available in browser
Available in browser

The variable follows your app's appearance; fixed HEX and RGB values do not. Those exports are 8-bit sRGB conversions, with alpha preserved. Resolved CSS keeps the browser's color space.

Every Color·Light and dark, side by side

All 43 semantic colors and 13 optional source shades, including text, focus and feedback. Choose a color below to inspect and copy it.

56 / 56 colors
Surfaces & reading

Canvas, layers and the text that belongs on each one.

8
Role / token Light Dark
Canvas--background
Page text--foreground
Surface--card
Surface text--card-foreground
Floating surface--popover
Floating text--popover-foreground
Quiet surface--muted
Quiet text--muted-foreground
Brand & interaction

Primary intent, supporting actions and quieter selected states.

8
Role / token Light Dark
Primary--primary
Primary / Light--primary
CSS variablevar(--primary)
Resolved CSSAvailable in browser
HEX · sRGB exportAvailable in your browser

The strongest action in the current flow. It can be near-black, white or a saturated hue; it describes importance rather than a fixed brand color.

Read source declaration
Primary text--primary-foreground
Primary emphasis--primary-accent
Secondary--secondary
Secondary text--secondary-foreground
Secondary emphasis--secondary-accent
Selection surface--accent
Selection text--accent-foreground
Feedback & status

Meaningful messages, always paired with words or icons.

10
Role / token Light Dark
Information--info
Information text--info-foreground
Success--success
Success text--success-foreground
Warning--warning
Warning text--warning-foreground
Error--error
Error text--error-foreground
Danger--destructive
Danger text--destructive-foreground
Borders & focus

Structure and keyboard focus; translucent values keep their alpha.

4
Role / token Light Dark
Boundary--border
Input edge--input
Focus ring--ring
Focus outline--outline
Charts & data

Five ordered series colors. Keep labels or patterns alongside color.

5
Role / token Light Dark
Series 1--chart-1
Series 2--chart-2
Series 3--chart-3
Series 4--chart-4
Series 5--chart-5
Sidebar & navigation

A complete local palette for navigation surfaces and selection.

8
Role / token Light Dark
Sidebar surface--sidebar-background
Sidebar text--sidebar-foreground
Sidebar primary--sidebar-primary
Sidebar primary text--sidebar-primary-foreground
Sidebar selection--sidebar-accent
Sidebar selected text--sidebar-accent-foreground
Sidebar boundary--sidebar-border
Sidebar focus--sidebar-outline
Preset source colors

Additional named shades supplied by this preset. Components use the semantic roles above.

13
Role / token Light Dark
surface 100--cursor-surface-100
surface 200--cursor-surface-200
surface 300--cursor-surface-300
surface 400--cursor-surface-400
surface 500--cursor-surface-500
ai thinking--cursor-ai-thinking
ai grep--cursor-ai-grep
ai read--cursor-ai-read
ai edit--cursor-ai-edit
text secondary--cursor-text-secondary
text tertiary--cursor-text-tertiary
border medium--cursor-border-medium
border strong--cursor-border-strong

Each appearance is isolated from the page theme. Equal swatches can still have different roles. bg-sidebar maps to --sidebar-background; ring-sidebar-ring maps to --sidebar-outline. Optional source shades stay separate from the reusable semantic roles; Watson's source shades are the same in both appearances. Variable copies include a fallback for optional shades.

The palette in context

One layout, two appearances. Compare the action, the surface and the space between them.

Token guide
Light appearance3 composition studies

Workspace

Action card

Feature

Dark appearance3 composition studies

Workspace

Action card

Feature

Put the Palette to Work

Edit a release, check its states, then switch appearances. Only this workspace changes.

Release studioCursor warm · Local experiment
Inspect a state
Next releaseDraft
Before it goes live
Five colors, one visual rhythmChart roles stay separate from action and feedback colors.

Good ideas deserve a little breathing room. Trace these roles back to the tokens

Typography

Make room for good ideas.

Clear text. A little contrast.

const theme = { color, type, radius }

Body
Lato
Display
Lato
Mono
System mono
Font setup & usage

Samples use native fonts; named stacks above need their font files in your app. The preset also declares Source Serif 4 as a serif option. Use it for a deliberate editorial passage if you load it, while keeping controls and long utility labels in the sans stack.

Shape & rhythm 0.5rem

smlgxl

One corner family, from compact controls to larger panels.

Notes on shape

Quiet corners and thin warm boundaries suit text-led work. Keep shadows light and use the card/page relationship to do most of the layering.

Design notes & practical checks

Cursor Warm combines cream page surfaces, white cards, warm dark text and a saturated orange primary action. Its secondary surface is a quiet cream-gray; the secondary accent is rose. This is a palette where a secondary action can be deliberately restrained instead of becoming another bright button.

In light & dark

Dark mode moves to warm charcoal and preserves the orange identity, with lighter text and a brighter primary accent. Thin translucent borders separate surfaces without introducing a cool gray cast.

Put it to work

Use it for text-focused tools, editorial interfaces and project workspaces. Leave room for the warm page color to show between white cards; the orange action can then stand out with little extra decoration.

Small choices, big difference

  1. Use the page as part of the composition

    Leave visible cream space between white cards. It creates a quiet depth cue without requiring a shadow on every block, and gives longer text a less clinical setting.

    --background--card
  2. Keep orange precious

    Use orange for the next meaningful action, then let cream-gray support secondary controls. A restrained secondary action can be easier to understand than a second equally vivid button.

    --primary--secondary

Try a real task

Turn a note into a small editor

Place a white editing card on the warm page. Reserve orange for Save, with a quieter control for returning to the list.

Long text stays comfortable and the next action is easy to locate.

Before you ship

Treat the cream secondary token as a surface, not a text color. Check long secondary descriptions and orange-filled controls at their actual font sizes, especially when reducing density.

Try Cursor warm in your app

TSX · Local scope

Inside a component’s return, scope this palette to a small region. Keep your full theme stylesheet at the app entry. Change light to dark for the other appearance; this wrapper does not save a page preference.

ThemeRegion.tsx8 lines
<section data-theme-scope="" data-theme="cursor-warm" class="light">
  <div class="rounded-lg border border-border bg-card p-4 text-card-foreground">
    <h2 class="font-semibold">Good ideas deserve a little breathing room.</h2>
    <p class="mt-2 text-sm text-muted-foreground">
      One shared palette, applied through component roles.
    </p>
  </div>
</section>

Emerald signal · Deep charcoal

Voltagevoltage

Make the signal count.

  • Automation
  • Technical consoles
  • Operations

Core Colors·The palette at a glance

Eight roles that set the tone. Explore a swatch, copy a value, then keep its matching text color with it.

Hover or focus for the role, pairing and source.
Available in browser
Available in browser
Available in browser
Available in browser
Available in browser
Available in browser
Available in browser
Available in browser

The variable follows your app's appearance; fixed HEX and RGB values do not. Those exports are 8-bit sRGB conversions, with alpha preserved. Resolved CSS keeps the browser's color space.

Every Color·Light and dark, side by side

All 43 semantic colors, including text, focus and feedback. Choose a color below to inspect and copy it.

43 / 43 colors
Surfaces & reading

Canvas, layers and the text that belongs on each one.

8
Role / token Light Dark
Canvas--background
Page text--foreground
Surface--card
Surface text--card-foreground
Floating surface--popover
Floating text--popover-foreground
Quiet surface--muted
Quiet text--muted-foreground
Brand & interaction

Primary intent, supporting actions and quieter selected states.

8
Role / token Light Dark
Primary--primary
Primary / Light--primary
CSS variablevar(--primary)
Resolved CSSAvailable in browser
HEX · sRGB exportAvailable in your browser

The strongest action in the current flow. It can be near-black, white or a saturated hue; it describes importance rather than a fixed brand color.

Read source declaration
Primary text--primary-foreground
Primary emphasis--primary-accent
Secondary--secondary
Secondary text--secondary-foreground
Secondary emphasis--secondary-accent
Selection surface--accent
Selection text--accent-foreground
Feedback & status

Meaningful messages, always paired with words or icons.

10
Role / token Light Dark
Information--info
Information text--info-foreground
Success--success
Success text--success-foreground
Warning--warning
Warning text--warning-foreground
Error--error
Error text--error-foreground
Danger--destructive
Danger text--destructive-foreground
Borders & focus

Structure and keyboard focus; translucent values keep their alpha.

4
Role / token Light Dark
Boundary--border
Input edge--input
Focus ring--ring
Focus outline--outline
Charts & data

Five ordered series colors. Keep labels or patterns alongside color.

5
Role / token Light Dark
Series 1--chart-1
Series 2--chart-2
Series 3--chart-3
Series 4--chart-4
Series 5--chart-5
Sidebar & navigation

A complete local palette for navigation surfaces and selection.

8
Role / token Light Dark
Sidebar surface--sidebar-background
Sidebar text--sidebar-foreground
Sidebar primary--sidebar-primary
Sidebar primary text--sidebar-primary-foreground
Sidebar selection--sidebar-accent
Sidebar selected text--sidebar-accent-foreground
Sidebar boundary--sidebar-border
Sidebar focus--sidebar-outline

Each appearance is isolated from the page theme. Equal swatches can still have different roles. bg-sidebar maps to --sidebar-background; ring-sidebar-ring maps to --sidebar-outline. Optional source shades stay separate from the reusable semantic roles; Watson's source shades are the same in both appearances. Variable copies include a fallback for optional shades.

The palette in context

One layout, two appearances. Compare the action, the surface and the space between them.

Token guide
Light appearance3 composition studies

Workspace

Action card

Feature

Dark appearance3 composition studies

Workspace

Action card

Feature

Put the Palette to Work

Edit a release, check its states, then switch appearances. Only this workspace changes.

Release studioVoltage · Local experiment
Inspect a state
Next releaseDraft
Before it goes live
Five colors, one visual rhythmChart roles stay separate from action and feedback colors.

A clear signal for your next move. Trace these roles back to the tokens

Typography

Make room for good ideas.

Clear text. A little contrast.

const theme = { color, type, radius }

Body
Inter / Inter Variable
Display
System sans
Mono
System mono
Font setup & usage

Samples use native fonts; named stacks above need their font files in your app. The body stack and display stack are intentionally separate. Keep operational data and identifiers in a stable mono rhythm, with enough line height for scanning.

Shape & rhythm 0.5rem

smlgxl

One corner family, from compact controls to larger panels.

Notes on shape

Direct geometry supports dense operational screens. Use spacing and charcoal surface steps to separate regions before adding heavy outlines.

Design notes & practical checks

Voltage combines emerald primary actions, a lavender-tinted secondary surface and warm neutral borders. Its light scheme uses paper-like backgrounds and white cards. The secondary accent is a stronger indigo than the secondary surface, illustrating why an accent token and a filled surface are not interchangeable.

In light & dark

The dark scheme is the more dramatic study: an almost-black page, charcoal cards and a bright emerald action with dark text. The secondary surface remains a restrained indigo tint.

Put it to work

Use it for technical consoles, automation tools and dense operational workspaces. Let the bright emerald action identify the task to run or confirm; keep supporting information on quieter surfaces.

Small choices, big difference

  1. Reserve emerald for a decision

    One strong run, confirm or connect action can anchor a dense tool. Keep supporting settings neutral so the signal stays useful rather than becoming a permanent visual alarm.

    --primary--secondary
  2. Describe the state in words

    Green branding does not mean a task has completed successfully. Give running, ready and successful states distinct labels, and review their icons alongside the primary action.

    --success--muted-foreground

Try a real task

Run a task and explain the result

Use emerald for Run, then display pending, completed and failed results with clear words and icons alongside the action.

The green brand action never implies that a task has already succeeded.

Before you ship

The primary hue and success feedback are both green. A successful result needs a readable status label, and the brand action should not imply that an operation has already succeeded.

Try Voltage in your app

TSX · Local scope

Inside a component’s return, scope this palette to a small region. Keep your full theme stylesheet at the app entry. Change light to dark for the other appearance; this wrapper does not save a page preference.

ThemeRegion.tsx8 lines
<section data-theme-scope="" data-theme="voltage" class="light">
  <div class="rounded-lg border border-border bg-card p-4 text-card-foreground">
    <h2 class="font-semibold">A clear signal for your next move.</h2>
    <p class="mt-2 text-sm text-muted-foreground">
      One shared palette, applied through component roles.
    </p>
  </div>
</section>

Pink action · Graphite control

Watsonwatson

Loud where it acts, calm where it reads.

  • News
  • Community
  • Editorial tools

Core Colors·The palette at a glance

Eight roles that set the tone. Explore a swatch, copy a value, then keep its matching text color with it.

Hover or focus for the role, pairing and source.
Available in browser
Available in browser
Available in browser
Available in browser
Available in browser
Available in browser
Available in browser
Available in browser

The variable follows your app's appearance; fixed HEX and RGB values do not. Those exports are 8-bit sRGB conversions, with alpha preserved. Resolved CSS keeps the browser's color space.

Every Color·Light and dark, side by side

All 43 semantic colors and 76 optional source shades, including text, focus and feedback. Choose a color below to inspect and copy it.

119 / 119 colors
Surfaces & reading

Canvas, layers and the text that belongs on each one.

8
Role / token Light Dark
Canvas--background
Page text--foreground
Surface--card
Surface text--card-foreground
Floating surface--popover
Floating text--popover-foreground
Quiet surface--muted
Quiet text--muted-foreground
Brand & interaction

Primary intent, supporting actions and quieter selected states.

8
Role / token Light Dark
Primary--primary
Primary / Light--primary
CSS variablevar(--primary)
Resolved CSSAvailable in browser
HEX · sRGB exportAvailable in your browser

The strongest action in the current flow. It can be near-black, white or a saturated hue; it describes importance rather than a fixed brand color.

Read source declaration
Primary text--primary-foreground
Primary emphasis--primary-accent
Secondary--secondary
Secondary text--secondary-foreground
Secondary emphasis--secondary-accent
Selection surface--accent
Selection text--accent-foreground
Feedback & status

Meaningful messages, always paired with words or icons.

10
Role / token Light Dark
Information--info
Information text--info-foreground
Success--success
Success text--success-foreground
Warning--warning
Warning text--warning-foreground
Error--error
Error text--error-foreground
Danger--destructive
Danger text--destructive-foreground
Borders & focus

Structure and keyboard focus; translucent values keep their alpha.

4
Role / token Light Dark
Boundary--border
Input edge--input
Focus ring--ring
Focus outline--outline
Charts & data

Five ordered series colors. Keep labels or patterns alongside color.

5
Role / token Light Dark
Series 1--chart-1
Series 2--chart-2
Series 3--chart-3
Series 4--chart-4
Series 5--chart-5
Sidebar & navigation

A complete local palette for navigation surfaces and selection.

8
Role / token Light Dark
Sidebar surface--sidebar-background
Sidebar text--sidebar-foreground
Sidebar primary--sidebar-primary
Sidebar primary text--sidebar-primary-foreground
Sidebar selection--sidebar-accent
Sidebar selected text--sidebar-accent-foreground
Sidebar boundary--sidebar-border
Sidebar focus--sidebar-outline
Preset source colors

Additional named shades supplied by this preset. Components use the semantic roles above.

76
Role / token Light Dark
watson pink 100--color-watson_pink-100
watson pink 70--color-watson_pink-70
watson pink 50--color-watson_pink-50
watson pink 20--color-watson_pink-20
watson blue 100--color-watson_blue-100
watson blue 70--color-watson_blue-70
watson blue 50--color-watson_blue-50
watson blue 20--color-watson_blue-20
watson base--color-watson_base
watson base hover--color-watson_base_hover
watson black--color-watson_black
watson red--color-watson_red
watson divider dark--color-watson_divider-dark
watson divider menu dark--color-watson_divider-menu-dark
black 100--color-black-100
black 90--color-black-90
black 80--color-black-80
black 70--color-black-70
grey 100--color-grey-100
grey 80--color-grey-80
grey 50--color-grey-50
grey 20--color-grey-20
grey 10--color-grey-10
graphite 100--color-graphite-100
graphite 80--color-graphite-80
graphite 50--color-graphite-50
graphite 20--color-graphite-20
white 100--color-white-100
transparent--color-transparent
mauve 100--color-mauve-100
mauve 70--color-mauve-70
mauve 50--color-mauve-50
mauve 20--color-mauve-20
candy 100--color-candy-100
candy 70--color-candy-70
candy 50--color-candy-50
candy 20--color-candy-20
aubergine 100--color-aubergine-100
aubergine 70--color-aubergine-70
aubergine 50--color-aubergine-50
aubergine 20--color-aubergine-20
lavender 100--color-lavender-100
lavender 70--color-lavender-70
lavender 50--color-lavender-50
lavender 20--color-lavender-20
tangerine 100--color-tangerine-100
tangerine 70--color-tangerine-70
tangerine 50--color-tangerine-50
tangerine 20--color-tangerine-20
lemon 100--color-lemon-100
lemon 70--color-lemon-70
lemon 50--color-lemon-50
lemon 20--color-lemon-20
lapis 100--color-lapis-100
lapis 70--color-lapis-70
lapis 50--color-lapis-50
lapis 20--color-lapis-20
jade 100--color-jade-100
jade 70--color-jade-70
jade 50--color-jade-50
jade 20--color-jade-20
mint 100--color-mint-100
mint 70--color-mint-70
mint 50--color-mint-50
mint 20--color-mint-20
accent text--watson-accent-text
surface--watson-surface
surface active--watson-surface-active
surface control--watson-surface-control
on control--watson-on-control
divider--watson-divider
divider menu--watson-divider-menu
text label--watson-text-label
text placeholder--watson-text-placeholder
focus ring--watson-focus-ring
overlay--watson-overlay

Each appearance is isolated from the page theme. Equal swatches can still have different roles. bg-sidebar maps to --sidebar-background; ring-sidebar-ring maps to --sidebar-outline. Optional source shades stay separate from the reusable semantic roles; Watson's source shades are the same in both appearances. Variable copies include a fallback for optional shades.

The palette in context

One layout, two appearances. Compare the action, the surface and the space between them.

Token guide
Light appearance3 composition studies

Workspace

Action card

Feature

Dark appearance3 composition studies

Workspace

Action card

Feature

Put the Palette to Work

Edit a release, check its states, then switch appearances. Only this workspace changes.

Release studioWatson · Local experiment
Inspect a state
Next releaseDraft
Before it goes live
Five colors, one visual rhythmChart roles stay separate from action and feedback colors.

A shared space with a little personality. Trace these roles back to the tokens

Typography

Make room for good ideas.

Clear text. A little contrast.

const theme = { color, type, radius }

Body
Nunito Sans
Display
Onest
Mono
Fira Code / Fira Code Variable
Font setup & usage

Samples use native fonts; named stacks above need their font files in your app. Running text in Nunito Sans Medium, labels SemiBold, buttons Bold 16. Titles in Onest Black. Load both faces with @kamod-ch/themes/brands/watson-fonts.css.

Shape & rhythm 6px

smlgxl

One corner family, from compact controls to larger panels.

Notes on shape

4px corners on buttons, fields and tags, 10px on cards, menus and dialogs, fully round icon buttons and avatars. No shadows: surfaces and dividers separate the layers.

Design notes & practical checks

watson pairs a saturated pink primary action with a graphite secondary, light grey field and card surfaces and black text. Hover and pressed states turn aubergine. The extended palette offers further brand shades, but the components still consume the same semantic roles.

In light & dark

Dark mode uses near-black and charcoal surfaces, keeps the pink action with white text and switches the focus ring to cyan. Mint, lemon and light blue fills carry feedback, always with black text; error red also takes black text.

Put it to work

Use it for news, community and editorial products. Let the pink action lead, keep tags and switches graphite, and give titles the Onest display face.

Small choices, big difference

  1. Pink acts, graphite supports

    The pink fill marks the action and turns aubergine on hover. Tags, switch tracks and secondary actions use graphite with white text so they never compete with the action.

    --primary--secondary
  2. Fields and cards sit on light grey

    Inputs, cards and menus share the grey surface; the focused field darkens one step. Selection and errors still need their own cue: a pink bar, a red edge or a word.

    --muted--accent

Try a real task

Invite readers into the conversation

Build a comment form with a grey field, a pink Send action and a graphite tag. Show the focused, invalid and disabled states side by side.

The pink action keeps a 16px bold label, and the invalid field shows its red edge and a message.

Before you ship

White on pink only reaches 3.9:1, so the button label stays 16px bold and pink text on white turns aubergine. Check focus, error bars and placeholders in both appearances, and load the watson fonts only when the app uses them.

Try Watson in your app

TSX · Local scope

Inside a component’s return, scope this palette to a small region. Keep your full theme stylesheet at the app entry. Change light to dark for the other appearance; this wrapper does not save a page preference.

ThemeRegion.tsx8 lines
<section data-theme-scope="" data-theme="watson" class="light">
  <div class="rounded-lg border border-border bg-card p-4 text-card-foreground">
    <h2 class="font-semibold">A shared space with a little personality.</h2>
    <p class="mt-2 text-sm text-muted-foreground">
      One shared palette, applied through component roles.
    </p>
  </div>
</section>

Yellow landmark · Black structure

Professional (Electronics)professional

Create a landmark, not a yellow page.

  • Commerce
  • Product catalogs
  • Administration

Core Colors·The palette at a glance

Eight roles that set the tone. Explore a swatch, copy a value, then keep its matching text color with it.

Hover or focus for the role, pairing and source.
Available in browser
Available in browser
Available in browser
Available in browser
Available in browser
Available in browser
Available in browser
Available in browser

The variable follows your app's appearance; fixed HEX and RGB values do not. Those exports are 8-bit sRGB conversions, with alpha preserved. Resolved CSS keeps the browser's color space.

Every Color·Light and dark, side by side

All 43 semantic colors, including text, focus and feedback. Choose a color below to inspect and copy it.

43 / 43 colors
Surfaces & reading

Canvas, layers and the text that belongs on each one.

8
Role / token Light Dark
Canvas--background
Page text--foreground
Surface--card
Surface text--card-foreground
Floating surface--popover
Floating text--popover-foreground
Quiet surface--muted
Quiet text--muted-foreground
Brand & interaction

Primary intent, supporting actions and quieter selected states.

8
Role / token Light Dark
Primary--primary
Primary / Light--primary
CSS variablevar(--primary)
Resolved CSSAvailable in browser
HEX · sRGB exportAvailable in your browser

The strongest action in the current flow. It can be near-black, white or a saturated hue; it describes importance rather than a fixed brand color.

Read source declaration
Primary text--primary-foreground
Primary emphasis--primary-accent
Secondary--secondary
Secondary text--secondary-foreground
Secondary emphasis--secondary-accent
Selection surface--accent
Selection text--accent-foreground
Feedback & status

Meaningful messages, always paired with words or icons.

10
Role / token Light Dark
Information--info
Information text--info-foreground
Success--success
Success text--success-foreground
Warning--warning
Warning text--warning-foreground
Error--error
Error text--error-foreground
Danger--destructive
Danger text--destructive-foreground
Borders & focus

Structure and keyboard focus; translucent values keep their alpha.

4
Role / token Light Dark
Boundary--border
Input edge--input
Focus ring--ring
Focus outline--outline
Charts & data

Five ordered series colors. Keep labels or patterns alongside color.

5
Role / token Light Dark
Series 1--chart-1
Series 2--chart-2
Series 3--chart-3
Series 4--chart-4
Series 5--chart-5
Sidebar & navigation

A complete local palette for navigation surfaces and selection.

8
Role / token Light Dark
Sidebar surface--sidebar-background
Sidebar text--sidebar-foreground
Sidebar primary--sidebar-primary
Sidebar primary text--sidebar-primary-foreground
Sidebar selection--sidebar-accent
Sidebar selected text--sidebar-accent-foreground
Sidebar boundary--sidebar-border
Sidebar focus--sidebar-outline

Each appearance is isolated from the page theme. Equal swatches can still have different roles. bg-sidebar maps to --sidebar-background; ring-sidebar-ring maps to --sidebar-outline. Optional source shades stay separate from the reusable semantic roles; Watson's source shades are the same in both appearances. Variable copies include a fallback for optional shades.

The palette in context

One layout, two appearances. Compare the action, the surface and the space between them.

Token guide
Light appearance3 composition studies

Workspace

Action card

Feature

Dark appearance3 composition studies

Workspace

Action card

Feature

Put the Palette to Work

Edit a release, check its states, then switch appearances. Only this workspace changes.

Release studioProfessional (Electronics) · Local experiment
Inspect a state
Next releaseDraft
Before it goes live
Five colors, one visual rhythmChart roles stay separate from action and feedback colors.

One clear choice. Everything else in its place. Trace these roles back to the tokens

Typography

Make room for good ideas.

Clear text. A little contrast.

const theme = { color, type, radius }

Body
Poppins
Display
Poppins
Mono
IBM Plex Mono
Font setup & usage

Samples use native fonts; named stacks above need their font files in your app. A geometric sans and a distinct mono can separate product information from identifiers or specifications. Keep long descriptions regular in weight instead of making the whole catalog bold.

Shape & rhythm 0.5rem

smlgxl

One corner family, from compact controls to larger panels.

Notes on shape

Compact corners suit catalogs, purchase flows and administration. Prefer clear section boundaries and aligned rows to decorative frames around each specification.

Design notes & practical checks

Professional uses a vivid yellow primary action with black text, a black secondary action with white text and neutral gray surfaces. The filled action makes yellow a landmark rather than a background for the entire application.

In light & dark

Dark mode retains the yellow primary action, places content on deep blue-gray surfaces and turns the secondary action light. The text pairing changes with the surface: dark text on yellow stays deliberate rather than following the page’s light text automatically.

Put it to work

Use it for commerce, catalogs and administrative tools that need a strong confirmation or purchase action. Keep supporting controls neutral so a single yellow action can lead the flow.

Small choices, big difference

  1. Pair the yellow with its intended ink

    The primary fill uses black foreground; it is not a small-text accent for a white background. Keep the surface and foreground together when building a custom call to action.

    --primary--primary-foreground
  2. Let neutral controls support the landmark

    A black or light secondary action gives the primary action room to lead. Use yellow sparingly in navigation and distinguish warning messages through their own label and feedback role.

    --secondary--warning

Try a real task

Make a purchase decision unmistakable

Build a product summary with one yellow confirmation action and its dark foreground. Keep comparison and cancellation neutral.

The confirmation and any warning have separate wording and visual roles.

Before you ship

Do not reuse yellow as small text on white just because it works as a filled button. Check the primary foreground pairing and distinguish warning feedback with words and icons.

Try Professional (Electronics) in your app

TSX · Local scope

Inside a component’s return, scope this palette to a small region. Keep your full theme stylesheet at the app entry. Change light to dark for the other appearance; this wrapper does not save a page preference.

ThemeRegion.tsx8 lines
<section data-theme-scope="" data-theme="professional" class="light">
  <div class="rounded-lg border border-border bg-card p-4 text-card-foreground">
    <h2 class="font-semibold">One clear choice. Everything else in its place.</h2>
    <p class="mt-2 text-sm text-muted-foreground">
      One shared palette, applied through component roles.
    </p>
  </div>
</section>

Electric blue · News clarity

20 Minuten20min

Let the headline lead and the blue decide.

  • News
  • Content feeds
  • Media apps

Core Colors·The palette at a glance

Eight roles that set the tone. Explore a swatch, copy a value, then keep its matching text color with it.

Hover or focus for the role, pairing and source.
Available in browser
Available in browser
Available in browser
Available in browser
Available in browser
Available in browser
Available in browser
Available in browser

The variable follows your app's appearance; fixed HEX and RGB values do not. Those exports are 8-bit sRGB conversions, with alpha preserved. Resolved CSS keeps the browser's color space.

Every Color·Light and dark, side by side

All 43 semantic colors and 29 optional source shades, including text, focus and feedback. Choose a color below to inspect and copy it.

72 / 72 colors
Surfaces & reading

Canvas, layers and the text that belongs on each one.

8
Role / token Light Dark
Canvas--background
Page text--foreground
Surface--card
Surface text--card-foreground
Floating surface--popover
Floating text--popover-foreground
Quiet surface--muted
Quiet text--muted-foreground
Brand & interaction

Primary intent, supporting actions and quieter selected states.

8
Role / token Light Dark
Primary--primary
Primary / Light--primary
CSS variablevar(--primary)
Resolved CSSAvailable in browser
HEX · sRGB exportAvailable in your browser

The strongest action in the current flow. It can be near-black, white or a saturated hue; it describes importance rather than a fixed brand color.

Read source declaration
Primary text--primary-foreground
Primary emphasis--primary-accent
Secondary--secondary
Secondary text--secondary-foreground
Secondary emphasis--secondary-accent
Selection surface--accent
Selection text--accent-foreground
Feedback & status

Meaningful messages, always paired with words or icons.

10
Role / token Light Dark
Information--info
Information text--info-foreground
Success--success
Success text--success-foreground
Warning--warning
Warning text--warning-foreground
Error--error
Error text--error-foreground
Danger--destructive
Danger text--destructive-foreground
Borders & focus

Structure and keyboard focus; translucent values keep their alpha.

4
Role / token Light Dark
Boundary--border
Input edge--input
Focus ring--ring
Focus outline--outline
Charts & data

Five ordered series colors. Keep labels or patterns alongside color.

5
Role / token Light Dark
Series 1--chart-1
Series 2--chart-2
Series 3--chart-3
Series 4--chart-4
Series 5--chart-5
Sidebar & navigation

A complete local palette for navigation surfaces and selection.

8
Role / token Light Dark
Sidebar surface--sidebar-background
Sidebar text--sidebar-foreground
Sidebar primary--sidebar-primary
Sidebar primary text--sidebar-primary-foreground
Sidebar selection--sidebar-accent
Sidebar selected text--sidebar-accent-foreground
Sidebar boundary--sidebar-border
Sidebar focus--sidebar-outline
Preset source colors

Additional named shades supplied by this preset. Components use the semantic roles above.

29
Role / token Light Dark
20min electricity--color-20min-electricity
20min cyan--color-20min-cyan
20min cyan ui--color-20min-cyan-ui
20min malibu--color-20min-malibu
20min accent--color-20min-accent
20min regal--color-20min-regal
20min night--color-20min-night
20min deep--color-20min-deep
20min alice--color-20min-alice
20min lavender--color-20min-lavender
20min solitude--color-20min-solitude
20min catskill--color-20min-catskill
20min purple--color-20min-purple
20min violet--color-20min-violet
20min green--color-20min-green
20min orange--color-20min-orange
20min red--color-20min-red
20min red bright--color-20min-red-bright
20min ink--color-20min-ink
20min grey 700--color-20min-grey-700
20min grey 500--color-20min-grey-500
20min grey 400--color-20min-grey-400
20min grey 300--color-20min-grey-300
20min grey 200--color-20min-grey-200
20min grey 100--color-20min-grey-100
20min paper--color-20min-paper
20min dark bg--color-20min-dark-bg
20min dark surface--color-20min-dark-surface
20min dark raised--color-20min-dark-raised

Each appearance is isolated from the page theme. Equal swatches can still have different roles. bg-sidebar maps to --sidebar-background; ring-sidebar-ring maps to --sidebar-outline. Optional source shades stay separate from the reusable semantic roles; Watson's source shades are the same in both appearances. Variable copies include a fallback for optional shades.

The palette in context

One layout, two appearances. Compare the action, the surface and the space between them.

Token guide
Light appearance3 composition studies

Workspace

Action card

Feature

Dark appearance3 composition studies

Workspace

Action card

Feature

Put the Palette to Work

Edit a release, check its states, then switch appearances. Only this workspace changes.

Release studio20 Minuten · Local experiment
Inspect a state
Next releaseDraft
Before it goes live
Five colors, one visual rhythmChart roles stay separate from action and feedback colors.

Know what matters, in 20 minutes. Trace these roles back to the tokens

Typography

Make room for good ideas.

Clear text. A little contrast.

const theme = { color, type, radius }

Body
Matter
Display
Matter
Mono
System mono
Font setup & usage

Samples use native fonts; named stacks above need their font files in your app. One family in several weights: regular for reading, medium for labels and buttons, bold for headlines. Matter is a commercial font; without a licence the preset falls back to system fonts.

Shape & rhythm 8px

smlgxl

One corner family, from compact controls to larger panels.

Notes on shape

Small 4px corners on buttons, fields and tags; 8px on cards and images. The contrast between the two keeps controls compact and content soft.

Design notes & practical checks

20 Minuten pairs an electric blue primary action with a deep navy secondary, white reading surfaces and light grey groupings. Cyan, purple, orange and green stay in the chart and feedback roles instead of decorating the page.

In light & dark

Dark mode moves to blue-grey surfaces and switches the action colour to cyan with black text, following the live site. Cards sit one step darker than the page, popovers one step lighter.

Put it to work

Use it for news, feeds and content apps where headlines lead and a single blue action marks the next step. Keep section navigation as tabs with a clear active bar.

Small choices, big difference

  1. One blue action per view

    Electric blue marks the action and the active section. Use the navy secondary or an outline for supporting choices so the next step stays obvious.

    --primary--secondary
  2. Group with grey, not with shadows

    The site separates content with light grey surfaces, thin borders and whitespace. Keep cards flat and let spacing carry the structure.

    --muted--border

Try a real task

Build a news section with one clear next step

Combine section tabs, a teaser card with an 8px image and a blue Discover action. Add a navy secondary action and an outline Load more.

The active tab and the primary action are both blue but remain clearly different elements.

Before you ship

Blue is both the action colour and the active tab colour. Make sure links, active tabs and buttons stay distinguishable by shape, not only by hue, and load Matter only with a valid licence.

Try 20 Minuten in your app

TSX · Local scope

Inside a component’s return, scope this palette to a small region. Keep your full theme stylesheet at the app entry. Change light to dark for the other appearance; this wrapper does not save a page preference.

ThemeRegion.tsx8 lines
<section data-theme-scope="" data-theme="20min" class="light">
  <div class="rounded-lg border border-border bg-card p-4 text-card-foreground">
    <h2 class="font-semibold">Know what matters, in 20 minutes.</h2>
    <p class="mt-2 text-sm text-muted-foreground">
      One shared palette, applied through component roles.
    </p>
  </div>
</section>

A different layer of color 24 saved palettes

Prism Syntax Themes

Choose a palette

Give your source its own reading atmosphere. Compare the same TSX, CSS and JSON in every palette, inspect the actual token colors, then copy a scoped recipe. Your application theme stays yours.

Made by the Prism community

These studies credit Prism’s original themes and the Prism Themes collection. Each chapter names its author or port and links the exact source. The preview keeps upstream source colors; Kamod owns the reader’s spacing, controls and typography. Source files and MIT notices are saved with this guide—there is no live theme download.

Keep the credit. Own the integration.

Sources, Credits & Your Next Palette

A palette is more than a handful of attractive HEX values. Keep its canvas, token distinctions and provenance together, then test it with the source your readers actually use.

A small source record that travels with the colors
Original Prism themes 8 studies

Prism 1.30.0. The saved files retain their original notices, including named authors and the palettes that inspired individual ports.

Community Prism Themes 16 studies

Saved at revision 447479fc. Theme chapters identify the port author as well as the original palette author when upstream provides both.

Downloads include the applicable MIT notice. Keep that notice with distributed copies or substantial adaptations. The original stylesheet is available separately from the scoped Kamod recipe, so you can inspect exactly what changed.

Choose your integration

Already bundled? Okaidia, Tomorrow, Twilight and Solarized Light have supported syntaxTheme values. Those reader adaptations strengthen some small-text colors; the exact upstream studies above remain useful for comparison.

Another palette? Copy its scoped CSS and the matching TSX example. Its data-prism-theme wrapper keeps the colors around the intended reader. Community names are not additional built-in IDs. The stylesheet port guide explains token exceptions, source ownership and the cascade.

src/SourceReader.tsx6 lines
import { Code } from "@kamod-ch/ui/code";

// A bundled adaptation; no additional palette CSS.
export function SourceReader({ source }: { source: string }) {
  return <Code code={source} language="tsx" syntaxTheme="tomorrow" />;
}
Review the whole reading surface

Try comments, plain text, JSX attributes, CSS values and JSON properties at your real text size. Some historical source palettes have quiet comments or punctuation; copying an exact color is not an accessibility endorsement.

  • Canvas + inkKeep the source background with its intended foreground. Check selected text and unclassified source too.
  • Color + meaningKeep names, punctuation, focus and source links readable without depending on hue alone.
  • One reader at a timeScope every token rule. Importing several unscoped theme files lets them overwrite neighboring readers.

How Themes Work on This Page

Compare locally. Apply deliberately. The sketches keep their own preset and explicit light/dark appearance, even when the rest of the documentation changes. Color inspectors and playground controls stay local too. “Use theme” applies a preset to this page and saves theme-preset; it keeps your Light, Dark or System preference. A manual appearance is stored separately as theme.

Shape Your Design with Tokens

Start with the roles your interface needs, then refine a preset. Shared values should keep the page, navigation and floating surfaces consistent.

What a Theme Token Actually Is

A token names a responsibility: --card means a content surface, rather than a particular color. The chain is preset value → semantic custom property → utility → element. Changing the preset updates existing bg-card utilities without rebuilding Tailwind; introducing a new utility still requires source discovery.

Use complete color values: background: var(--primary) works with this contract; hsl(var(--primary)) assumes a channel-only format that it does not promise. For a mixed treatment, use color-mix().

Follow Inheritance and the Cascade

Tokens follow DOM ancestry. A data-theme-scope wrapper resets the full contract before its data-theme and explicit .dark class select local values. A portal outside that wrapper does not inherit its palette.

Selector specificity still applies: a later :root override can lose to :root[data-theme="ocean"]. Match the intended preset and scheme, as in the recipe below. Component-specific variables belong on the component root when its own defaults reset inherited values.

Work with Semantic Token Pairs

Change surfaces and their matching foregrounds together. Background utilities do not automatically apply a text color.

Role Surface and content Typical classes
Page --background, --foreground bg-background text-foreground
Content --card, --card-foreground bg-card text-card-foreground
Floating layer --popover, --popover-foreground bg-popover text-popover-foreground
Main emphasis --primary, --primary-foreground bg-primary text-primary-foreground
Supporting action --secondary, --secondary-foreground bg-secondary text-secondary-foreground
Quiet content --muted, --muted-foreground bg-muted text-muted-foreground
Interaction --accent, --accent-foreground bg-accent text-accent-foreground

Inspect the consumer too: the current default Button pairs bg-primary with text-background. Feedback uses success, warning, error and info roles; destructive actions use --destructive. Keep readable labels alongside color. Boundaries and focus use --border, --input, --ring and --outline.

Understand the Sidebar Token Family

Sidebar roles are separate from page roles. Kamod uses --sidebar-background and --sidebar-outline, rather than another library's --sidebar or --sidebar-ring names.

Tokens Purpose
--sidebar-background, --sidebar-foreground Navigation surface and content.
--sidebar-primary, --sidebar-primary-foreground Strong navigation emphasis.
--sidebar-accent, --sidebar-accent-foreground Supporting interaction surfaces.
--sidebar-border, --sidebar-outline Boundaries and visible keyboard focus.

The full theme maps bg-sidebar to --sidebar-background and ring-sidebar-ring to --sidebar-outline. A selected row may consume accent rather than primary; check the actual component. Menus still need the popover pair. See Block Theming for integrated navigation.

Customize a Preset with Tokens

Place a targeted refinement after your global imports, with values for both schemes:

src/product-theme.css14 lines
:root[data-theme="ocean"] {
  --primary: oklch(0.42 0.13 250);
  --primary-foreground: oklch(0.98 0.01 250);
  --sidebar-background: oklch(0.97 0.01 250);
  --sidebar-foreground: oklch(0.25 0.03 250);
  --radius: 0.5rem;
}

:root.dark[data-theme="ocean"] {
  --primary: oklch(0.8 0.1 250);
  --primary-foreground: oklch(0.2 0.03 250);
  --sidebar-background: oklch(0.2 0.02 250);
  --sidebar-foreground: oklch(0.95 0.01 250);
}

These values are a starting point, not an audited palette. Check foregrounds, focus and interaction states against real content. An arbitrary data-theme="my-brand" selector does not register a new runtime preset; extending the supported IDs is a separate API change.

Refine Radius, Typography and Motion

--radius affects derived radius utilities; fixed local CSS stays fixed. --font-sans selects a font stack, but your app must load its font assets. Check small controls, long labels and form errors after changing either.

Motion comes from component styles and any animation utilities your app uses, rather than the color palette. Preserve reduced-motion behavior. For source-only color changes, use Code's theme-token palette without changing application roles.

Manage Appearance Preferences

Static CSS works without a provider. Add runtime controls when people need a saved preset or Light, Dark and System choices.

Add Preset and Scheme Controls

Mount one ThemeProvider around components that call useTheme(). Read available palettes from presets, validate external strings with isThemePresetId, and update choices through setPreset and setScheme. The runtime examples show the complete boundary and controls.

A preset is the palette; scheme is the preference, while resolvedScheme is the resulting Light or Dark appearance. Defaults are fallbacks to saved choices. Use Theme Toggle for a compact control, or explicit choices when System should remain selectable.

Keep the First Render Consistent

Emit ThemeScript in the server-rendered document head for package defaults, or use getThemeInitScript with the same defaults as your provider. The helper returns script text: defining a variable alone does not execute it. Follow the startup examples for placement and custom defaults.

Keep browser storage reads out of server-rendered component bodies. The runtime already observes device appearance; another listener is unnecessary. Test a first visit and a reload with saved choices, since existing preferences can override new defaults.

Theme Runtime Reference

@kamod-ch/themes manages a palette (preset) and Light/Dark/System preference (scheme). It updates attributes and persists choices; theme CSS supplies colors. Runtime changes do not install styles.

ThemeProvider, useTheme, the validator and script helpers are exports. The other entries below are provider options.

APIPurpose
ThemeProviderProvides theme state and setters to its descendants.
defaultPresetFallback palette; defaults to kamod.
defaultSchemeFallback preference; defaults to system.
useTheme()Returns preset, presets, scheme, resolvedScheme, setPreset and setScheme.
isThemePresetIdValidates a string before passing it to setPreset.
storageSynchronous preference adapter; omitted means browser local storage, null skips provider storage access.
ThemeScriptEmits the default early appearance script; accepts an optional nonce.
getThemeInitScriptReturns startup script text with custom defaults.
attributeTargetElement receiving data-theme and the dark class; defaults to <html>.

Connect the Provider

Wrap the layout and appearance controls in one provider. useTheme() throws outside it. Providers share signals; separate providers do not create independent state.

src/components/ThemeBoundary.tsx10 lines
import { ThemeProvider } from "@kamod-ch/themes";
import type { ComponentChildren } from "preact";

export function ThemeBoundary({ children }: { children: ComponentChildren }) {
  return (
    <ThemeProvider defaultPreset="ocean" defaultScheme="system">
      {children}
    </ThemeProvider>
  );
}

Choose Starting Values

Defaults are fallbacks, not forced settings. A valid saved value wins; missing or invalid values use the corresponding default. Use setters for user choices rather than changing defaults as a control. Custom defaults also need a matching startup script.

Read and Change Appearance

Render these controls inside ThemeBoundary. presets supplies IDs and labels; aria-pressed identifies the selected preference. For a ready-made control, use Theme Toggle.

src/components/AppearanceControls.tsx28 lines
import { isThemePresetId, useTheme } from "@kamod-ch/themes";
import { Button } from "@kamod-ch/ui";

export function AppearanceControls() {
  const { preset, presets, setPreset, scheme, setScheme } = useTheme();
  return (
    <div class="flex flex-wrap items-center gap-2">
      <label>
        Palette
        <select value={preset} onChange={(event) => {
          const next = event.currentTarget.value;
          if (isThemePresetId(next)) setPreset(next);
        }}>
          {presets.map(({ id, label }) => <option key={id} value={id}>{label}</option>)}
        </select>
      </label>
      <div role="group" aria-label="Appearance">
        {(["light", "dark", "system"] as const).map((choice) => (
          <Button key={choice} type="button" aria-pressed={scheme === choice}
            variant={scheme === choice ? "default" : "outline"}
            onClick={() => setScheme(choice)}>
            {choice === "system" ? "System" : choice === "dark" ? "Dark" : "Light"}
          </Button>
        ))}
      </div>
    </div>
  );
}

Preference versus Visible Appearance

With System selected, scheme stays system; resolvedScheme follows the device and is light or dark. Use the former for selection and the latter for a visible-mode summary. The provider observes device changes; another matchMedia listener is unnecessary. Prefer semantic CSS tokens for component styling.

Check a Preset before Applying It

The native select returns a string; isThemePresetId narrows it to a supported ID. The example ignores invalid input. A valid ID still needs its preset CSS loaded; validation does not load a stylesheet.

Storage and Initial Appearance

Omit storage for browser local storage. Presets use theme-preset; explicit Light or Dark preferences use theme. Scheme persistence also updates a theme cookie.

System removes the stored theme value and clears that cookie. A later load therefore falls back to defaultScheme: keep it system in both provider and startup script if System should remain the natural choice. The provider validates stored values; the startup script reads local storage directly.

Skip Provider Storage Access

storage={null} skips provider storage reads and writes, but scheme-cookie updates and shared runtime state remain. It neither isolates a preview nor disables the separate startup script.

A custom adapter supplies synchronous getItem, setItem and removeItem methods. Handle adapter failures yourself. Startup helpers read browser local storage, not your adapter or cookies; custom persistence needs a matching first-render strategy.

Match the First Render

Emit an early script in the server-rendered document head, before visible content, to reduce an appearance flash. It sets root attributes; it does not replace CSS or the provider. Browser preferences are unavailable during server rendering, so keep initial markup stable across hydration instead of assuming early attributes update server-rendered hook values.

Use the Default Startup Script

For kamod / system, import ThemeScript and render <ThemeScript nonce={nonce} /> in the document head. It accepts no custom defaults. If your Content Security Policy requires a nonce, use the value generated for that response.

Match Custom Starting Values

Share app-controlled defaults between script and provider. getThemeInitScript returns text that must be emitted as a script. Do not interpolate untrusted input.

src/components/ThemeSetup.tsx15 lines
import { getThemeInitScript, ThemeProvider } from "@kamod-ch/themes";
import type { ComponentChildren } from "preact";

const defaults = { defaultPreset: "ocean", defaultScheme: "system" } as const;

// Render in the initial document head.
export function ThemeHead({ nonce }: { nonce?: string }) {
  return <script nonce={nonce} dangerouslySetInnerHTML={{
    __html: getThemeInitScript(defaults),
  }} />;
}

export function ThemeBoundary({ children }: { children: ComponentChildren }) {
  return <ThemeProvider {...defaults}>{children}</ThemeProvider>;
}

Choose the Theme Target

Omit attributeTarget for the normal <html> target. An explicit null skips attribute writes; it does not disable state or persistence. Acquire a custom HTMLElement after mounting, never through document at server module scope.

A custom target still shares runtime state. For local tokens, the full theme CSS supports a data-theme-scope wrapper with its own data-theme and dark class; an unmarked wrapper lacks that token reset. Portalled overlays outside it do not inherit its colors. See Token Overrides before using this advanced option.

CSS Entrypoints

Import @kamod-ch/themes/theme.css once for the foundation and presets. tokens.css and brands.css are pieces for an assembled stylesheet, not additional imports. Keep overrides after the theme entry; CSS setup covers Tailwind and source scanning.

Check the Result before Moving on

Change palette, reload a Dark choice, then select System and change device appearance. Check saved preferences, provider placement and startup defaults if behavior differs; see Troubleshoot and Verify.

Troubleshoot and Verify

Trace a shared failure to its source before patching individual components. Use computed styles to identify the winning variable and selector.

Diagnose Theme Problems in Order

What you see Check first
Missing styling or utilities Global CSS import, Tailwind processing and source detection.
Sidebar differs from other controls Full sidebar mappings, especially --sidebar-background.
Selection changes without new colors Loaded preset CSS and the target element's data-theme.
Unreadable dark regions Surface/foreground pairs and hard-coded light colors.
Ignored defaults or a reload flash Saved theme-preset/theme values and matching early-script defaults.
Override or font has no effect Selector specificity, import order and loaded font assets.

From Palette to Product

The palette gives your app its character. Shared roles make it hold together. Take these three decisions into the next screen you build.

01One foundation
Load the global stylesheet once. Let components, navigation and overlays share it.Keep the setup together
02Roles before individual colors
Change surfaces with their foregrounds. Refine the palette without restyling every control.Work with the tokens
03A choice that stays chosen
Keep brand and appearance separate. Match saved preferences from the first paint onward.Connect preferences

Before you ship

Tick these off in your own app.

Your theme review

0 of 3 checks reviewed.

Take the Next Useful Step

You have the pieces. Put them into one real interaction, keep its state in one place, and check the result with the content your application will actually show.

Connect the Foundation

Return to Set Up Styles and Tokens to connect this reference to a working screen. Keep global CSS in one entrypoint and import only the components that screen needs.

Build the Surrounding Screen

Find a neighboring interaction in the Component Library, or start with a complete Block. Replace sample content and destinations before refining the layout; a local class change can stay with the composition.

Make the Result Hold Up

Use shared theme roles for changes that belong everywhere. Then review the whole journey: keyboard focus, long labels, narrow screens and a clear way to recover when something fails.

Keep a link to the source and note your intentional changes. Your next edit should begin with a clear decision, not another search.