Skip to content

Commit c9a620b

Browse files
authored
feat(web): port design-system tokens + restyle components (#51)
* feat(mobile): BrushOverlay surface + MapLibre preview layer * refactor(mobile): cache preview color + doc brush overlay * feat(web): port design-system tokens + restyle components 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. * fix(web): gear icon position + size refinements * feat(web): self-host Manrope + JetBrains Mono via @fontsource-variable
1 parent ed0d202 commit c9a620b

17 files changed

Lines changed: 537 additions & 173 deletions

‎web/index.html‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,9 @@
1010
* { margin: 0; padding: 0; box-sizing: border-box; }
1111
html, body, #app { width: 100%; height: 100%; }
1212
body {
13-
font-family: Inter, "Helvetica Neue", Helvetica, Arial, sans-serif;
13+
font-family: "Manrope Variable", Manrope, -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
14+
color: #14272F;
15+
background: #EEF0F2;
1416
}
1517
button, input, textarea, select {
1618
font: inherit;

‎web/package-lock.json‎

Lines changed: 20 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎web/package.json‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@
2626
"vitest": "^3.2.4"
2727
},
2828
"dependencies": {
29+
"@fontsource-variable/jetbrains-mono": "^5.2.8",
30+
"@fontsource-variable/manrope": "^5.2.8",
2931
"@turf/buffer": "^7.3.4",
3032
"@turf/helpers": "^7.3.4",
3133
"@versatiles/style": "^5.10.2",

‎web/src/App.svelte‎

Lines changed: 23 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -158,23 +158,37 @@
158158
}
159159
.user-bar {
160160
pointer-events: auto;
161-
background: white; padding: 8px 16px; border-radius: 8px;
162-
box-shadow: 0 2px 8px rgba(0,0,0,0.15);
163-
display: flex; gap: 12px; align-items: center; font-size: 14px;
161+
background: var(--panel);
162+
padding: 8px 16px;
163+
border-radius: var(--radius-chip);
164+
box-shadow: var(--shadow-panel);
165+
display: flex;
166+
gap: 12px;
167+
align-items: center;
168+
font: 600 14px/1.3 var(--font-sans);
169+
color: var(--ink);
164170
white-space: nowrap;
165171
}
166172
.user-bar button {
167-
background: none; border: none; color: #2563eb; cursor: pointer;
173+
background: none;
174+
border: none;
175+
color: var(--brand);
176+
cursor: pointer;
177+
font: 600 14px/1.3 var(--font-sans);
178+
padding: 0;
179+
}
180+
.user-bar button:hover {
181+
color: var(--ink);
168182
}
169183
170184
@media (max-width: 640px) {
171185
.top-panel {
172186
right: 12px;
173187
flex-direction: column;
174188
gap: 0;
175-
background: white;
176-
border-radius: 8px;
177-
box-shadow: 0 2px 8px rgba(0,0,0,0.15);
189+
background: var(--panel);
190+
border-radius: var(--radius-ctrl);
191+
box-shadow: var(--shadow-panel);
178192
pointer-events: auto;
179193
}
180194
.search-stack {
@@ -189,8 +203,8 @@
189203
font-size: 12px;
190204
background: none;
191205
box-shadow: none;
192-
border-radius: 0 0 8px 8px;
193-
border-top: 1px solid #f0f0f0;
206+
border-radius: 0 0 var(--radius-ctrl) var(--radius-ctrl);
207+
border-top: 1px solid var(--divider);
194208
}
195209
}
196210
</style>

‎web/src/components/AuthModal.svelte‎

Lines changed: 80 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -63,33 +63,99 @@
6363

6464
<style>
6565
.overlay {
66-
position: fixed; top: 0; left: 0; right: 0; bottom: 0;
67-
background: rgba(0,0,0,0.4); display: flex; align-items: center; justify-content: center;
66+
position: fixed;
67+
top: 0; left: 0; right: 0; bottom: 0;
68+
background: rgba(20, 40, 50, 0.4);
69+
display: flex;
70+
align-items: center;
71+
justify-content: center;
6872
z-index: 100;
6973
}
7074
.modal {
7175
position: relative;
72-
background: white; padding: 32px; border-radius: 12px; min-width: min(320px, calc(100vw - 32px));
73-
box-shadow: 0 4px 24px rgba(0,0,0,0.2);
76+
background: var(--panel);
77+
padding: 32px;
78+
border-radius: var(--radius-panel);
79+
min-width: min(320px, calc(100vw - 32px));
80+
box-shadow: var(--shadow-panel);
81+
color: var(--ink);
82+
font-family: var(--font-sans);
7483
}
7584
.close {
76-
position: absolute; top: 10px; right: 10px;
77-
width: 28px; height: 28px; border: none; border-radius: 6px;
78-
background: white; cursor: pointer; font-size: 20px; line-height: 1;
85+
position: absolute;
86+
top: 10px;
87+
right: 10px;
88+
width: 32px;
89+
height: 32px;
90+
border: none;
91+
border-radius: var(--radius-fab);
92+
background: var(--bg);
93+
color: var(--ink-muted);
94+
cursor: pointer;
95+
font-size: 20px;
96+
line-height: 1;
97+
display: inline-flex;
98+
align-items: center;
99+
justify-content: center;
100+
}
101+
.close:hover {
102+
color: var(--ink);
103+
}
104+
h2 {
105+
margin-bottom: 16px;
106+
font: 600 17px/1.3 var(--font-sans);
107+
color: var(--ink);
79108
}
80-
h2 { margin-bottom: 16px; }
81109
form { display: flex; flex-direction: column; gap: 12px; }
82110
input {
83-
padding: 10px 12px; border: 1px solid #ccc; border-radius: 6px; font-size: 16px;
111+
padding: 10px 12px;
112+
border: 1px solid var(--divider);
113+
border-radius: var(--radius-ctrl);
114+
font: 500 15px/1.4 var(--font-sans);
115+
color: var(--ink);
116+
background: var(--panel);
117+
}
118+
input:focus {
119+
outline: 2px solid var(--brand);
120+
outline-offset: -1px;
121+
border-color: var(--brand);
122+
}
123+
input::placeholder {
124+
color: var(--ink-faint);
84125
}
85126
button[type="submit"] {
86-
padding: 10px; background: #2563eb; color: white; border: none;
87-
border-radius: 6px; cursor: pointer; font-size: 14px;
127+
padding: 12px 14px;
128+
background: var(--ink);
129+
color: var(--panel);
130+
border: none;
131+
border-radius: var(--radius-ctrl);
132+
cursor: pointer;
133+
font: 700 15px/1.3 var(--font-sans);
134+
}
135+
button[type="submit"]:hover:not(:disabled) {
136+
opacity: 0.92;
88137
}
89138
button[type="submit"]:disabled { opacity: 0.5; }
90-
.error { color: #dc2626; font-size: 13px; margin: 0; }
91-
.switch { margin-top: 12px; font-size: 13px; text-align: center; }
92-
.link { background: none; border: none; color: #2563eb; cursor: pointer; text-decoration: underline; }
139+
.error {
140+
color: #b91c1c;
141+
font: 500 13px/1.3 var(--font-sans);
142+
margin: 0;
143+
}
144+
.switch {
145+
margin-top: 12px;
146+
font: 500 13px/1.3 var(--font-sans);
147+
color: var(--ink-muted);
148+
text-align: center;
149+
}
150+
.link {
151+
background: none;
152+
border: none;
153+
color: var(--brand);
154+
cursor: pointer;
155+
text-decoration: underline;
156+
font: 600 13px/1.3 var(--font-sans);
157+
padding: 0;
158+
}
93159
94160
@media (max-width: 640px) {
95161
.modal {

‎web/src/components/PreferencesPanel.svelte‎

Lines changed: 18 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -94,16 +94,17 @@
9494
.preferences-panel {
9595
margin-top: 8px;
9696
padding-top: 10px;
97-
border-top: 1px solid #e5e7eb;
98-
color: #111827;
97+
border-top: 1px solid var(--divider);
98+
color: var(--ink);
99+
font-family: var(--font-sans);
99100
}
100101
.preference-row {
101102
display: flex;
102103
align-items: flex-start;
103104
justify-content: space-between;
104105
gap: 16px;
105106
margin-bottom: 10px;
106-
font-size: 14px;
107+
font: 500 14px/1.3 var(--font-sans);
107108
}
108109
.preference-copy {
109110
min-width: 0;
@@ -112,55 +113,53 @@
112113
.preference-copy label {
113114
display: block;
114115
margin: 0;
115-
font-weight: 600;
116-
line-height: 1.2;
116+
font: 600 14px/1.3 var(--font-sans);
117+
color: var(--ink);
117118
}
118119
.preference-copy p {
119120
margin: 4px 0 0;
120-
color: #6b7280;
121-
font-size: 12px;
122-
line-height: 1.35;
121+
color: var(--ink-muted);
122+
font: 500 12px/1.35 var(--font-sans);
123123
}
124124
.preference-row-spaced {
125125
margin-top: 16px;
126126
}
127127
.preference-row span {
128128
min-width: 52px;
129129
text-align: right;
130-
line-height: 1.2;
130+
font: 600 12px/1.2 var(--font-mono);
131+
color: var(--ink-muted);
131132
padding-top: 1px;
132133
}
133134
input[type='range'] {
134135
width: 100%;
135-
accent-color: #059669;
136+
accent-color: var(--brand);
136137
}
137138
.scale-labels {
138139
display: flex;
139140
justify-content: space-between;
140141
margin-top: 4px;
141-
color: #6b7280;
142-
font-size: 12px;
142+
color: var(--ink-faint);
143+
font: 500 12px/1.3 var(--font-sans);
143144
}
144145
.credits {
145146
margin-top: 18px;
146147
padding-top: 12px;
147-
border-top: 1px solid #e5e7eb;
148+
border-top: 1px solid var(--divider);
148149
}
149150
.credits p {
150151
margin: 0 0 8px;
151-
color: #6b7280;
152-
font-size: 12px;
153-
line-height: 1.35;
152+
color: var(--ink-muted);
153+
font: 500 12px/1.35 var(--font-sans);
154154
}
155155
.credit-links {
156156
display: flex;
157157
flex-wrap: wrap;
158158
gap: 8px 12px;
159159
}
160160
.credit-links a {
161-
color: #2563eb;
162-
font-size: 12px;
163-
line-height: 1.35;
161+
color: var(--brand);
162+
font: 500 12px/1.35 var(--font-sans);
164163
text-decoration: none;
165164
}
166165
.credit-links a:hover {

‎web/src/components/RoutePanel.svelte‎

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,15 +30,24 @@
3030

3131
<style>
3232
.route-panel {
33-
background: white; padding: 10px 16px; border-radius: 8px;
34-
box-shadow: 0 2px 8px rgba(0,0,0,0.15);
35-
font-size: 14px; display: flex; gap: 8px; align-items: center;
33+
background: var(--panel);
34+
padding: 10px 16px;
35+
border-radius: var(--radius-panel);
36+
box-shadow: var(--shadow-panel);
37+
font: 600 12px/1.3 var(--font-mono);
38+
color: var(--ink-muted);
39+
display: flex;
40+
gap: 8px;
41+
align-items: center;
3642
white-space: nowrap;
3743
}
38-
.sep { color: #999; }
44+
.sep { color: var(--ink-faint); }
3945
.spinner {
40-
width: 14px; height: 14px; border-radius: 50%;
41-
border: 2px solid #d1d5db; border-top-color: #155e75;
46+
width: 14px;
47+
height: 14px;
48+
border-radius: 50%;
49+
border: 2px solid var(--divider);
50+
border-top-color: var(--brand);
4251
animation: spin 0.8s linear infinite;
4352
display: inline-block;
4453
}

0 commit comments

Comments
 (0)