# Design System — Read before generating UI Decide how the app looks before you build features, then build every screen from that decision. The React starter from `somewhere init` gives you the pieces: design tokens in `src/styles/tokens.css`, shared classes in `src/styles/app.css`, and ready components in `src/ui/`. Choose a visual idea that fits your audience, record it in `DESIGN.md`, and set the starter's colors and fonts to match. Build one screen with its loading, empty and error states before adding features. Reuse those tokens and components on the next screen so the app keeps the same look. Deploy the raw source to check the result on a phone; the platform compiles it for you. ## Decide the look first Write the decision down in a short `DESIGN.md` at the project root, before the first feature. Keep it to a few lines your agent can reread every session: - **Audience** — who uses the app and where (a nurse between shifts, a collector browsing at night). - **One distinctive idea** — something specific enough to recognize. "Library card: cream paper, oxblood accent, serif headings" works; "clean and modern" describes every app. - **Palette, type and layout** — the token values you chose and why. - **Components** — which starter components you use as they are, and what you add. ```md # DESIGN.md — reading list Audience: readers keeping a shelf of books to read next, mostly on a phone. Idea: a library card — cream paper, an oxblood accent, a serif display face. Palette: --color-bg #f6f0e4, --color-accent #7a1f2b; neutrals stay warm. Type: Iowan Old Style for headings, Avenir Next for body text. Layout: one centered column; each book is a .panel row. Components: AppShell and AuthCard as shipped; EmptyState for an empty shelf. ``` Point to it from the starter's `AGENTS.md` so every session reads it. A root `.md` file stays on your machine: `somewhere deploy` publishes it only if your app references it or you opt it in with `somewhere deploy --include DESIGN.md` (or a `!DESIGN.md` line in `.somewhereignore`). ## Start from the starter | File | What it holds | |---|---| | `src/styles/tokens.css` | The design values, as custom properties on `:root`, with a light block and a dark block. | | `src/styles/app.css` | The classes the kit renders and the shared ones (`.panel`, `.muted`, `.hint`, `.error`), all reading the tokens. | | `src/ui/` | The UI kit: `Button`, `TextField`, `SelectField`, `TextareaField`, `CheckboxField`, `FormRow`, `Card`, `Table`, `Stat`, `Badge`, `Tabs`, `Dialog`, `Notice`, `Skeleton`, `Stack`, `Grid`, `Inline`, `PageHeader`; plus `AppShell` (the frame), `AuthCard` (sign-in) and `feedback.tsx` (`Alert`, `EmptyState`). | | `src/pages/HomePage.tsx` | A worked example of the kit: a header with the one main action, a stat row, a table in a card, a dialog form. Copy its shape. | Set your design in `tokens.css` first; the starter's classes and components read it. Reuse them before writing new ones, and have new components read the same tokens, so a new screen carries the look instead of restating it. Full guide: https://somewhere.cloud/docs/design-system.txt Deploy the `.tsx`, `.css` and `.html` source; the platform compiles it.