diff --git a/CLAUDE.md b/CLAUDE.md index 068ddbb..cafd896 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -88,6 +88,8 @@ When adding a feature: create `Features//Endpoints.cs` with a `Map(path, opts)` helper. Stores the JWT in `localStorage` under `token`, attaches `Authorization: Bearer …`, and on 401 it clears the token and `goto('/login')`. - `src/lib/auth.svelte.ts` — runes-based auth state. diff --git a/src/frontend/STYLE_GUIDE.md b/src/frontend/STYLE_GUIDE.md new file mode 100644 index 0000000..75e8fbd --- /dev/null +++ b/src/frontend/STYLE_GUIDE.md @@ -0,0 +1,71 @@ +# Frontend Style Guide + +Rules that apply to every component. Deviating from these requires an explicit reason. + +## Form controls + +All interactive inputs, selects, and textareas share one baseline class set so they look identical regardless of type: + +``` +rounded-lg border border-gray-300 bg-white px-3 py-2 text-sm +focus:border-primary focus:outline-none +``` + +| Variant | When to use | Size note | +|---|---|---| +| **Standard** (`px-3 py-2`) | Inline rows (qty, unit, section dropdowns, filters) | `text-sm` | +| **Large** (`px-3 py-2.5 text-base`) | Full-width, standalone inputs (item name, recipe title) | `text-base` | + +**Rules:** +- `bg-white` is **always explicit** on `