theme-system

0
0
Source

Use when creating or modifying UI components, styling, or visual elements in OpenChamber. All UI colors must use theme tokens - never hardcoded values or Tailwind color classes.

Install

mkdir -p .claude/skills/theme-system && curl -L -o skill.zip "https://mcp.directory/api/skills/download/7480" && unzip -o skill.zip -d .claude/skills/theme-system && rm skill.zip

Installs to .claude/skills/theme-system

About this skill

Overview

OpenChamber uses a JSON-based theme system. Themes are defined in packages/ui/src/lib/theme/themes/. Users can also add custom themes via ~/.config/openchamber/themes/.

Core principle: UI colors must use theme tokens - never hardcoded hex colors or Tailwind color classes.

When to Use

  • Creating or modifying UI components
  • Working with colors, backgrounds, borders, or text

Quick Decision Tree

  1. Code display?syntax.*
  2. Feedback/status?status.*
  3. Primary CTA?primary.*
  4. Interactive/clickable?interactive.*
  5. Background layer?surface.*
  6. Text?surface.foreground or surface.mutedForeground

Critical Rules

  • surface.elevated = inputs, cards, panels
  • interactive.hover = ONLY on clickable elements
  • interactive.selection = active/selected states (not primary!)
  • Status colors = ONLY for actual feedback (errors, warnings, success)
  • Input footers = bg-transparent on elevated background

Button Rules (MANDATORY)

Use only the shared Button component from packages/ui/src/components/ui/button.tsx.

  • Do not create wrapper button components (for example ButtonLarge, ButtonSmall).
  • Do not hardcode button height/padding classes when a size variant exists.
  • Use semantic button variants consistently; avoid ad-hoc one-off button styling.

Allowed Button Variants

VariantUse forToken direction
defaultPrimary action in a local section/dialogprimary.*
outlineSecondary visible actionsurface.elevated + interactive.*
secondarySoft secondary actioninteractive.hover / interactive.active
ghostLow-emphasis row/toolbar actiontransparent + interactive.hover
destructiveDestructive actions (Delete, Revert all)status.error*
linkRare inline text action onlytext-link style

Allowed Button Sizes

SizeUse for
xsDense controls in rows/lists
smDefault compact action buttons
defaultStandard form/page actions
lgProminent large actions
iconIcon-only square button

Button Selection Quick Guide

  1. Main CTA in section/dialog -> default
  2. Side action next to CTA -> outline
  3. Quiet auxiliary action -> ghost
  4. Dangerous action -> destructive
  5. Tiny row action -> keep same variant, set size="xs"

Never Use

  • Hardcoded hex colors (#FF0000)
  • Tailwind colors (bg-white, text-blue-500, bg-gray-*)
  • Deprecated: bg-secondary, bg-muted

Usage

Via Hook

import { useThemeSystem } from '@/contexts/useThemeSystem';
const { currentTheme } = useThemeSystem();

<div style={{ backgroundColor: currentTheme.colors.surface.elevated }}>

Via CSS Variables

<div className="bg-[var(--surface-elevated)] hover:bg-[var(--interactive-hover)]">

Color Tokens

Surface Colors

TokenUsage
surface.backgroundMain app background
surface.elevatedInputs, cards, panels, popovers
surface.mutedSecondary backgrounds, sidebars
surface.foregroundPrimary text
surface.mutedForegroundSecondary text, hints
surface.subtleSubtle dividers

Interactive Colors

TokenUsage
interactive.borderDefault borders
interactive.hoverHover on clickable elements only
interactive.selectionActive/selected items
interactive.selectionForegroundText on selection
interactive.focusRingFocus indicators

Status Colors

TokenUsage
status.errorErrors, validation failures
status.warningWarnings, cautions
status.successSuccess messages
status.infoInformational messages

Each has variants: *, *Foreground, *Background, *Border.

Primary Colors

TokenUsage
primary.basePrimary CTA buttons
primary.hoverHover on primary elements
primary.foregroundText on primary background

Primary vs Selection: Primary = "click me" (CTA), Selection = "currently active" (state).

Syntax Colors

For code display only. Never use for UI elements.

TokenUsage
syntax.base.backgroundCode block background
syntax.base.foregroundDefault code text
syntax.base.keywordKeywords
syntax.base.stringStrings
syntax.highlights.diffAddedAdded lines
syntax.highlights.diffRemovedRemoved lines

Examples

Input Area

const { currentTheme } = useThemeSystem();

<div style={{ backgroundColor: currentTheme.colors.surface.elevated }}>
  <textarea className="bg-transparent" />
  <div className="bg-transparent">{/* Footer - transparent! */}</div>
</div>

Active Tab

<button className={isActive 
  ? 'bg-interactive-selection text-interactive-selection-foreground'
  : 'hover:bg-interactive-hover/50'
}>

Error Message

<div style={{ 
  color: currentTheme.colors.status.error,
  backgroundColor: currentTheme.colors.status.errorBackground 
}}>

Card

<div style={{ backgroundColor: currentTheme.colors.surface.elevated }}>
  <h3 style={{ color: currentTheme.colors.surface.foreground }}>Title</h3>
  <p style={{ color: currentTheme.colors.surface.mutedForeground }}>Description</p>
</div>

Wrong vs Right

Wrong

// Hardcoded colors
<div style={{ backgroundColor: '#F2F0E5' }}>
<button className="bg-blue-500">

// Primary for active tab
<Tab className="bg-primary">Active</Tab>

// Hover on static element
<div className="hover:bg-interactive-hover">Static card</div>

// Colored footer on input
<div style={{ backgroundColor: currentTheme.colors.surface.elevated }}>
  <textarea />
  <div style={{ backgroundColor: currentTheme.colors.surface.muted }}>Footer</div>
</div>

Right

// Theme tokens
<div style={{ backgroundColor: currentTheme.colors.surface.elevated }}>
<button style={{ backgroundColor: currentTheme.colors.primary.base }}>

// Selection for active tab
<Tab style={{ backgroundColor: currentTheme.colors.interactive.selection }}>Active</Tab>

// Hover only on clickable
<button className="hover:bg-[var(--interactive-hover)]">Click</button>

// Transparent footer
<div style={{ backgroundColor: currentTheme.colors.surface.elevated }}>
  <textarea className="bg-transparent" />
  <div className="bg-transparent">Footer</div>
</div>

References

Key Files

  • Theme types: packages/ui/src/types/theme.ts
  • Theme hook: packages/ui/src/contexts/useThemeSystem.ts
  • CSS generator: packages/ui/src/lib/theme/cssGenerator.ts
  • Built-in themes: packages/ui/src/lib/theme/themes/

You might also like

flutter-development

aj-geddes

Build beautiful cross-platform mobile apps with Flutter and Dart. Covers widgets, state management with Provider/BLoC, navigation, API integration, and material design.

9521,094

drawio-diagrams-enhanced

jgtolentino

Create professional draw.io (diagrams.net) diagrams in XML format (.drawio files) with integrated PMP/PMBOK methodologies, extensive visual asset libraries, and industry-standard professional templates. Use this skill when users ask to create flowcharts, swimlane diagrams, cross-functional flowcharts, org charts, network diagrams, UML diagrams, BPMN, project management diagrams (WBS, Gantt, PERT, RACI), risk matrices, stakeholder maps, or any other visual diagram in draw.io format. This skill includes access to custom shape libraries for icons, clipart, and professional symbols.

846846

ui-ux-pro-max

nextlevelbuilder

"UI/UX design intelligence. 50 styles, 21 palettes, 50 font pairings, 20 charts, 8 stacks (React, Next.js, Vue, Svelte, SwiftUI, React Native, Flutter, Tailwind). Actions: plan, build, create, design, implement, review, fix, improve, optimize, enhance, refactor, check UI/UX code. Projects: website, landing page, dashboard, admin panel, e-commerce, SaaS, portfolio, blog, mobile app, .html, .tsx, .vue, .svelte. Elements: button, modal, navbar, sidebar, card, table, form, chart. Styles: glassmorphism, claymorphism, minimalism, brutalism, neumorphism, bento grid, dark mode, responsive, skeuomorphism, flat design. Topics: color palette, accessibility, animation, layout, typography, font pairing, spacing, hover, shadow, gradient."

571699

godot

bfollington

This skill should be used when working on Godot Engine projects. It provides specialized knowledge of Godot's file formats (.gd, .tscn, .tres), architecture patterns (component-based, signal-driven, resource-based), common pitfalls, validation tools, code templates, and CLI workflows. The `godot` command is available for running the game, validating scripts, importing resources, and exporting builds. Use this skill for tasks involving Godot game development, debugging scene/resource files, implementing game systems, or creating new Godot components.

548492

nano-banana-pro

garg-aayush

Generate and edit images using Google's Nano Banana Pro (Gemini 3 Pro Image) API. Use when the user asks to generate, create, edit, modify, change, alter, or update images. Also use when user references an existing image file and asks to modify it in any way (e.g., "modify this image", "change the background", "replace X with Y"). Supports both text-to-image generation and image-to-image editing with configurable resolution (1K default, 2K, or 4K for high resolution). DO NOT read the image file first - use this skill directly with the --input-image parameter.

673466

fastapi-templates

wshobson

Create production-ready FastAPI projects with async patterns, dependency injection, and comprehensive error handling. Use when building new FastAPI applications or setting up backend API projects.

514280

Stay ahead of the MCP ecosystem

Get weekly updates on new skills and servers.