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.
pnpm add @kamod-ch/ui preact @preact/signals @kamod-ch/themesPin 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:
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:
@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.
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.
Compare real theme tokens such as --primary and --card, in both appearances. Layouts and native type stay fixed, so color relationships lead. Copy a core color, inspect every semantic role in light and dark, then try a real workflow in the local playground. Review the surface and text pairings before refining a palette.
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.
Available in browserAvailable in browserAvailable in browserAvailable in browserAvailable in browserAvailable in browserAvailable in browserAvailable in browserThe 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.
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 --primaryCSS variable var(--primary)Resolved CSS Available in browserHEX · sRGB export Available in your browserThe 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.
Workspace
Action card
Feature
Workspace
Action card
Feature
Put the Palette to Work
Edit a release, check its states, then switch appearances. Only this workspace changes.
A little room for your next idea. Trace these roles back to the tokens
Typography
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
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
- 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 - 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 actionGive 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.
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 scopeInside 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.
<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.
Available in browserAvailable in browserAvailable in browserAvailable in browserAvailable in browserAvailable in browserAvailable in browserAvailable in browserThe 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.
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 --primaryCSS variable var(--primary)Resolved CSS Available in browserHEX · sRGB export Available in your browserThe 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.
Workspace
Action card
Feature
Workspace
Action card
Feature
Put the Palette to Work
Edit a release, check its states, then switch appearances. Only this workspace changes.
Clear structure. A useful next step. Trace these roles back to the tokens
Typography
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
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
- 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 - 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 followPlace 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.
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 scopeInside 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.
<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.
Available in browserAvailable in browserAvailable in browserAvailable in browserAvailable in browserAvailable in browserAvailable in browserAvailable in browserThe 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.
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 --primaryCSS variable var(--primary)Resolved CSS Available in browserHEX · sRGB export Available in your browserThe 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.
Workspace
Action card
Feature
Workspace
Action card
Feature
Put the Palette to Work
Edit a release, check its states, then switch appearances. Only this workspace changes.
A calmer place to bring work together. Trace these roles back to the tokens
Typography
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
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
- 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 - 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 jobsPair 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.
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 scopeInside 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.
<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.
Available in browserAvailable in browserAvailable in browserAvailable in browserAvailable in browserAvailable in browserAvailable in browserAvailable in browserThe 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.
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 --primaryCSS variable var(--primary)Resolved CSS Available in browserHEX · sRGB export Available in your browserThe 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.
Workspace
Action card
Feature
Workspace
Action card
Feature
Put the Palette to Work
Edit a release, check its states, then switch appearances. Only this workspace changes.
A warm start for something worth making. Trace these roles back to the tokens
Typography
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
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
- 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 - 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 formBuild 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.
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 scopeInside 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.
<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.
Available in browserAvailable in browserAvailable in browserAvailable in browserAvailable in browserAvailable in browserAvailable in browserAvailable in browserThe 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.
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 --primaryCSS variable var(--primary)Resolved CSS Available in browserHEX · sRGB export Available in your browserThe 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.
Workspace
Action card
Feature
Workspace
Action card
Feature
Put the Palette to Work
Edit a release, check its states, then switch appearances. Only this workspace changes.
Good ideas deserve a little breathing room. Trace these roles back to the tokens
Typography
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
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
- 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 - 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 editorPlace 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.
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 scopeInside 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.
<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.
Available in browserAvailable in browserAvailable in browserAvailable in browserAvailable in browserAvailable in browserAvailable in browserAvailable in browserThe 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.
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 --primaryCSS variable var(--primary)Resolved CSS Available in browserHEX · sRGB export Available in your browserThe 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.
Workspace
Action card
Feature
Workspace
Action card
Feature
Put the Palette to Work
Edit a release, check its states, then switch appearances. Only this workspace changes.
A clear signal for your next move. Trace these roles back to the tokens
Typography
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
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
- 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 - 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 resultUse 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.
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 scopeInside 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.
<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.
Available in browserAvailable in browserAvailable in browserAvailable in browserAvailable in browserAvailable in browserAvailable in browserAvailable in browserThe 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.
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 --primaryCSS variable var(--primary)Resolved CSS Available in browserHEX · sRGB export Available in your browserThe 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.
Workspace
Action card
Feature
Workspace
Action card
Feature
Put the Palette to Work
Edit a release, check its states, then switch appearances. Only this workspace changes.
A shared space with a little personality. Trace these roles back to the tokens
Typography
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
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
- 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 - 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 conversationBuild 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.
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 scopeInside 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.
<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.
Available in browserAvailable in browserAvailable in browserAvailable in browserAvailable in browserAvailable in browserAvailable in browserAvailable in browserThe 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.
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 --primaryCSS variable var(--primary)Resolved CSS Available in browserHEX · sRGB export Available in your browserThe 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.
Workspace
Action card
Feature
Workspace
Action card
Feature
Put the Palette to Work
Edit a release, check its states, then switch appearances. Only this workspace changes.
One clear choice. Everything else in its place. Trace these roles back to the tokens
Typography
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
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
- 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 - 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 unmistakableBuild 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.
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 scopeInside 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.
<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.
Available in browserAvailable in browserAvailable in browserAvailable in browserAvailable in browserAvailable in browserAvailable in browserAvailable in browserThe 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.
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 --primaryCSS variable var(--primary)Resolved CSS Available in browserHEX · sRGB export Available in your browserThe 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.
Workspace
Action card
Feature
Workspace
Action card
Feature
Put the Palette to Work
Edit a release, check its states, then switch appearances. Only this workspace changes.
Know what matters, in 20 minutes. Trace these roles back to the tokens
Typography
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
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
- 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 - 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 stepCombine 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.
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 scopeInside 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.
<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
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.
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.
Light canvas
Prism Default
A warm, light canvas with the familiar original Prism vocabulary.
Start here when comparing another palette. Green strings, blue keywords and warm operators make a useful visual reference without changing the surrounding application theme.
import { useState } from "preact/hooks";
type Review = { title: string; count?: number };
// Keep the next useful action close to the content.
export function ReviewQueue({ title, count = 3 }: Review) {
const [open, setOpen] = useState(false);
return (
<section aria-label={title} data-open={open}>
<h2>{title}</h2>
<button disabled={count === 0} onClick={() => setOpen(!open)}>
{open ? "Close review" : `Review ${count} changes`}
</button>
</section>
);
}Component tags, typed props, comments and a small state change.
- A reference, not the app default
- This is Prism's original CSS palette. Kamod Code's default palette is separate and follows the application's appearance; the two default names do not imply identical colors.
- Keep quiet syntax visible
- The original gray comments and warm operators are intentionally softer than plain source. Review them at the source size and display brightness your readers will actually use.
Save the scoped CSS beside the example below. Its data-prism-theme boundary changes source colors and token effects; Code keeps its layout and controls.
Light canvas
Coy
Paper-like source, vivid red and green tokens, and a cooler blue keyword.
Try Coy beside longer prose where a bright reading surface feels natural. Its direct token colors distinguish literals and language structure with little extra decoration.
import { useState } from "preact/hooks";
type Review = { title: string; count?: number };
// Keep the next useful action close to the content.
export function ReviewQueue({ title, count = 3 }: Review) {
const [open, setOpen] = useState(false);
return (
<section aria-label={title} data-open={open}>
<h2>{title}</h2>
<button disabled={count === 0} onClick={() => setOpen(!open)}>
{open ? "Close review" : `Review ${count} changes`}
</button>
</section>
);
}Component tags, typed props, comments and a small state change.
- Source character, shared layout
- The upstream file also includes a blue edge, paper shadows and line-number plugin layout. This gallery preserves its source paint while Kamod owns spacing, borders, fonts and controls.
- Watch warm operators
- The original brown operators and gray comments are quieter than red properties or blue keywords. Compare a real expression as well as a row of isolated color samples.
Save the scoped CSS beside the example below. Its data-prism-theme boundary changes source colors and token effects; Code keeps its layout and controls.
Dark canvas
Prism Dark
A warm brown-dark canvas with pale source and restrained pastel syntax.
Compare this older Prism palette with a modern charcoal theme. Its warm base makes the entire reading surface part of the design rather than treating darkness as neutral black.
import { useState } from "preact/hooks";
type Review = { title: string; count?: number };
// Keep the next useful action close to the content.
export function ReviewQueue({ title, count = 3 }: Review) {
const [open, setOpen] = useState(false);
return (
<section aria-label={title} data-open={open}>
<h2>{title}</h2>
<button disabled={count === 0} onClick={() => setOpen(!open)}>
{open ? "Close review" : `Review ${count} changes`}
</button>
</section>
);
}Component tags, typed props, comments and a small state change.
- Warmth is structural
- The background is a warm HSL color. Keep it with its source foreground and token colors rather than placing the same tokens on an unrelated dark application surface.
- Original presentation
- Upstream text-shadow and token emphasis are retained as paint. The source file's font and layout choices remain available in the archived CSS, not imposed on the shared reader.
Save the scoped CSS beside the example below. Its data-prism-theme boundary changes source colors and token effects; Code keeps its layout and controls.
Dark canvas
Funky
Black source, bright accents and an intentionally expressive presentation.
Use this as a presentation-oriented contrast to quieter reading palettes. Check a complete snippet before choosing it for long documentation or dense source browsing.
import { useState } from "preact/hooks";
type Review = { title: string; count?: number };
// Keep the next useful action close to the content.
export function ReviewQueue({ title, count = 3 }: Review) {
const [open, setOpen] = useState(false);
return (
<section aria-label={title} data-open={open}>
<h2>{title}</h2>
<button disabled={count === 0} onClick={() => setOpen(!open)}>
{open ? "Close review" : `Review ${count} changes`}
</button>
</section>
);
}Component tags, typed props, comments and a small state change.
- Expressive by design
- Funky keeps the upstream bright token colors and text-shadow. Its in-file SVG background is self-contained; the preview does not contact an image host.
- A distinct source surface
- The upstream code background is black even when its enclosing pre has a pattern. Canvas in the reference describes the surface directly behind source text.
Save the scoped CSS beside the example below. Its data-prism-theme boundary changes source colors and token effects; Code keeps its layout and controls.
Dark canvas
Okaidia
An olive-charcoal canvas with pink, lime, violet and cyan syntax.
Try a mixed TSX or CSS snippet to see its sharp separation between strings, numbers, properties and keywords. The palette remains fixed when the application appearance changes.
import { useState } from "preact/hooks";
type Review = { title: string; count?: number };
// Keep the next useful action close to the content.
export function ReviewQueue({ title, count = 3 }: Review) {
const [open, setOpen] = useState(false);
return (
<section aria-label={title} data-open={open}>
<h2>{title}</h2>
<button disabled={count === 0} onClick={() => setOpen(!open)}>
{open ? "Close review" : `Review ${count} changes`}
</button>
</section>
);
}Component tags, typed props, comments and a small state change.
- Pairs have different jobs
- Lime strings, violet numbers and cyan keywords form separate visual groups. Tags, attributes and variables still follow the exact upstream selectors rather than one broad category color.
- Original versus bundled
- Kamod's built-in Okaidia adaptation adjusts selected colors for small source text. This reference displays the original pinned Prism source, so some swatches deliberately differ.
Save the scoped CSS beside the example below. Its data-prism-theme boundary changes source colors and token effects; Code keeps its layout and controls.
Code also includes syntaxTheme="okaidia", a strengthened Kamod adaptation. This study and download retain the original upstream colors instead.
Light canvas
Solarized Light
A warm cream canvas, blue-gray source and the Solarized accent family.
Compare it against a white palette when your documentation needs a softer source surface. Treat the background and muted base tones as a single system.
import { useState } from "preact/hooks";
type Review = { title: string; count?: number };
// Keep the next useful action close to the content.
export function ReviewQueue({ title, count = 3 }: Review) {
const [open, setOpen] = useState(false);
return (
<section aria-label={title} data-open={open}>
<h2>{title}</h2>
<button disabled={count === 0} onClick={() => setOpen(!open)}>
{open ? "Close review" : `Review ${count} changes`}
</button>
</section>
);
}Component tags, typed props, comments and a small state change.
- A complete light palette
- Solarized uses a deliberate warm background and cooler base ink. Copy the scoped palette together rather than borrowing a single accent for an arbitrary canvas.
- Keep the original distinction
- This preview uses Prism's original Solarized Light values. Kamod also ships a contrast-adjusted adaptation under solarized-light; that API identity does not make the two color sets identical.
Save the scoped CSS beside the example below. Its data-prism-theme boundary changes source colors and token effects; Code keeps its layout and controls.
Code also includes syntaxTheme="solarized-light", a strengthened Kamod adaptation. This study and download retain the original upstream colors instead.
Dark canvas
Tomorrow Night Eighties
Neutral charcoal, light source and a balanced warm/cool accent set.
Use it as a restrained dark comparison for component examples. Review HTML tags, class names and function names as well as the main keyword and string colors.
import { useState } from "preact/hooks";
type Review = { title: string; count?: number };
// Keep the next useful action close to the content.
export function ReviewQueue({ title, count = 3 }: Review) {
const [open, setOpen] = useState(false);
return (
<section aria-label={title} data-open={open}>
<h2>{title}</h2>
<button disabled={count === 0} onClick={() => setOpen(!open)}>
{open ? "Close review" : `Review ${count} changes`}
</button>
</section>
);
}Component tags, typed props, comments and a small state change.
- More than the main groups
- The upstream palette gives tags and attributes a warm red, class names a yellow and function-name tokens their own blue. The preview retains those selector-specific details.
- Adaptation is explicit
- The bundled tomorrow option is a Kamod adaptation. The gallery's archived CSS and swatches describe the pinned upstream theme, with no silent contrast adjustments.
Save the scoped CSS beside the example below. Its data-prism-theme boundary changes source colors and token effects; Code keeps its layout and controls.
Code also includes syntaxTheme="tomorrow", a strengthened Kamod adaptation. This study and download retain the original upstream colors instead.
Dark canvas
Twilight
Near-black source with muted green strings, warm numbers and pale yellow structure.
Compare it with a brighter dark palette when source needs less saturation. Keep comments and low-emphasis tokens in the review rather than judging only the vivid samples.
import { useState } from "preact/hooks";
type Review = { title: string; count?: number };
// Keep the next useful action close to the content.
export function ReviewQueue({ title, count = 3 }: Review) {
const [open, setOpen] = useState(false);
return (
<section aria-label={title} data-open={open}>
<h2>{title}</h2>
<button disabled={count === 0} onClick={() => setOpen(!open)}>
{open ? "Close review" : `Review ${count} changes`}
</button>
</section>
);
}Component tags, typed props, comments and a small state change.
- Quiet does not mean one color
- Twilight separates tags, strings, numbers and at-rules through small hue changes. These relationships are easier to evaluate in a complete snippet than in isolated swatches.
- Read at the intended size
- The original palette includes deliberately subdued comments. The existing Code twilight option uses a readable adaptation; this gallery keeps the original source values.
Save the scoped CSS beside the example below. Its data-prism-theme boundary changes source colors and token effects; Code keeps its layout and controls.
Code also includes syntaxTheme="twilight", a strengthened Kamod adaptation. This study and download retain the original upstream colors instead.
Dark canvas
Dracula
Purple-charcoal source with cyan keywords, pink properties and bright green/yellow details.
Try it for code-heavy examples where distinct token families should remain easy to spot. Compare real nested markup with the bare token swatches before choosing it.
import { useState } from "preact/hooks";
type Review = { title: string; count?: number };
// Keep the next useful action close to the content.
export function ReviewQueue({ title, count = 3 }: Review) {
const [open, setOpen] = useState(false);
return (
<section aria-label={title} data-open={open}>
<h2>{title}</h2>
<button disabled={count === 0} onClick={() => setOpen(!open)}>
{open ? "Close review" : `Review ${count} changes`}
</button>
</section>
);
}Component tags, typed props, comments and a small state change.
- A recognizable palette
- The familiar Dracula colors belong together with their charcoal canvas. Applying the accents to the application's general background would change the reading contrast.
- Token roles stay precise
- Functions, keywords, attributes and punctuation use the source theme's selectors. Representative samples describe one token each; language overrides remain in the complete scoped CSS.
Save the scoped CSS beside the example below. Its data-prism-theme boundary changes source colors and token effects; Code keeps its layout and controls.
Dark canvas
Nord
Blue-gray polar tones with restrained cyan, green and warm accent notes.
Compare it with a neutral charcoal theme for a calmer source region. Keep enough surrounding separation that the cool canvas remains distinguishable from the page.
import { useState } from "preact/hooks";
type Review = { title: string; count?: number };
// Keep the next useful action close to the content.
export function ReviewQueue({ title, count = 3 }: Review) {
const [open, setOpen] = useState(false);
return (
<section aria-label={title} data-open={open}>
<h2>{title}</h2>
<button disabled={count === 0} onClick={() => setOpen(!open)}>
{open ? "Close review" : `Review ${count} changes`}
</button>
</section>
);
}Component tags, typed props, comments and a small state change.
- Cool rather than neutral
- Nord's canvas and plain text both carry a cool hue. The source surface is independent from an application preset, even when the page happens to use similar blues.
- Comments need a real reading check
- The original comment tone is intentionally subdued. A calm palette still needs review at the actual text size, with selection and muted syntax included.
Save the scoped CSS beside the example below. Its data-prism-theme boundary changes source colors and token effects; Code keeps its layout and controls.
Dark canvas
Night Owl
Deep midnight blue with pale source, violet structure and warm string accents.
Use it to compare a blue-black reading surface with the flatter grays of One Dark or VS Code Dark+. Keep all source colors local to the reader.
import { useState } from "preact/hooks";
type Review = { title: string; count?: number };
// Keep the next useful action close to the content.
export function ReviewQueue({ title, count = 3 }: Review) {
const [open, setOpen] = useState(false);
return (
<section aria-label={title} data-open={open}>
<h2>{title}</h2>
<button disabled={count === 0} onClick={() => setOpen(!open)}>
{open ? "Close review" : `Review ${count} changes`}
</button>
</section>
);
}Component tags, typed props, comments and a small state change.
- Preserve the midnight canvas
- The dark blue surface contributes to Night Owl's identity. Moving only the token colors to another canvas would no longer reproduce this pinned source palette.
- Keep the original credit
- The source retains Sarah Drasner's 2018 copyright and the port credits. Downloaded scoped CSS includes those notices alongside the collection's MIT license.
Save the scoped CSS beside the example below. Its data-prism-theme boundary changes source colors and token effects; Code keeps its layout and controls.
Dark canvas
One Dark
Cool charcoal with balanced green, blue, orange and violet syntax.
Compare it with One Light using the same language sample. The pair shares a design family, while the canvas, source ink and individual token values change deliberately.
import { useState } from "preact/hooks";
type Review = { title: string; count?: number };
// Keep the next useful action close to the content.
export function ReviewQueue({ title, count = 3 }: Review) {
const [open, setOpen] = useState(false);
return (
<section aria-label={title} data-open={open}>
<h2>{title}</h2>
<button disabled={count === 0} onClick={() => setOpen(!open)}>
{open ? "Close review" : `Review ${count} changes`}
</button>
</section>
);
}Component tags, typed props, comments and a small state change.
- Context matters
- The original file includes detailed CSS, JavaScript, JSON and markup overrides. A generic keyword or property swatch does not replace those language-specific rules.
- Shared reader, original paint
- The gallery retains source colors and token emphasis while leaving fonts, layout and plugin controls to Code. The archived original includes the upstream plugin styling too.
Save the scoped CSS beside the example below. Its data-prism-theme boundary changes source colors and token effects; Code keeps its layout and controls.
Light canvas
One Light
A light neutral canvas with clear warm literals and cool language structure.
Read the same TSX, CSS and JSON samples beside One Dark. This is a separate authored palette rather than an automatic inversion of its dark counterpart.
import { useState } from "preact/hooks";
type Review = { title: string; count?: number };
// Keep the next useful action close to the content.
export function ReviewQueue({ title, count = 3 }: Review) {
const [open, setOpen] = useState(false);
return (
<section aria-label={title} data-open={open}>
<h2>{title}</h2>
<button disabled={count === 0} onClick={() => setOpen(!open)}>
{open ? "Close review" : `Review ${count} changes`}
</button>
</section>
);
}Component tags, typed props, comments and a small state change.
- A related light system
- One Light uses its own canvas and source values. The shared family is useful for comparison, but the light and dark files remain separate pinned sources.
- Representative versus contextual
- Bare token swatches show a base color. The scoped stylesheet retains the source's more specific grammar selectors for nested tokens and language exceptions.
Save the scoped CSS beside the example below. Its data-prism-theme boundary changes source colors and token effects; Code keeps its layout and controls.
Light canvas
GHColors
A clean white source surface with blue, red and green accents.
Try it in a prose-first guide where a familiar light source region should remain visually quiet. Its name describes this community Prism theme, not a live GitHub stylesheet.
import { useState } from "preact/hooks";
type Review = { title: string; count?: number };
// Keep the next useful action close to the content.
export function ReviewQueue({ title, count = 3 }: Review) {
const [open, setOpen] = useState(false);
return (
<section aria-label={title} data-open={open}>
<h2>{title}</h2>
<button disabled={count === 0} onClick={() => setOpen(!open)}>
{open ? "Close review" : `Review ${count} changes`}
</button>
</section>
);
}Component tags, typed props, comments and a small state change.
- A historical interpretation
- GHColors is the pinned community theme inspired by GitHub. It is not a claim to match every current GitHub product or appearance.
- Inspect the quieter tokens
- A white background makes low-emphasis gray tokens visible as a separate design choice. Review comments, punctuation and selection alongside the stronger accent colors.
Save the scoped CSS beside the example below. Its data-prism-theme boundary changes source colors and token effects; Code keeps its layout and controls.
Dark canvas
VS Code Dark+
Neutral dark gray with familiar blue, orange, green and yellow syntax cues.
Use it as an editor-like comparison for configuration and component snippets. This is a Prism port, so visible token grouping follows Prism's grammar rather than an editor's semantic tokens.
import { useState } from "preact/hooks";
type Review = { title: string; count?: number };
// Keep the next useful action close to the content.
export function ReviewQueue({ title, count = 3 }: Review) {
const [open, setOpen] = useState(false);
return (
<section aria-label={title} data-open={open}>
<h2>{title}</h2>
<button disabled={count === 0} onClick={() => setOpen(!open)}>
{open ? "Close review" : `Review ${count} changes`}
</button>
</section>
);
}Component tags, typed props, comments and a small state change.
- Grammar affects the result
- Prism and VS Code do not assign every identifier to identical token types. This reference preserves the port's CSS rather than promising a pixel-identical editor screenshot.
- Keep source local
- The source canvas and accents stay fixed inside this reader. No VS Code extension, remote stylesheet or application-theme switch is required.
Save the scoped CSS beside the example below. Its data-prism-theme boundary changes source colors and token effects; Code keeps its layout and controls.
Dark canvas
Material Dark
A dark gray canvas with bright Material-style violet, cyan and warm highlights.
Compare it with Material Oceanic to isolate the effect of the source background. Include attributes, strings and property names in a real sample rather than relying only on keywords.
import { useState } from "preact/hooks";
type Review = { title: string; count?: number };
// Keep the next useful action close to the content.
export function ReviewQueue({ title, count = 3 }: Review) {
const [open, setOpen] = useState(false);
return (
<section aria-label={title} data-open={open}>
<h2>{title}</h2>
<button disabled={count === 0} onClick={() => setOpen(!open)}>
{open ? "Close review" : `Review ${count} changes`}
</button>
</section>
);
}Component tags, typed props, comments and a small state change.
- A neutral Material base
- This variant uses a gray reading surface. The exact upstream colors remain separate from the application's own Material-inspired or semantic theme tokens.
- Color is not the grammar
- The palette supplies CSS for Prism token classes. It does not decide which source spans are numbers, methods, tags or properties; the active language grammar does.
Save the scoped CSS beside the example below. Its data-prism-theme boundary changes source colors and token effects; Code keeps its layout and controls.
Light canvas
Material Light
A bright Material-style canvas with violet structure and green/cyan accents.
Compare this authored light palette with Material Dark on the same snippet. Keep the background with its text colors when copying the local CSS.
import { useState } from "preact/hooks";
type Review = { title: string; count?: number };
// Keep the next useful action close to the content.
export function ReviewQueue({ title, count = 3 }: Review) {
const [open, setOpen] = useState(false);
return (
<section aria-label={title} data-open={open}>
<h2>{title}</h2>
<button disabled={count === 0} onClick={() => setOpen(!open)}>
{open ? "Close review" : `Review ${count} changes`}
</button>
</section>
);
}Component tags, typed props, comments and a small state change.
- An authored light variant
- Material Light has explicit source and token values. It is not generated by flipping brightness or inverting another theme's colors.
- Review full expressions
- Adjacent strings, operators, punctuation and keywords create the reading hierarchy. A single attractive accent is not enough to choose a source palette.
Save the scoped CSS beside the example below. Its data-prism-theme boundary changes source colors and token effects; Code keeps its layout and controls.
Dark canvas
Material Oceanic
A blue-green dark canvas with the Material accent vocabulary.
Compare its cool surface with Material Dark's gray one. The difference is useful when a page already contains colored panels and you need a source region with its own identity.
import { useState } from "preact/hooks";
type Review = { title: string; count?: number };
// Keep the next useful action close to the content.
export function ReviewQueue({ title, count = 3 }: Review) {
const [open, setOpen] = useState(false);
return (
<section aria-label={title} data-open={open}>
<h2>{title}</h2>
<button disabled={count === 0} onClick={() => setOpen(!open)}>
{open ? "Close review" : `Review ${count} changes`}
</button>
</section>
);
}Component tags, typed props, comments and a small state change.
- Canvas makes a difference
- The oceanic surface is part of the authored palette. Reusing its token colors on an arbitrary background would change the result shown here.
- Keep UI chrome separate
- Toolbar buttons and surrounding descriptions continue to use the page's readable theme. The upstream syntax paint is restricted to source content.
Save the scoped CSS beside the example below. Its data-prism-theme boundary changes source colors and token effects; Code keeps its layout and controls.
Dark canvas
Synthwave ’84
Deep purple source with neon pink, cyan and yellow accents and a visible glow.
Try it for a more expressive source treatment, then compare the same code with a restrained theme. Check whether the glow helps your content at the intended density.
import { useState } from "preact/hooks";
type Review = { title: string; count?: number };
// Keep the next useful action close to the content.
export function ReviewQueue({ title, count = 3 }: Review) {
const [open, setOpen] = useState(false);
return (
<section aria-label={title} data-open={open}>
<h2>{title}</h2>
<button disabled={count === 0} onClick={() => setOpen(!open)}>
{open ? "Close review" : `Review ${count} changes`}
</button>
</section>
);
}Component tags, typed props, comments and a small state change.
- Glow is part of the source
- The upstream token text-shadows are retained. They are static paint, not an animation, and the preview adds no timer or looping effect.
- Exact rather than certified
- Bright accents can look strong while quieter tokens or glow remain hard to read. This gallery shows the original palette and does not claim every token meets a contrast target.
Save the scoped CSS beside the example below. Its data-prism-theme boundary changes source colors and token effects; Code keeps its layout and controls.
Dark canvas
Gruvbox Dark
A warm dark surface with earthy yellow, green, orange and aqua syntax.
Compare it against cooler dark palettes when a warm page or long reading session calls for a different source atmosphere. Keep comments and nested tokens in the review.
import { useState } from "preact/hooks";
type Review = { title: string; count?: number };
// Keep the next useful action close to the content.
export function ReviewQueue({ title, count = 3 }: Review) {
const [open, setOpen] = useState(false);
return (
<section aria-label={title} data-open={open}>
<h2>{title}</h2>
<button disabled={count === 0} onClick={() => setOpen(!open)}>
{open ? "Close review" : `Review ${count} changes`}
</button>
</section>
);
}Component tags, typed props, comments and a small state change.
- Warm relationships
- The background, pale source and earthy accents create the Gruvbox direction together. Avoid treating the accent set as interchangeable with a neutral editor canvas.
- Companion, not inversion
- Gruvbox Light is listed separately with its own source file and author credit. Switching between the pair changes an authored palette rather than an inversion filter.
Save the scoped CSS beside the example below. Its data-prism-theme boundary changes source colors and token effects; Code keeps its layout and controls.
Light canvas
Gruvbox Light
Warm cream source with earthy dark accents and brown-gray supporting syntax.
Read it beside Gruvbox Dark with the same source language. The warm canvas makes a useful comparison to the white surfaces of GHColors and One Light.
import { useState } from "preact/hooks";
type Review = { title: string; count?: number };
// Keep the next useful action close to the content.
export function ReviewQueue({ title, count = 3 }: Review) {
const [open, setOpen] = useState(false);
return (
<section aria-label={title} data-open={open}>
<h2>{title}</h2>
<button disabled={count === 0} onClick={() => setOpen(!open)}>
{open ? "Close review" : `Review ${count} changes`}
</button>
</section>
);
}Component tags, typed props, comments and a small state change.
- Cream is deliberate
- The light canvas is part of this palette's identity. Keep its foreground and comment colors with it when copying the scoped stylesheet.
- Trace the adaptation
- This port is based on Gruvbox and the community dark adaptation. The preserved file header and pinned source link retain that chain of credit.
Save the scoped CSS beside the example below. Its data-prism-theme boundary changes source colors and token effects; Code keeps its layout and controls.
Dark canvas
a11y Dark
A dark source palette with deliberately clear, separated token accents.
Include it when comparing readability-focused palettes, then check your actual grammar, font size, selection and display. The name does not replace a contrast review of the rendered result.
import { useState } from "preact/hooks";
type Review = { title: string; count?: number };
// Keep the next useful action close to the content.
export function ReviewQueue({ title, count = 3 }: Review) {
const [open, setOpen] = useState(false);
return (
<section aria-label={title} data-open={open}>
<h2>{title}</h2>
<button disabled={count === 0} onClick={() => setOpen(!open)}>
{open ? "Close review" : `Review ${count} changes`}
</button>
</section>
);
}Component tags, typed props, comments and a small state change.
- Intent, not a blanket guarantee
- The theme's upstream accessibility intent is preserved along with its name. This gallery does not certify every token, language override or future combination against a contrast standard.
- Keep the pairings intact
- The source canvas and foreground form the baseline. A token's readability depends on that background and its actual rendering, not on its hexadecimal value alone.
Save the scoped CSS beside the example below. Its data-prism-theme boundary changes source colors and token effects; Code keeps its layout and controls.
Light canvas
Duotone Light
A light two-family palette that groups syntax through restrained hue variation.
Compare it with a more colorful light theme when you want fewer competing syntax hues. Check that the quieter groups remain useful at the density of your examples.
import { useState } from "preact/hooks";
type Review = { title: string; count?: number };
// Keep the next useful action close to the content.
export function ReviewQueue({ title, count = 3 }: Review) {
const [open, setOpen] = useState(false);
return (
<section aria-label={title} data-open={open}>
<h2>{title}</h2>
<button disabled={count === 0} onClick={() => setOpen(!open)}>
{open ? "Close review" : `Review ${count} changes`}
</button>
</section>
);
}Component tags, typed props, comments and a small state change.
- Fewer hue families
- Duotone's small set of related accents creates hierarchy through tone as well as hue. Some roles intentionally share a color rather than receiving a unique accent.
- Preserve the conversion credit
- The source records Simurai's Atom theme direction and Bram de Haan's Base2Tone conversion. Those credits remain alongside the pinned collection source and MIT license.
Save the scoped CSS beside the example below. Its data-prism-theme boundary changes source colors and token effects; Code keeps its layout and controls.
Dark canvas
Atom Dark
Near-black source with a familiar muted editor palette and warm/cool accents.
Compare it with One Dark to see two different Atom-inspired directions. Read a complete function and nested markup before choosing it for dense technical guides.
import { useState } from "preact/hooks";
type Review = { title: string; count?: number };
// Keep the next useful action close to the content.
export function ReviewQueue({ title, count = 3 }: Review) {
const [open, setOpen] = useState(false);
return (
<section aria-label={title} data-open={open}>
<h2>{title}</h2>
<button disabled={count === 0} onClick={() => setOpen(!open)}>
{open ? "Close review" : `Review ${count} changes`}
</button>
</section>
);
}Component tags, typed props, comments and a small state change.
- Two Atom families
- Atom Dark and One Dark are separate source palettes with different histories. Similar names do not make their foregrounds or token colors interchangeable.
- Keep quiet source readable
- The original comment and punctuation colors stay unchanged. Review them at the final source size rather than brightening them silently in the gallery.
Save the scoped CSS beside the example below. Its data-prism-theme boundary changes source colors and token effects; Code keeps its layout and controls.
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.
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.
Keep source coloring connected with Code’s opt-in syntaxTheme="theme", or carry the shared foundation into a complete layout.
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:
: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.
| API | Purpose |
|---|---|
ThemeProvider | Provides theme state and setters to its descendants. |
defaultPreset | Fallback palette; defaults to kamod. |
defaultScheme | Fallback preference; defaults to system. |
useTheme() | Returns preset, presets, scheme, resolvedScheme, setPreset and setScheme. |
isThemePresetId | Validates a string before passing it to setPreset. |
storage | Synchronous preference adapter; omitted means browser local storage, null skips provider storage access. |
ThemeScript | Emits the default early appearance script; accepts an optional nonce. |
getThemeInitScript | Returns startup script text with custom defaults. |
attributeTarget | Element 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.
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.
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.
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.
0 of 3 checks reviewed.
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.