# Design Tokens Proposal - Executive Summary **TL;DR:** Schaffe Vereinheitlichung durch **shared design tokens**, nicht durch shared components. --- ## 🎯 Problem **3 Apps, 3 verschiedene Styling-Ansätze:** | App | Colors | Problem | |-----|--------|---------| | Mobile | Theme System (3 Varianten) | ✅ Gut strukturiert | | Web | Hardcoded in Components | ❌ Keine Konsistenz | | Landing | Hardcoded in Components | ❌ Keine Konsistenz | **Beispiel:** ```typescript // Mobile: #818cf8 (indigo-400) // Web: #2563eb (blue-600) // Landing: gradient purple-400 → pink-400 // Alle meinen "primary blue", aber unterschiedliche Werte! ``` --- ## ✅ Lösung: Shared Design Tokens ### Was sind Design Tokens? **Zentrale Definition von Design-Entscheidungen:** ```typescript // Ein Token... export const primary = '#818cf8'; // ...wird überall verwendet: // Mobile: backgroundColor: tokens.primary // Web: class="bg-[var(--color-primary)]" // Landing: class="text-primary-500" ``` **Vorteil:** Ein Update, alle Apps konsistent! 🎉 --- ## 📦 Vorgeschlagene Struktur ``` packages/ └── design-tokens/ ├── src/ │ ├── colors.ts # Farben (dark/light, themes) │ ├── spacing.ts # Abstände (4, 8, 12, 16...) │ ├── typography.ts # Schriften (sizes, weights) │ ├── themes/ │ │ ├── default.ts # Standard Theme │ │ ├── sunset.ts # Orange/Pink │ │ └── ocean.ts # Blue/Teal │ └── index.ts ├── tailwind/ │ └── preset.js # Tailwind Preset ├── native/ │ └── theme.ts # React Native Helpers └── package.json ``` --- ## 🎨 Beispiel: Color Tokens ```typescript // packages/design-tokens/src/colors.ts export const semanticColors = { dark: { background: '#000000', surface: '#242424', border: '#383838', primary: { default: '#818cf8', // indigo-400 hover: '#a5b4fc', // indigo-300 active: '#6366f1', // indigo-500 }, text: { primary: '#f3f4f6', secondary: '#d1d5db', tertiary: '#9ca3af', }, }, light: { // ... light mode colors }, }; ``` **Dann in allen Apps:** ```typescript // Mobile import { semanticColors } from '@memoro/design-tokens'; const bg = semanticColors.dark.background; // Web (Svelte) import { semanticColors } from '@memoro/design-tokens'; const theme = semanticColors.dark; // Landing (Astro + Tailwind) // Automatically available via Tailwind preset
``` --- ## 🚀 Implementation ### 1. Mobile App ✅ ```typescript // Already has theme system, just replace hardcoded values // Before colors: { background: '#000000' } // After import { semanticColors } from '@memoro/design-tokens'; colors: semanticColors.dark ``` ### 2. Web App 🔨 ```svelte