mirror of
https://github.com/Memo-2023/mana-monorepo.git
synced 2026-05-20 22:06:42 +02:00
SUMMARY: Create a unified theming architecture with two new shared packages (@manacore/shared-theme and @manacore/shared-theme-ui) that provides consistent theming across all 4 web applications while allowing app-specific primary color customization. NEW PACKAGES: @manacore/shared-theme: - Svelte 5 Runes-based theme store factory - 4 theme variants: Lume (Gold), Nature (Green), Stone (Blue Gray), Ocean (Blue) - 3 theme modes: Light, Dark, System (auto-detect) - HSL-based color system with 18 semantic tokens - localStorage persistence per app - System preference detection via matchMedia - Pre-defined configs for all apps (memoro, manacore, manadeck, maerchenzauber) @manacore/shared-theme-ui: - ThemeToggle: Light/dark mode toggle button - ThemeSelector: Visual theme variant selector with color dots - ThemeModeSelector: Segmented control for light/dark/system UPDATED PACKAGES: @manacore/shared-tailwind: - Converted from HEX to HSL-based CSS variables - Updated preset.js with hsl(var(--color-*)) syntax - themes.css now contains all 4 theme variants with light/dark modes APP MIGRATIONS: memoro/web: - Replaced 145 LOC theme store with 25 LOC shared implementation - Deleted local ThemeSelector.svelte and ThemeToggle.svelte - Primary color: Gold (47 95% 58%) manacore/web: - Replaced 80 LOC theme store with 25 LOC shared implementation - Deleted local ThemeToggle.svelte - Primary color: Indigo (239 84% 67%) manadeck/web: - Added new theme store using shared package - Primary color: Indigo (239 84% 67%) maerchenzauber/web: - Added new theme store using shared package - Primary color: Purple (280 60% 55%) All app layouts updated with theme.initialize() in onMount. BENEFITS: - ~225 LOC of app-specific code reduced to ~100 LOC total - Single source of truth for theme logic - Consistent theming experience across all apps - Easy to add new theme variants - App-specific primary colors preserved 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
25 lines
606 B
TypeScript
25 lines
606 B
TypeScript
/**
|
|
* Memoro Theme Store
|
|
*
|
|
* Uses the shared theme system with Memoro's gold primary color.
|
|
*/
|
|
import { createThemeStore } from '@manacore/shared-theme';
|
|
|
|
// Re-export types for convenience
|
|
export type { ThemeMode, ThemeVariant, EffectiveMode } from '@manacore/shared-theme';
|
|
|
|
/**
|
|
* Memoro theme store instance
|
|
*
|
|
* - Default variant: lume (gold)
|
|
* - Custom primary: Gold (#f8d62b)
|
|
* - All 4 theme variants available
|
|
*/
|
|
export const theme = createThemeStore({
|
|
appId: 'memoro',
|
|
defaultVariant: 'lume',
|
|
primaryColor: {
|
|
light: '47 95% 58%', // Gold #f8d62b
|
|
dark: '47 95% 58%',
|
|
},
|
|
});
|