docs: Restructure styling documentation and add theme toggle docs
- Simplify CLAUDE.md from ~460 to ~145 lines with imports - Add Theme System section to css-design-system.md (3 modes: auto/light/dark) - Document theme toggle UI, localStorage persistence, CSS priority order - Add paths: frontmatter to authentication.md and company-period.md - Update DESIGN_TOKENS.md Dark Mode section with toggle documentation - Clean auto-build-memory.md header (remove non-existent auto-sync reference) - Remove non-existent plugin from settings.json 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -14,20 +14,36 @@ paths: src/modules/**/*.{vue,css}
|
||||
- Check `CSS_PATTERNS.md` BEFORE writing any CSS
|
||||
- Import shared styles from `shared/frontend/styles/`
|
||||
|
||||
## Dark Mode Support (CRITICAL)
|
||||
Dark mode is ACTIVE via `@media (prefers-color-scheme: dark)`.
|
||||
## Theme System (3 Modes) - CRITICAL
|
||||
|
||||
**Use semantic surface tokens for backgrounds:**
|
||||
ROA2WEB are **theme toggle în header**: auto → light → dark
|
||||
|
||||
| Mode | Comportament | CSS Selector |
|
||||
|------|--------------|--------------|
|
||||
| `auto` | Urmează preferința OS | `@media (prefers-color-scheme: dark)` |
|
||||
| `light` | Forțează light mode | `[data-theme="light"]` pe `<html>` |
|
||||
| `dark` | Forțează dark mode | `[data-theme="dark"]` pe `<html>` |
|
||||
|
||||
**Detalii implementare:**
|
||||
- **Toggle:** `AppHeader.vue` (lines 137-175)
|
||||
- **Persistență:** `localStorage['user-theme']` (valori: 'light', 'dark', sau absent=auto)
|
||||
- **CSS Priority:** `[data-theme]` > `@media (prefers-color-scheme)` > default light
|
||||
|
||||
**Testare OBLIGATORIE:**
|
||||
1. Click buton temă în header (ciclează auto→light→dark)
|
||||
2. DevTools → Rendering → Emulate CSS media → prefers-color-scheme: dark
|
||||
|
||||
**Semantic surface tokens (funcționează în TOATE modurile):**
|
||||
| Token | Light | Dark | Use For |
|
||||
|-------|-------|------|---------|
|
||||
| `--surface-card` | white | dark | Card/container backgrounds |
|
||||
| `--surface-ground` | light gray | darker | Page background |
|
||||
| `--surface-hover` | hover gray | dark hover | Hover states |
|
||||
| `--surface-border` | light border | dark border | Borders |
|
||||
| `--text-color` | dark | light | Primary text |
|
||||
| `--text-color-secondary` | gray | light gray | Secondary text |
|
||||
| `--surface-card` | white | #1e293b | Card/container backgrounds |
|
||||
| `--surface-ground` | #f8fafc | #0f172a | Page background |
|
||||
| `--surface-hover` | #f1f5f9 | #334155 | Hover states |
|
||||
| `--surface-border` | #e2e8f0 | #475569 | Borders |
|
||||
| `--text-color` | #111827 | #f9fafb | Primary text |
|
||||
| `--text-color-secondary` | #6b7280 | #d1d5db | Secondary text |
|
||||
|
||||
**For status colors, use scales:**
|
||||
**Status colors (scales 50-900):**
|
||||
- Success: `--green-50` to `--green-900` (bg: 50/100, text: 500/600)
|
||||
- Warning: `--yellow-50` to `--yellow-900`
|
||||
- Error: `--red-50` to `--red-900`
|
||||
@@ -79,4 +95,4 @@ color: var(--red-600); /* Error text */
|
||||
- Use hardcoded colors like `#2563eb` (use `var(--color-primary)`)
|
||||
- Use hardcoded backgrounds like `#ffffff` or `white` (use `var(--surface-card)`)
|
||||
- Create scoped CSS for patterns that already exist in shared files
|
||||
- Forget dark mode - always test with `prefers-color-scheme: dark`
|
||||
- **Skip theme testing** - ALWAYS test cu toggle (auto/light/dark) + DevTools dark mode
|
||||
|
||||
Reference in New Issue
Block a user