Basic information
About theme-system
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.
theme-system is an agent skill listed in the AddMCP.net directory, published by btriapitsyn. Runtime: TypeScript. License: MIT. The repository has 12,446 GitHub stars. Source code is hosted on github.com. Related topics: agentic-engineering, agents, ai, enginering, opencode.
Overview
What is theme-system?
name: theme-system description: 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. license: MIT compatibility: opencode
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
- Code display? →
syntax.* - Feedback/status? →
status.* - Primary CTA? →
primary.* - Interactive/clickable? →
interactive.* - Background layer? →
surface.* - Text? →
surface.foregroundorsurface.mutedForeground
Critical Rules
surface.elevated= inputs, cards, panelsinteractive.hover= ONLY on clickable elementsinteractive.selection= active/selected states (not primary!)- Status colors = ONLY for actual feedback (errors, warnings, success)
- Input footers =
bg-transparenton 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
sizevariant exists. - Use semantic button variants consistently; avoid ad-hoc one-off button styling.
Allowed Button Variants
| Variant | Use for | Token direction | |-------|-------|-------| | default | Primary action in a local section/dialog | primary. | | outline | Secondary visible action | surface.elevated + interactive. | | secondary | Soft secondary action | interactive.hover / interactive.active | | ghost | Low-emphasis row/toolbar action | transparent + interactive.hover | | destructive | Destructive actions (Delete, Revert all) | status.error* | | link | Rare inline text action only | text-link style |
Allowed Button Sizes
| Size | Use for | |------|---------| | xs | Dense controls in rows/lists | | sm | Default compact action buttons | | default | Standard form/page actions | | lg | Prominent large actions | | icon | Icon-only square button |
Button Selection Quick Guide
- Main CTA in section/dialog ->
default - Side action next to CTA ->
outline - Quiet auxiliary action ->
ghost - Dangerous action ->
destructive - 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
Color Tokens
Surface Colors
| Token | Usage | |-------|-------| | surface.background | Main app background | | surface.elevated | Inputs, cards, panels, popovers | | surface.muted | Secondary backgrounds, sidebars | | surface.foreground | Primary text | | surface.mutedForeground | Secondary text, hints | | surface.subtle | Subtle dividers |
Interactive Colors
| Token | Usage | |-------|-------| | interactive.border | Default borders | | interactive.hover | Hover on clickable elements only | | interactive.selection | Active/selected items | | interactive.selectionForeground | Text on selection | | interactive.focusRing | Focus indicators |
Status Colors
| Token | Usage | |-------|-------| | status.error | Errors, validation failures | | status.warning | Warnings, cautions | | status.success | Success messages | | status.info | Informational messages |
Each has variants: , Foreground, Background, Border.
Primary Colors
| Token | Usage | |-------|-------| | primary.base | Primary CTA buttons | | primary.hover | Hover on primary elements | | primary.foreground | Text 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.
| Token | Usage | |-------|-------| | syntax.base.background | Code block background | | syntax.base.foreground | Default code text | | syntax.base.keyword | Keywords | | syntax.base.string | Strings | | syntax.highlights.diffAdded | Added lines | | syntax.highlights.diffRemoved | Removed lines |
Examples
Title
Description
Wrong vs Right
References
- [Adding Themes](references/adding-themes.md) - Built-in and custom themes
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/
Comments
No comments yet
Be the first to share feedback about this listing. Sign in to leave a comment.
Sign In