Skip to content

Conversation

@tknecht
Copy link

@tknecht tknecht commented Sep 24, 2025

🔍 Summary

Type: Feature Enhancement
Status: Draft - Awaiting Senior Developer Review
Breaking Changes: None

Introducing dark mode theming system to Hailstorm with case study migration of 3 components.

📋 Changes Overview

Infrastructure Added

  • CSS custom properties for semantic color tokens
  • ThemeProvider component with localStorage persistence
  • useTheme hook for programmatic control
  • Documentation in docs/THEMING.md

Components Migrated (Case Study)

Component Changes Dark Mode Story
Dialog Added hasCloseButton prop, migrated to semantic tokens ✅ Added
Button Updated secondary/minimal variants to use semantic tokens ✅ Added
Alert Simplified text colors using opacity ✅ Added

🧪 Testing Evidence

pnpm run format:check  # ✅ Passing
pnpm run lint          # ✅ Passing  
pnpm run type-check    # ✅ Passing
pnpm run build         # ✅ Passing

📊 Impact Analysis

  • Files Changed: 7
  • Lines Added: 178
  • Lines Removed: 23
  • Components Affected: 3 (as case study)
  • Remaining Components: ~35 (pending approval)

✅ Checklist

  • Tests pass locally
  • No new warnings/errors introduced
  • Documentation updated
  • Storybook stories added
  • Backwards compatible
  • Senior developer review
  • Approved for full migration

🎯 Next Steps (Pending Approval)

  1. Migrate remaining components if approach approved
  2. Add theme toggle to TopBar
  3. Test with production applications
  4. Update component documentation

❓ Review Questions

  1. Semantic token naming acceptable? (background, foreground, border)
  2. Keep intent colors static across themes? (danger/warning/success)
  3. Migration approach suitable for remaining components?
  4. Any performance concerns with CSS variables?

📸 Visual Testing

Run Storybook to see dark mode in action:

pnpm run dev

Navigate to:

  • Dialog → DarkMode story
  • Button → DarkMode story
  • Alert → DarkMode story

Note: This is a draft PR for architectural review. No production deployment intended until approved.

tknecht and others added 2 commits September 24, 2025 23:08
- Added semantic color CSS variables that adapt to theme (light/dark)
- Created ThemeProvider component for theme management
- Added useTheme hook for programmatic theme control
- Migrated Dialog component to use semantic color tokens
- Added dark mode story to Dialog Storybook examples
- Created comprehensive theming documentation

The theming system uses CSS custom properties that automatically adjust
based on the active theme. This provides a foundation for full dark mode
support and compatibility with shadcn/ui components.

Breaking Changes: None - fully backward compatible

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>
- Updated Button component to use semantic color tokens for secondary, minimal, and danger-secondary variants
- Updated Alert component to remove hardcoded text colors, using opacity for subtlety
- Added DarkMode stories for Button and Alert components to showcase theme switching
- Fixed ThemeProvider context value memoization for performance

This serves as a case study for migrating the remaining components to the new theming system.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants