You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Codown has no coherent design system. The current UI is a patchwork that blocks UX polish and makes every new feature re-invent visuals:
Tokens are ad-hoc — client/src/index.css@theme defines ~20 raw colors (#27272a, #2d235e, #512ea8, …) with no semantic scale (no primary/secondary/success/warning/info hierarchy, no light/dark pairing, no spacing/type/radius scale). A large commented-out alternative palette sits unused — evidence of abandoned iteration.
Primitives ignore tokens — Alert (components/ui/Alert/alert.tsx:23) hardcodes bg-red-50 / border-red-200 / text-red-800 bypassing @theme entirely; Button/Input variants drift from each other (Button/variants.tsx vs Form/variants.ts). No single source for states (hover/focus/disabled/loading).
Inconsistent layout & typography — Inter loaded with only 400-italic + 700-normal, no type scale; pages compose ad-hoc Tailwind utilities without grid/spacing conventions.
Landing is a stub — app/routes/landing.tsx:25 is a single paragraph + green button (bg-green-400) unrelated to the dark @theme palette. Tracked separately in add cool landing page 〜( ̄▽ ̄〜) #17.
Adding features without a system just deepens the drift.
Goal
Introduce a proper, documented design system that makes Codown feel cohesive, accessible, and fast to build on — then migrate the app onto it incrementally.
Scope
1. Design tokens (single source of truth)
Semantic color system: background / surface / primary / secondary / accent / destructive / success / warning / info + foreground/border/muted variants, with light & dark modes (CSS variables, prefers-color-scheme + manual toggle if desired).
Spacing, radius, shadow, and typography scales (e.g. --radius-sm/md/lg, --spacing-*, type ramp for display / heading / body / caption).
Consolidate index.css@theme — remove dead commented palette, document each token.
Each primitive: variants via cva, token-driven (no hardcoded Tailwind colors), full state coverage (default/hover/focus/active/disabled/loading), a11y (keyboard, ARIA, focus ring via --color-ring), and Storybook stories with autodocs.
Add missing foundations if needed: Card, Badge, Tabs, Tooltip, EmptyState, PageHeader — only those justified by actual pages (dashboard, editor, auth).
Fix Alert to use theme tokens (remove red-50 etc.) as a first migration example.
3. Layout & page templates
App shell (header + content + sidebar where applicable), page grid, and responsive breakpoints.
Rebuild landing.tsx on the new system: hero, feature highlights (real-time collaboration, markdown preview, Yjs sync), social proof/screenshots placeholder, CTA tied to auth state. Should consume primitives, not one-off classes.
5. Documentation & tooling
Storybook as the system’s living docs (controls, a11y addon, design-token docs page).
Short docs/client/design-system.md describing token philosophy, component conventions (folder-per-component, PascalCase dirs / kebab-case files, tags: ['\''autodocs'\'']), and migration guide for future components.
Optional: Figma or token JSON export if a designer is involved — not required for v1.
Acceptance criteria
Token file (index.css@theme or extracted tokens.css) documents every semantic color/spacing/type/radius token with light/dark values; no hardcoded palette colors remain in ui/*.
All ui/* primitives render correctly in both themes and pass Storybook a11y checks; Alert/Button/Input stories cover every variant/state.
Dashboard, editor, auth, landing, 404, and error-boundary routes consume only system tokens/primitives (no ad-hoc bg-green-400 etc.).
Landing page no longer a stub — ships a real hero/features/CTA built from primitives.
docs/client/design-system.md exists and Storybook docs reflect the system.
No visual regression in existing Playwright/E2E flows (auth, dashboard, editor, sharing, collaboration).
Client stack stays React 19 + Vite 7 + Tailwind 4 + Radix + CVA — no new UI framework; prefer evolving cva variants over introducing another abstraction.
Keep client/eslint.config.js conventions: folder-per-component, import/order, JSDoc on exports. Every new primitive needs component-name.stories.tsx with tags: ['\''autodocs'\''].
Migrate incrementally — token pass first, then primitives, then pages — so PRs stay reviewable.
Problem
Codown has no coherent design system. The current UI is a patchwork that blocks UX polish and makes every new feature re-invent visuals:
client/src/index.css@themedefines ~20 raw colors (#27272a,#2d235e,#512ea8, …) with no semantic scale (noprimary/secondary/success/warning/infohierarchy, no light/dark pairing, no spacing/type/radius scale). A large commented-out alternative palette sits unused — evidence of abandoned iteration.Alert(components/ui/Alert/alert.tsx:23) hardcodesbg-red-50 / border-red-200 / text-red-800bypassing@themeentirely;Button/Inputvariants drift from each other (Button/variants.tsxvsForm/variants.ts). No single source for states (hover/focus/disabled/loading).Interloaded with only 400-italic + 700-normal, no type scale; pages compose ad-hoc Tailwind utilities without grid/spacing conventions.app/routes/landing.tsx:25is a single paragraph + green button (bg-green-400) unrelated to the dark@themepalette. Tracked separately in add cool landing page 〜( ̄▽ ̄〜) #17.Adding features without a system just deepens the drift.
Goal
Introduce a proper, documented design system that makes Codown feel cohesive, accessible, and fast to build on — then migrate the app onto it incrementally.
Scope
1. Design tokens (single source of truth)
background / surface / primary / secondary / accent / destructive / success / warning / info+ foreground/border/muted variants, with light & dark modes (CSS variables,prefers-color-scheme+ manual toggle if desired).--radius-sm/md/lg,--spacing-*, type ramp fordisplay / heading / body / caption).index.css@theme— remove dead commented palette, document each token.@theme+tw-animate-cssintegration remains correct (no duplicate definitions).2. Primitive component library (
client/src/components/ui/*)Button,Input/Form,Alert,Avatar,Dropdown,Modal,Header,Skeleton,Spinner,Toast,ToggleGroup,Seo.cva, token-driven (no hardcoded Tailwind colors), full state coverage (default/hover/focus/active/disabled/loading), a11y (keyboard, ARIA, focus ring via--color-ring), and Storybook stories withautodocs.Card,Badge,Tabs,Tooltip,EmptyState,PageHeader— only those justified by actual pages (dashboard, editor, auth).Alertto use theme tokens (removered-50etc.) as a first migration example.3. Layout & page templates
4. Landing page (#17)
landing.tsxon the new system: hero, feature highlights (real-time collaboration, markdown preview, Yjs sync), social proof/screenshots placeholder, CTA tied to auth state. Should consume primitives, not one-off classes.5. Documentation & tooling
docs/client/design-system.mddescribing token philosophy, component conventions (folder-per-component, PascalCase dirs / kebab-case files,tags: ['\''autodocs'\'']), and migration guide for future components.Acceptance criteria
index.css@themeor extractedtokens.css) documents every semantic color/spacing/type/radius token with light/dark values; no hardcoded palette colors remain inui/*.ui/*primitives render correctly in both themes and pass Storybook a11y checks;Alert/Button/Inputstories cover every variant/state.bg-green-400etc.).docs/client/design-system.mdexists and Storybook docs reflect the system.Out of scope (follow-ups welcome)
tw-animate-cssshake etc. from Share dialog: graceful revert to last working link when a refetch fails #81).Constraints & notes
cvavariants over introducing another abstraction.client/eslint.config.jsconventions: folder-per-component,import/order, JSDoc on exports. Every new primitive needscomponent-name.stories.tsxwithtags: ['\''autodocs'\''].Related
Toast/Alert/EmptyStatefrom the system