# KonCad UI redesign — design Refresh the KonCad web UI with a "Soft Slate" visual style (GitHub / Notion-dark inspired), light/dark via `prefers-color-scheme`, lightweight inline syntax highlighting for the Caddyfile editors, and a handful of small UX wins. No backend changes; same single-file PHP structure. ## Goals - A modern, calm, information-dense look that fits a homelab tool you open occasionally. - Auto-respect the OS color-scheme preference (no manual toggle). - Make the Caddyfile editors readable at a glance with simple syntax colors. - Add a small set of polish improvements that the new look invites — without changing what the app does or its data flow. ## Non-goals - No changes to PHP backend logic (parser, save handler, upstream check, auth model). - No new dependencies. Stays a single-file PHP tool — no CDN, no build step. - No structural rework — header / global panel / list of sites stays. - No new features (no draft staging, no diff view, no per-directive forms, no bulk site operations, no manual theme toggle). - No editor features beyond highlighting (no line numbers, no bracket matching, no autocomplete). ## Visual system CSS custom properties on `:root` for dark, overridden inside `@media (prefers-color-scheme: light)`. Both auth screens and the main page use the same token set. | Token | Dark | Light | Used for | |---|---|---|---| | `--bg` | `#0d1117` | `#f6f8fa` | page background | | `--surface` | `#161b22` | `#ffffff` | panels, cards | | `--surface-2` | `#0d1117` | `#f6f8fa` | editor / nested surfaces | | `--border` | `#21262d` | `#d0d7de` | every divider | | `--text` | `#e6edf3` | `#1f2328` | primary text | | `--muted` | `#7d8590` | `#656d76` | labels, subtle text | | `--accent` | `#58a6ff` | `#0969da` | links, focus, addresses | | `--accent-bg` | `rgba(88,166,255,0.12)` | `rgba(9,105,218,0.1)` | accent backgrounds, focus ring | | `--ok` | `#3fb950` | `#1a7f37` | success status | | `--warn` | `#d29922` | `#9a6700` | warnings | | `--error` | `#f85149` | `#cf222e` | errors | **Type:** Inter via system stack (`-apple-system, "Segoe UI", "Inter", system-ui, sans-serif`); JetBrains Mono for code (with monospace fallback). Sizes: 13px base, 12px secondary, 11px labels/badges. **Geometry:** 8px radius on inputs/buttons, 10px on panels. 1px borders throughout — no drop shadows. Focus ring: `0 0 0 3px var(--accent-bg)` on inputs and buttons. Spacing on a 4px grid. ## Layout Same three regions as today. ### Header (sticky) - Left: a small (18×18) gradient square logo mark + "KonCad" word in 700 weight, `-0.01em` letter-spacing. - Center: a status pill — `● Caddy ready` (green) on success, `● Caddy unreachable` (red) when the admin API is down, `● Deploying…` (amber, with a 1.4s pulse animation) during a deploy. Pill background uses a tinted version of its color. - Right: primary `Deploy` button (green, GitHub-style primary) and a quiet `Log out` ghost button when auth is enabled. ### Main column - `max-width: 960px` centered, 1.5rem horizontal padding. - **Global Options panel** — surface card with a header strip (`Global Options` title + a small grey badge counting non-blank, non-comment lines, e.g. `2 directives`). Body holds the highlighted editor. - **Sites section** — section title `Sites` with a `+ Add site` ghost button on the right, then a vertical list of site cards. ### Site card - **Collapsed**: chevron, address (mono, `--accent` color), a one-line summary chip (`→ host:port` if the body has a `reverse_proxy` line, else `N directives`), and a `Remove` ghost-danger button visible on hover. - **Expanded**: address bar, the highlighted editor, and any `upstream-warnings` rendering area (existing slot, restyled). ### Empty state for sites A dashed-border placeholder card replacing the current grey one-liner: small icon (`⊕` or similar), heading `No sites yet`, and an inline primary `+ Add site` button. ### Auth screens (setup / login) Same centered-card pattern, retoned to the new tokens. Logo mark + "KonCad" header, subtitle (`Create your login credentials` / `Sign in to continue`), form with one username + one password input and a primary submit button. Inline error message uses `--error`. ### Modals & toasts - **Upstream warning modal**: same content, retoned. Dark-mode backdrop gets `backdrop-filter: blur(4px)`. - **Toasts**: same triggers, restyled. Slide in with `transform: translateY(8px) → 0`, fade. Auto-dismiss at 5s (unchanged). ## Highlighted editor Textarea-overlay technique. Native cursor, undo, IME, copy/paste behavior is preserved; the highlighted layer is purely decorative. ### Markup per editor ```html
` and `