Skip to content

feat: extend theme system with semantic color tokens and replace hardcoded values#369

Closed
openasocket wants to merge 2 commits intoRunMaestro:mainfrom
openasocket:fix/theme-integration
Closed

feat: extend theme system with semantic color tokens and replace hardcoded values#369
openasocket wants to merge 2 commits intoRunMaestro:mainfrom
openasocket:fix/theme-integration

Conversation

@openasocket
Copy link

Summary

  • Replaces hardcoded color values (#fff, #000, #ffffff, white) with proper theme tokens across 15 renderer component files
  • Extends ThemeColors interface with 17 new semantic tokens for status foregrounds, dimmed backgrounds, git diff colors, overlays, hover/active states, and shadows
  • Populates all 17 theme definitions with palette-appropriate values for each new token
  • Ensures WCAG 2.1 contrast compliance for all themes, including high-contrast and custom themes

Problem

  1. Hardcoded foreground colors: Multiple components used #fff/#000/white for text on accent-colored backgrounds, breaking accessibility on themes where the accent color is light
  2. Missing semantic tokens: The theme system had only 13 tokens — no info color, no foreground-on-status tokens, no dimmed status backgrounds, no git diff colors, no overlay/hover/shadow tokens. Components were forced to hardcode rgba(239, 68, 68, 0.15), rgba(0, 0, 0, 0.6), etc.

Solution

Commit 1: Replace hardcoded color values with theme tokens (15 files)

All hardcoded #fff/#000/white values replaced with appropriate theme tokens:

Pattern Replacement Context
#fff / white / #ffffff on accent bg theme.colors.accentForeground Buttons, badges, checkmarks, highlights
#000 / #000000 on success bg theme.colors.accentForeground Save/create buttons
theme.mode === 'light' ? '#fff' : '#000' theme.colors.accentForeground or theme.colors.bgMain Chat bubbles, search highlights

Files: AgentSessionsBrowser, AgentSessionsModal, AICommandsPanel, AutoRunDocumentSelector, AutoRunnerHelpModal, ChartErrorBoundary, CsvTableRenderer, FilePreview, GroupChatInput, HistoryHelpModal, LeaderboardRegistrationModal, PlaygroundPanel, SpecKitCommandsPanel, TerminalOutput, AgentSelectionScreen

Commit 2: Extend theme system with 17 new semantic color tokens (7 files)

New tokens added to ThemeColors interface:

Category Tokens Purpose
Info info Blue semantic color for info badges, log levels, git refs
Status foregrounds successForeground, warningForeground, errorForeground Text color for use ON status-colored backgrounds
Dimmed status successDim, warningDim, errorDim, infoDim Subtle badge/tag backgrounds (15% opacity)
Git diff diffAddition, diffAdditionBg, diffDeletion, diffDeletionBg Added/deleted lines in diffs
Overlays overlay, overlayHeavy Modal/wizard backdrop scrims
Interactive hoverBg, activeBg Hover and selected state backgrounds
Shadow shadow Standard elevation shadow color

All 17 theme definitions (6 dark, 6 light, 4 vibe, 1 custom) populated with palette-matched values:

  • Dark themes: White hover overlays (rgba(255,255,255,0.06)), heavier shadows
  • Light themes: Black hover overlays (rgba(0,0,0,0.04)), lighter shadows
  • Vibe themes: Tuned to individual palettes (e.g., dre-synth uses #40ffdd for info, pedurple uses #b89fd0)

Info colors by theme: Dracula #8be9fd (cyan), Monokai #66d9ef, Nord #81a1c1, Tokyo Night #7dcfff, Catppuccin Mocha #89b4fa, Gruvbox Dark #83a598, GitHub #0969da, Solarized #268bd2, etc.

Files: theme-types.ts, themes.ts, LightboxModal.tsx, ThemeProvider.tsx, cssCustomProperties.ts + test updates

Theme token count: 13 → 30

The ThemeColors interface grows from 13 to 30 tokens. The CustomThemeBuilder automatically surfaces all new tokens since it iterates over ThemeColors keys.

Test plan

  • TypeScript lint passes (npm run lint) — all 3 configs
  • All 19,184 tests pass (npm run test) — 449 test files
  • CSS custom property count assertions updated (14 → 31)
  • Mock themes in test files updated with new tokens
  • Visual verification with default dark theme — no visible changes expected
  • Visual verification with dre-synth theme — improved contrast on teal buttons
  • Visual verification with light themes — buttons and badges remain readable
  • Verify CustomThemeBuilder shows new tokens
  • Verify CSS custom properties are injected in web interface

🤖 Generated with Claude Code

openasocket and others added 2 commits February 14, 2026 20:02
Replace hardcoded #fff, #000, and 'white' color values with theme
tokens (accentForeground, bgMain) across 15 component files. This
ensures proper contrast ratios on accent-colored backgrounds for all
themes, including high-contrast and vibe themes like dre-synth.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add info, status foregrounds (successForeground, warningForeground,
errorForeground), dimmed status backgrounds (successDim, warningDim,
errorDim, infoDim), git diff colors (diffAddition, diffAdditionBg,
diffDeletion, diffDeletionBg), overlay/interactive states (overlay,
overlayHeavy, hoverBg, activeBg), and shadow tokens to ThemeColors.

All 17 theme definitions populated with palette-appropriate values.
Light themes use black hover overlays and lighter shadows; dark/vibe
themes use white hover overlays with heavier shadows. CSS custom
property mappings, fallback themes, and tests updated accordingly.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@openasocket
Copy link
Author

Closing to validate all changes before resubmitting.

@openasocket openasocket deleted the fix/theme-integration branch February 15, 2026 01:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant