Skip to content

feat(web): port design-system tokens + restyle components - #51

Merged
cafca merged 5 commits into
mainfrom
claude/keen-easley-80ab91
Apr 23, 2026
Merged

feat(web): port design-system tokens + restyle components#51
cafca merged 5 commits into
mainfrom
claude/keen-easley-80ab91

Conversation

@cafca

@cafca cafca commented Apr 23, 2026

Copy link
Copy Markdown
Owner

Summary

  • Ports the design-system tokens + typography from the Apr 2026 handoff (aqua brand, light-grey bg, panel shadows, radius scale, Manrope + JetBrains Mono) into the Svelte web app.
  • Restyles existing components surface-only — no layout, behavior, or DOM-tree changes. Tests untouched; all 71 vitest cases green.
  • Mobile unchanged: bicycle-style.js and the mobile style JSON are deliberately left alone, so there's no ripple into Flutter.

What changed

New

  • web/src/lib/tokens.js — JS export of colors / radii / shadows / spacing (for programmatic use, e.g. inline SVG fills).
  • web/src/styles/tokens.css:root CSS custom properties + typography role classes (.t-body, .t-mono-time, .t-eyebrow, …). Imported from main.js.
  • web/src/lib/PaintRollerIcon.svelte — inline SVG per spec § Paint FAB (yellow roller head + ink frame/handle). Used by the Toolbar paint-mode toggle.

Fonts (self-hosted)

  • Manrope + JetBrains Mono via @fontsource-variable/* npm packages, imported from main.js. Vite bundles subset woff2 files into dist/assets/. No Google Fonts runtime fetch; Fraunces (display-only in spec) skipped intentionally.

Restyled

  • App.svelte user-bar pill → panel surface + chip radius + shadow-panel.
  • SearchBar.svelte → panel card, 20 px radius, shadow-panel, aqua origin dot, route-ink destination dot. Gear icon vertically centered on the first row, symmetric 11 px inset.
  • RoutePanel.svelte → panel surface + JB Mono data strip.
  • Toolbar.svelte → panel + border + shadow-sm; paint toggle uses PaintRollerIcon; active state uses brand-soft + brand ring.
  • PreferencesPanel.svelte → spec typography; slider accent → brand.
  • AuthModal.svelte / WelcomeModal.svelte → panel radius + panel shadow + ink primary buttons. Welcome sheet top corners 30 px on mobile.
  • ZoomControls.svelte → circular FABs with panel bg + shadow-sm.

Rating ramp

  • brush.svelte.js ratingTools + overlay.js fill/line colors now pull from colors.ramp in tokens.js (spec hex: #B8342E#0E7E72). Toolbar swatches and map overlay stay in sync.

Out of scope (intentionally)

  • No new BottomSheet / HomeSheet / Saved-list / dedicated Paint FAB behavior.
  • bicycle-style.js and the generated mobile/assets/styles/beebeebike-style.json are unchanged, so the map base colors still differ from the spec table. Follow-up can align map layer colors and regenerate the mobile artifact.
  • No i18n.

Test plan

  • just test-web — 16 files / 71 tests pass.
  • just build-web — production build clean; fonts bundled as woff2 subsets.
  • just preview and eyeball vs. design_handoff_landing_and_style_guide/landing.html:
    • Search card floating, panel shadow, 20 px radius, aqua origin icon, Manrope body (no Google Fonts network call).
    • Route panel mono strip.
    • Toolbar chrome: panel bg, radius-ctrl corners, yellow-headed paint roller toggle, brand active state.
    • Zoom controls: circular panel buttons with shadow-sm.
    • Auth / Welcome modals: 22 px radius, panel shadow, ink primary buttons.
    • Rating ramp: overlay colors on map match swatches in toolbar (both using spec ramp).
    • X (clear) button works when a route exists; gear click does not overlap clear.
  • Spot-check devtools ruler: radii 14 / 20 / 22, shadows match tokens.

cafca added 5 commits April 23, 2026 02:49
Introduce a token layer (CSS custom properties + JS export) and load
Manrope / JetBrains Mono fonts. Restyle existing components to use
spec tokens — aqua brand, light-grey bg, panel/sm shadows, radius
scale, typography roles — while keeping current layout, behavior,
and tests intact. Rating ramp swatches and map overlay now pull
from the spec ramp. Map style (bicycle-style.js) untouched so the
mobile style artifact stays in sync.

Also: gear icon in SearchBar grows 25% and centers vertically.
@cafca
cafca merged commit c9a620b into main Apr 23, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant