forked from OurHike/OurHike
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathchrome.css
More file actions
2117 lines (1901 loc) · 70.1 KB
/
Copy pathchrome.css
File metadata and controls
2117 lines (1901 loc) · 70.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
/* Map screen chrome. Sizes here are load-bearing, not decorative -
WIREFRAMES.md's "Load-bearing values" lists them explicitly:
42px map controls, 38px header buttons, >=44px effective touch targets.
The 38px/44px pair is not a contradiction. 38px is what is DRAWN, so the
header stays visually quiet; 44px is what can be HIT, which is the minimum
that stays usable for a cold, gloved, one-handed tap on a moving trail.
The gap is made up with an invisible expanded hit area rather than by
inflating the visible button. */
:root {
--map-control-size: 42px;
--header-button-size: 38px;
--min-touch-target: 44px;
}
.visually-hidden {
position: absolute;
width: 1px;
height: 1px;
padding: 0;
margin: -1px;
overflow: hidden;
clip-path: inset(50%);
white-space: nowrap;
border: 0;
}
/* ---------- Status strip ---------- */
.status-strip {
display: flex;
align-items: center;
gap: var(--space-3, 12px);
padding: 4px var(--space-4, 16px);
font-family: var(--font-mono, ui-monospace, monospace);
font-size: 11px;
color: var(--fg-3);
background: var(--bg-page);
}
.status-strip__conditions {
display: flex;
gap: var(--space-2, 8px);
flex: 1;
}
.status-strip__flag {
color: var(--danger);
font-weight: 600;
}
.status-strip__sync {
margin-left: auto;
}
/* ---------- Header (read-only zone) ---------- */
.map-header {
display: flex;
align-items: center;
justify-content: space-between;
gap: var(--space-4, 16px);
padding: var(--space-2, 8px) var(--space-4, 16px);
background: var(--bg-page);
border-bottom: 1px solid var(--border-1);
}
.map-header__identity {
display: flex;
align-items: center;
gap: 10px;
min-width: 0;
}
.map-header__eyebrow {
margin: 0;
font-size: 11px;
letter-spacing: 0.04em;
text-transform: uppercase;
color: var(--fg-3);
}
.map-header__trail-logo {
width: 36px;
height: 36px;
flex-shrink: 0;
}
.map-header__position {
margin: 2px 0 0;
font-family: var(--font-mono, ui-monospace, monospace);
font-size: 17px;
font-weight: 600;
color: var(--fg-1);
}
.map-header__actions {
display: flex;
/* WIREFRAMES.md: two 38px icon buttons, gap 7px. */
gap: 7px;
}
.map-header__button {
position: relative;
display: inline-flex;
align-items: center;
justify-content: center;
width: var(--header-button-size);
height: var(--header-button-size);
padding: 0;
color: var(--fg-2);
background: var(--bg-surface);
border: 1px solid var(--border-1);
border-radius: 10px;
cursor: pointer;
/* Design-system rule: fades and colour transitions only, 120-200ms. */
transition:
background-color 160ms ease,
color 160ms ease;
}
/* Expands the hit area from the drawn 38px to the required 44px without
changing what is drawn. */
.map-header__button::after {
content: '';
position: absolute;
inset: calc((var(--header-button-size) - var(--min-touch-target)) / 2);
}
.map-header__button:hover {
background: var(--bg-sunken);
color: var(--fg-1);
}
.map-header__button:active {
transform: scale(0.97);
}
/* ---------- Map canvas ---------- */
.map-view {
flex: 1;
min-height: 0;
position: relative;
/* The last line of defence against a black map, covering the window the
style's own background layer cannot: before WebGL has painted a first
frame, and if the context is lost or never obtained at all. Same paper as
MAP_BACKGROUND_COLOR - a literal rather than --bg-page since the field
sheet moved the map onto white paper while the chrome kept its cream, so
the token and the map parted ways. The dark pair below keeps the handover
invisible under the dark theme too (MAP_BACKDROP.dark). A hiker who picks
night_hike under a light theme gets one white pre-WebGL frame at boot;
CSS knows the theme and not the style preference, and matching the common
case per theme is the best a stylesheet can do. */
background: #ffffff;
}
:root[data-theme='dark'] .map-view {
/* MAP_BACKDROP.dark - night_hike's own ink, the sheet the default dark
path lands on now that every style carries its own backdrop. */
background: #0c1410;
}
/* MapLibre's own controls, sized to the 42px the wireframe specifies. */
.map-view .maplibregl-ctrl button {
width: var(--map-control-size);
height: var(--map-control-size);
}
/* The same controls under the dark theme.
*
* maplibre-gl.css hardcodes a white group with dark glyphs, and nothing in it
* asks about the theme - so on an ink map the locate and zoom buttons are the
* brightest thing on the screen by a wide margin, which at night is the one
* place brightness costs something real. Overridden here rather than forked
* out of the library stylesheet, which is imported wholesale by MapView.tsx
* for reasons that have nothing to do with colour.
*
* The glyphs are background-image data URIs, so they are inverted rather than
* recoloured: there is no property to reach into them with. `hue-rotate(180)`
* undoes the hue flip `invert` brings with it, which matters for the one
* control that is not monochrome - the geolocate button turns blue when it has
* a fix, and without this it would turn orange.
*
* THE EDGE IS THE PART THAT MATTERS, AND IT IS NOT THE PART THAT LOOKS WRONG
*
* These were reported as hard to read (#336), and the glyph was innocent: at
* `#ccc` it sits about 10.7:1 against the button. What had gone missing was the
* BUTTON. Two things, and the second is the one worth remembering.
*
* The chip was `--bg-surface`, which is a SCREEN surface - a token picked to
* sit on `--bg-page` in a settings list, not on a map. Against the canvas's own
* backdrop (`MAP_BACKDROP.dark`, #15140f) that is 1.06:1, so the control was
* very nearly the same colour as the map behind it.
*
* And maplibre-gl.css's only boundary for the group is
* `box-shadow: 0 0 0 2px rgba(0,0,0,.1)`. On paper that faint dark ring is what
* separates a white chip from the map. On ink it is DARKER than both surfaces
* and draws nothing at all - so overriding the background silently took the
* edge away too, and left grey glyphs floating with no affordance around them.
*
* Hence a light hairline rather than a darker one. Any dark chip on a dark map
* has low surface contrast; the edge has to carry the separation, and an edge
* made of translucent black cannot carry anything here. The lift stops at
* `--ink-700` (1.38:1) deliberately: the whole argument for this theme is a
* phone that does not cost night vision on a trail after dark
* (features/UX_CUSTOMIZATION.md), and a control bright enough to solve this by
* luminance alone would undo that. */
:root[data-theme='dark'] .map-view .maplibregl-ctrl-group {
background: var(--surface-over-map);
box-shadow:
0 0 0 1px var(--edge-over-map),
0 2px 12px rgb(0 0 0 / 60%);
}
:root[data-theme='dark'] .map-view .maplibregl-ctrl-group button + button {
border-top-color: var(--edge-over-map);
}
:root[data-theme='dark'] .map-view .maplibregl-ctrl-group button:hover {
background: var(--surface-over-map-hover);
}
:root[data-theme='dark'] .map-view .maplibregl-ctrl-icon {
filter: invert(1) hue-rotate(180deg);
}
/* A disabled control still has to say it is there. maplibre takes the icon to
25%, which on white leaves a legible pale grey and on this chip leaves very
nearly nothing - the zoom-in button at maximum zoom simply vanished. Raised
until it reads as present-and-off rather than absent, and no further: it must
still be obviously weaker than the button beside it. */
:root[data-theme='dark']
.map-view
.maplibregl-ctrl
button:disabled
.maplibregl-ctrl-icon {
opacity: 0.4;
}
/* The scale bar is drawn as a bordered box over the canvas, so it needs the
canvas's own colours rather than an inversion - and the same edge treatment,
for the same reason: its `border: 2px solid #333` is another boundary that
assumes something light behind it. */
:root[data-theme='dark'] .map-view .maplibregl-ctrl-scale {
color: var(--fg-1);
background: color-mix(in srgb, var(--surface-over-map) 82%, transparent);
border-color: var(--edge-over-map);
box-shadow: 0 2px 12px rgb(0 0 0 / 60%);
}
/* ---------- Tab bar ---------- */
.tab-bar {
display: flex;
background: var(--bg-surface);
border-top: 1px solid var(--border-1);
/* Keeps the bar clear of the home indicator on notched phones. */
padding-bottom: env(safe-area-inset-bottom, 0);
}
/* The tabs' own box, which exists so that `role="tablist"` can own tabs and
nothing else - the brand mark below is a sibling of it, not a member of the
set (see TabBar.tsx). Filling the bar is what keeps this inert on a phone:
the tabs still spread across the full width exactly as they did when they
were direct children of .tab-bar. */
.tab-bar__tabs {
display: flex;
flex: 1;
}
/* On a phone: the icon alone, at the left end of the bar - which is the
* bottom-left corner of the page, and the only corner here that is not either
* map or a thumb target.
*
* It costs the tabs about 32px of shared width. At 375px that leaves the two
* of them ~171px each against a 44px floor, so the targets are nowhere near
* pressed; it is still map-free real estate spent on branding, and worth
* knowing that is the trade. How much chrome this screen should carry at all
* is the larger question, tracked as its own spike.
*
* `order` rather than DOM order: the mark is last in the markup because on a
* desktop it is the foot of a column, and only here does it need to come
* first. */
.tab-bar__brand {
display: flex;
align-items: center;
order: -1;
padding-left: var(--space-2, 8px);
}
.tab-bar__brand-icon {
display: block;
width: 24px;
height: 24px;
/* The artwork's own corner radius at this size (20/96), so the element's box
matches the rounded square drawn inside it. */
border-radius: 5px;
}
/* Mirrors the wordmark half of the design system's Logo.jsx exactly - same
family, weight, tracking and colour - because the sidebar composes the
lockup from the icon plus this rather than rendering <Logo /> whole (see
TabBar.tsx for why). Anything that changes there changes here, or the app
grows two wordmarks that are almost the same, which looks like a mistake
rather than a choice.
`--font-display` resolves to Bitter. That is what Logo.jsx asks for and so
what the onboarding lockup already renders, whatever the design system's
prose says about Public Sans - matching the shipped component is the point
of this block, and a font change belongs upstream in the design system
rather than in a divergence started here. */
.tab-bar__brand-wordmark {
/* Desktop-only, revealed in desktop.css. A phone's bar is a 44px row with
three thumb targets in it; type beside them comes straight out of their
width, and the icon alone already says whose app this is. */
display: none;
font-family: var(--font-display, 'Public Sans', sans-serif);
font-weight: 800;
font-size: 32px;
letter-spacing: -0.02em;
line-height: 1;
color: var(--fg-1);
}
.tab-bar__tab {
flex: 1;
min-height: var(--min-touch-target);
padding: var(--space-2, 8px) 0;
font-size: 12px;
font-weight: 600;
color: var(--fg-3);
background: none;
border: 0;
border-top: 2px solid transparent;
cursor: pointer;
transition:
color 160ms ease,
border-color 160ms ease;
}
.tab-bar__tab[aria-selected='true'] {
color: var(--brand-primary);
border-top-color: var(--brand-primary);
}
/* ---------- Screen shell ---------- */
.map-screen {
display: flex;
flex-direction: column;
height: 100svh;
background: var(--bg-page);
}
/* First run: this screen is the backdrop to the onboarding steps, showing its
canvas and nothing else (#721, MapScreenProps.entering).
*
* HIDING IS BY EXCLUSION, NOT BY LIST, and that is the load-bearing choice
* here. Each rule hides every child of a wrapper except the one on the path
* down to the canvas, so a control added to this screen next year is hidden
* during first run by default. A list of class names would have gone stale the
* first time somebody added a button, and the failure mode is a stray control
* sitting behind a modal - which is the trap App.tsx's own reasoning rules out.
*
* `display: none` and not `visibility`/opacity: a hidden-but-laid-out header
* would still take its share of the column and leave the canvas short.
*
* None of this is what makes the screen safe to have behind a modal - `inert`
* on the root does that, in MapScreen.tsx. This is what makes it look like the
* plain canvas the steps are drawn over. */
.map-screen--entering > :not(.map-screen__main),
.map-screen--entering .map-screen__main > :not(.map-screen__body),
.map-screen--entering .map-screen__body > :not(.map-screen__canvas) {
display: none;
}
/* Inside the canvas the exception is the attribution, which is a licence
condition rather than chrome: the live sheet's OSM data is ODbL, so a map
that is drawn has to be credited whether or not anyone may touch it. The
canvas overlays that are not the map or that credit - the dropped-waypoint
count, the waypoint card, search - go with the rest. */
.map-screen--entering .map-screen__canvas > :not(.map-view):not(.map-attribution) {
display: none;
}
/* MapLibre's own controls - compass, locate, scale bar - are attached to every
map this app builds (map/mapChrome.ts) and are drawn in the bottom corners,
which is exactly where the entry card is. A picture of a button that cannot
be pressed is a worse thing to show someone than no button at all. They come
back, in the thumb zone, the moment the steps finish. */
.map-screen--entering .maplibregl-ctrl {
display: none;
}
/* Two wrappers that exist for the desktop layout (src/desktop.css) and are
deliberately inert here: each is a plain flex column that fills, which is
exactly what these children did as direct children of .map-screen.
__main is everything but the tab bar; __body is the map and the legend. */
.map-screen__main,
.map-screen__body {
display: flex;
flex-direction: column;
flex: 1;
/* A flex item floors at its content size, and a map that cannot shrink puts
the overflow back on the page - the same trap .app__screen's own comment
describes. */
min-height: 0;
}
/* The map, with the credit line in a strip beneath it. Still a positioning
context: the search sheet covers the whole canvas (see desktop.css). */
.map-screen__canvas {
position: relative;
flex: 1;
min-height: 0;
display: flex;
flex-direction: column;
}
/* A row of its own rather than an overlay in the corner, which is where it
used to sit.
MapLibre puts the scale bar at the bottom-left of the map, which is where
WIREFRAMES.md wants it - "scale bar above USGS US Topo · © OSM". Floating
the credit in that same corner put the two on top of each other, and no
offset fixes that honestly: the list is assembled per screen
(map/credits.ts), it grows and shrinks with the background and the download,
and it wraps to one line on a laptop and three on a phone. Any reserved gap
is right at exactly one width.
So the strip is given its own space instead. It costs the map that much
height, which is a real cost on a phone and is worth paying here: ODbL
attribution is a licence condition, and a condition met only where the text
happens not to land under a control is not met.
How MUCH height it costs is chrome/MapAttribution.tsx's problem, and the
answer there is one line: collapsed, this is the OSM credit and a count. */
.map-attribution {
margin: 0;
padding: 2px var(--space-2, 8px);
font-size: 10px;
color: var(--fg-2);
background: var(--bg-page);
border-top: 1px solid var(--border-1);
}
/* The one line that is always on screen. `list-item` display keeps the native
disclosure triangle, which is what says this opens - Safari and Chrome both
drop the marker the moment a summary is given any other display value, and a
credit line that expands with nothing to suggest it does is a control nobody
finds. */
.map-attribution__summary {
display: list-item;
cursor: pointer;
}
/* The count is a promise that something is behind the summary. Once it is
open, the list below is that something, said properly. */
.map-attribution[open] .map-attribution__more {
display: none;
}
/* Indented to start under the summary's TEXT rather than under its disclosure
triangle, so the credits read as one list with the line above them instead
of as a second block that happens to sit below it. In em, because the marker
it is clearing is sized by the same font as the text. */
.map-attribution__list {
margin: 0;
padding: 0 0 0 1.4em;
list-style: none;
}
/* ---------- Elevation ribbon ---------- */
/* WIREFRAMES.md: 54px tall, 36px left inset for the lane labels below, which
is what keeps a pin at 60% sitting under the right part of the climb. */
.elevation-ribbon {
position: relative;
height: 54px;
padding-left: 36px;
background: var(--bg-page);
border-bottom: 1px solid var(--border-1);
}
.elevation-ribbon__svg {
display: block;
width: 100%;
height: 100%;
}
.elevation-ribbon__area {
fill: color-mix(in srgb, var(--brand-primary) 22%, transparent);
}
.elevation-ribbon__line {
stroke: var(--brand-primary);
stroke-width: 1;
vector-effect: non-scaling-stroke;
}
.elevation-ribbon__climb {
fill: color-mix(in srgb, var(--accent-blaze-orange) 16%, transparent);
}
.elevation-ribbon__here {
stroke: var(--fg-1);
stroke-width: 1;
vector-effect: non-scaling-stroke;
}
.elevation-ribbon__labels {
position: absolute;
left: 0;
top: 0;
bottom: 0;
width: 36px;
display: flex;
flex-direction: column;
justify-content: space-between;
padding: 2px 4px;
font-family: var(--font-mono, ui-monospace, monospace);
font-size: 7.5px;
color: var(--fg-3);
}
.elevation-ribbon__callout {
position: absolute;
right: var(--space-2, 8px);
top: 4px;
margin: 0;
font-family: var(--font-mono, ui-monospace, monospace);
font-size: 10px;
color: var(--fg-1);
background: color-mix(in srgb, var(--bg-surface) 88%, transparent);
padding: 1px 5px;
border-radius: 4px;
}
/* ---------- Waypoint lanes ---------- */
.waypoint-lanes {
background: var(--bg-page);
}
/* WIREFRAMES.md: 19px per lane, dashed top rule, mono 7.5px gutter label. */
.waypoint-lane {
position: relative;
height: 19px;
padding-left: 36px;
border-top: 1px dashed var(--border-2);
}
.waypoint-lane__label {
position: absolute;
left: 4px;
top: 50%;
transform: translateY(-50%);
font-family: var(--font-mono, ui-monospace, monospace);
font-size: 7.5px;
letter-spacing: 0.06em;
color: var(--fg-3);
}
.waypoint-lane__track {
position: relative;
height: 100%;
}
.waypoint-pin {
position: absolute;
top: 50%;
transform: translate(-50%, -50%);
display: inline-flex;
align-items: center;
gap: 2px;
min-width: 17px;
height: 17px;
padding: 0 3px;
font-size: 9px;
line-height: 1;
color: var(--fg-1);
background: var(--bg-surface);
border: 1px solid var(--border-2);
border-radius: 9px;
cursor: pointer;
}
.waypoint-pin__count {
font-family: var(--font-mono, ui-monospace, monospace);
font-size: 8px;
font-weight: 700;
}
/* ---------- Legend sheet ---------- */
/* THE CAP STAYS AT 60% (#723). The grid below it is now every hideable category
rather than the two or three in the viewport, which on a phone is taller than
the sheet - and the sheet is the answer rather than the problem, because this
thing covers the map. features/MAP_OPTIONS.md §4 documents the cap and the
cost it accepts ("a picker at the foot of a busy viewport is now a scroll away
rather than the first thing under the title"); a longer list does not change
that trade, it just makes the scrolling routine instead of occasional.
What being routine changes is the affordance, and the fix for that is the list
itself. Two rows in a sheet with room for eight gave a hiker nothing to
suggest anything was under them. Eight rows cut off mid-grid do. */
.legend {
position: absolute;
left: 0;
right: 0;
bottom: 0;
z-index: 2;
max-height: 60%;
overflow-y: auto;
/* The scroll stops here. Without it a flick that runs off the end of the list
chains to the nearest scrollable ancestor and then to the document, which on
Chrome for Android is where pull-to-refresh lives - so a hiker reaching for
the row below the fold could reload the app instead. Reasoned from the
documented chaining behaviour, not measured on a handset: nothing in this
repository can drive a real Android touch stack. */
overscroll-behavior: contain;
padding: var(--space-4, 16px);
/* The sheet's bottom edge IS the viewport's - it is positioned against the
initial containing block, not the map - so on a gesture-navigation phone the
last thing in it sits under the system's own bar. That last thing is the
downloads link, and before it the row a hiker scrolled down to reach. */
padding-bottom: calc(var(--space-4, 16px) + env(safe-area-inset-bottom, 0px));
background: var(--bg-surface);
border-top-left-radius: 14px;
border-top-right-radius: 14px;
box-shadow: 0 -6px 24px rgb(0 0 0 / 12%);
}
.legend__head {
display: flex;
align-items: center;
justify-content: space-between;
}
.legend__title {
margin: 0;
font-size: 15px;
}
.legend__close {
min-width: var(--min-touch-target);
min-height: var(--min-touch-target);
font-size: 20px;
color: var(--fg-2);
background: none;
border: 0;
cursor: pointer;
}
.legend__empty {
margin: var(--space-3, 12px) 0 0;
color: var(--fg-3);
font-size: 13px;
}
.legend__blazes,
.legend__pins {
margin: var(--space-3, 12px) 0 0;
padding: 0;
list-style: none;
}
/* Pin types read as a 2-column grid; blaze rows stay full width so a blaze
name has room to sit on one line beside its swatch. The swatch is a solid
bar, which is now literally how the map draws the line (map/style.ts) - it
used to be a solid bar standing in for a dashed one. */
/* Two columns where two fit, ONE WHERE THEY DO NOT, and a 16px gutter either
way (#528).
Both halves are the drawn counts' doing. A row now ends in a block of mono
digits and the next begins with a filled 24px pin, and 8px of white between
`0/1223` and the parking icon reads as the two columns touching - which is
how it was reported. Rows keep the tighter 8px: a 44px touch target already
separates them vertically.
The widened gutter has to come out of the labels, and on a 320px phone there
is not enough slack to give: measured, a hard two-column grid there truncates
`Campsite`, `Resupply` and `Viewpoint` to `Cam…`, `Resu…` and `Vie…`. That is
worse than the crowding it fixes. A category name is what the row IS, and
`Vie…` beside a 24px glyph asks a hiker to identify a category from an icon
they are looking at the legend to decode.
So the count decides itself. `auto-fit` with a 150px floor gives two columns
at 360px and up, one at 320px - taller, and it scrolls in a panel that
already scrolls, which is the cheaper of the two costs. Measured across
320/360/390/430: two columns and no truncation above the fold, one column and
no truncation below it. */
.legend__pins {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
gap: var(--space-2, 8px) var(--space-4, 16px);
}
.legend__row {
display: flex;
align-items: center;
gap: var(--space-2, 8px);
min-height: var(--min-touch-target);
font-size: 13px;
}
.legend__swatch {
width: 22px;
height: 4px;
border-radius: 2px;
border: 1px solid var(--border-2);
}
/* The label is the only part of a row that may give up width, and `min-width: 0`
is what lets it (#528).
A flex item defaults to `min-width: auto` and will not shrink below its own
min-content, so without this the row cannot fit itself into its grid track -
it overflows and eats the gutter instead, which is what put `0/1223` against
the parking pin. The whole chain has to allow it: `.legend__pins` sets
`minmax(0, 1fr)` tracks, `.legend__toggle` clears its own floor below, and
this clears the label's. One link left at `auto` re-breaks it.
Measured at 320px, an iPhone SE and the narrowest phone worth drawing for,
because that is where it bites and 390px hides it: with the chain open the
ink between the two columns is the full gutter, and with any link closed it
collapses to under 5px.
Truncation is the release valve rather than the intent - nothing in this
corridor's seven categories actually truncates at 320px. The ellipsis is what
a longer category name from a later import gets instead of clipping
mid-glyph. */
.legend__label {
flex: 1;
min-width: 0;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
/* Carries the drawn figure too, as `13/14`, where fewer are drawn than are here
(#528). One slot rather than two, and that is the whole of the fix: a second
`13 shown` badge beside this one does not fit a two-column row at 390 px, so
it wrapped and left the column ragged.
There is deliberately no styling to go with the fraction. It inherits this
rule, so the emphasis is the same whether the row is short or not - a row
missing one pin should not shout, and the row missing all six is legible
because `0/6` says so, not because it is bolder.
A `.legend__drawn` rule used to sit here for that second badge. It is gone
with the badge, and worth a line because of how it failed rather than for
its own sake: it was called `legend__shown` until #530's type picker landed
on `main` using that name for its own row, two different things under one
class, and the later 44px bordered flex row won - rendering a 12px inline
badge as a full-width band inside a pin row. Git merged the two branches
without a marker; src/test/legendControlLayout.test.ts is what caught it.
One fewer class in this file is one fewer chance of that. */
.legend__count {
font-family: var(--font-mono, ui-monospace, monospace);
font-size: 12px;
color: var(--fg-2);
/* Never the part that gives way. The label can lose a letter to an ellipsis
and stay readable beside its own pin; a count that shed a digit would be a
different number, silently. */
flex: none;
}
/* The count over the canvas (#528). Bottom-left, clear of the zoom buttons and
the attribution, so it is legible without covering the trail line the hiker is
reading. Small and unemphatic: it is a standing fact about the zoom, not an
alert - the panel is where the per-category detail lives. */
.map-screen__dropped {
position: absolute;
bottom: var(--space-3, 12px);
left: var(--space-3, 12px);
z-index: 2;
margin: 0;
padding: 2px var(--space-2, 8px);
border-radius: 10px;
background: color-mix(in srgb, var(--bg-raised) 82%, transparent);
color: var(--fg-2);
font-size: 11px;
pointer-events: none;
}
/* The header summary. Deliberately quieter than the rows it summarises. */
.legend__dropped {
margin: var(--space-3, 12px) 0 0;
color: var(--fg-2);
font-size: 13px;
}
/* The icon the map draws for this row (map/MapIcon.tsx). A fixed square slot
whatever is in it: the pins fill it, and the closure band - which is 2:1,
because it is a line and not a pin - is scaled to the width and centred by
the SVG's own `preserveAspectRatio`. So the labels line up down the column
without the band being squashed into a square it never had. */
.legend__icon {
flex: none;
width: 24px;
height: 24px;
}
/* The whole row is the control, per WIREFRAMES.md §2's "rows are tappable to
hide". It used to be a 20px dot at the end of the row, which is a small
target for a gloved thumb and an invisible one for anybody who assumed the
row they were looking at was the button. */
.legend__toggle {
display: flex;
flex: 1;
align-items: center;
gap: var(--space-2, 8px);
min-height: var(--min-touch-target);
/* The middle link in the shrink chain `.legend__label` describes. This is the
element that was measured overflowing its grid track, so leaving it at the
default `auto` keeps the gutter shut however flexible the label is. */
min-width: 0;
/* Pulled back out again so the icon still lines up with the blaze swatches
above it: the padding is there to give the hover and focus states room to
sit off the text, not to indent the row. */
padding: 0 var(--space-1, 4px);
margin: 0 calc(var(--space-1, 4px) * -1);
font: inherit;
color: inherit;
text-align: left;
background: none;
border: 0;
border-radius: 8px;
cursor: pointer;
}
.legend__toggle:hover {
background: var(--bg-sunken);
}
.legend__toggle:focus-visible {
outline: 2px solid var(--brand-primary);
outline-offset: 2px;
}
/* A category that is off. Three channels, none of them hue: the pin loses its
colour, the name is struck through, and both drop toward the background.
Hue alone is what this app refuses to rely on anywhere the answer matters
(map/poiIcons.ts, lib/closureStyle.ts), and a legend read at arm's length in
direct sun is exactly that kind of place. */
.legend__row--hidden .legend__icon {
opacity: 0.4;
filter: grayscale(100%);
}
.legend__row--hidden .legend__label {
color: var(--fg-3);
text-decoration: line-through;
}
/* The "Verified?" filter, under the grid. Deliberately a different shape from
the rows above it - those are categories, this cuts across all of them - and
the same shape as a Settings row, which is the app's existing way of drawing
"one switch, one sentence". The label wraps the input, so the whole strip is
the target exactly as the category rows are. */
/* The drought toggle (#720). Same row shape as the verified filter above it -
both are single switches under the category list rather than categories -
with one addition: a second line carrying the week and the mileage, because
a switch labelled only "Drought" would leave a hiker guessing how current
the tint is. */
.legend__drought {
display: flex;
align-items: center;
justify-content: space-between;
gap: var(--space-2, 8px);
min-height: var(--min-touch-target);
margin-top: var(--space-2, 8px);
padding-top: var(--space-2, 8px);
border-top: 1px solid var(--border-1);
font-size: 13px;
cursor: pointer;
}
.legend__drought-name {
flex: 1;
display: flex;
flex-direction: column;
gap: 2px;
}
.legend__drought-detail {
font-size: 11px;
color: var(--text-2);
}
.legend__verified {
display: flex;
align-items: center;
justify-content: space-between;
gap: var(--space-2, 8px);
min-height: var(--min-touch-target);
margin-top: var(--space-2, 8px);
padding-top: var(--space-2, 8px);
border-top: 1px solid var(--border-1);
font-size: 13px;
cursor: pointer;
}
.legend__verified-name {
flex: 1;
}
/* A safety row spans the grid rather than sitting in one column of it.
It carries everything an ordinary row does plus the "Always shown" tag, and
in a ~116px column beside a desktop map that tag was clipped mid-word - the
one row on the panel that must not look like a rendering accident. Spanning
also reads correctly: these are not two of the categories, they are the two
that are different. There are rarely more than a couple in view. */
.legend__row--always {
grid-column: 1 / -1;
}
/* The way to every ATC notice (#687, Legend.tsx). Same footer-link treatment
as .downloads-link just below and for the same reasoning - a hiker reads
the rows above constantly and browses every trail update rarely, now that
what is actually new has its own bottom banner on the map screen - but its
own class rather than sharing that one, because the two rows answer
different questions for different reasons and a shared class would read as
a claim that they are the same errand. */
.legend__atc-link {
display: block;
width: 100%;
min-height: var(--min-touch-target, 44px);
margin-top: var(--space-4, 16px);
padding: var(--space-3, 12px) 0 0;
border: 0;
border-top: 1px solid var(--border-1);
font-size: 13px;
font-weight: 600;
text-align: left;
color: var(--brand-primary);
background: none;
cursor: pointer;
}
/* Everything about the downloaded map, in one block at the foot of the panel:
the background choice and the way to the download (Legend.tsx says why they
belong together). It exists to be moved as one thing - on a desktop the whole
block takes the `margin-top: auto` that used to be on the link alone, so the
two cannot be separated by a screen of empty paper. See desktop.css.
The gap above it is the block's, not the picker's: .bg-picker is shared with
Settings, where it sits under a heading and needs no top margin of its own.
Inside, the picker's 16px bottom margin and the link's 16px top margin
collapse to the one gap the link has always had above it. */
.legend__downloads {
margin-top: var(--space-4, 16px);
}
/* Deliberately a plain label, not a disabled button. There is no off switch
for a safety layer, so there is no control here to disable. */
/* Which categories are drawn (#530), and what is filtered, in one control.
Deliberately the same shape as the verified row below - a name, then its
control, on one touch-target line - because it is the same kind of thing: one
switch that cuts across every row above it.
THE SHAPE IS THE FIX. This was an inline `<select>` in a paragraph of prose,
between a sentence and a "Show all" button joined by middots. Two things went
wrong with that and both were visible in a screenshot at the widths the panel
actually has:
- Inline, a control with `min-height: var(--min-touch-target)` makes a 13px
line box 47px tall and aligns on its own baseline, so the words beside it
sat where nothing else on the panel sits. As a flex ITEM it sets the row
height instead, exactly as the verified checkbox does, and nothing is
realigned.
- `border: 0; background: none` on a select in the middle of a sentence
leaves its text indistinguishable from the sentence - the same size, the
same line, a colour apart. It reads as prose that happens to be a link.
Bounded below, so it reads as the control it is. */
.legend__shown {
display: flex;
align-items: center;
justify-content: space-between;
gap: var(--space-2, 8px);
min-height: var(--min-touch-target);
margin-top: var(--space-2, 8px);
padding-top: var(--space-2, 8px);
border-top: 1px solid var(--border-1);
color: var(--fg-2);
font-size: 13px;
cursor: pointer;
}
.legend__shown-name {
flex: 1;
}
.legend__shown-select {
/* Capped, so a long category name crushes itself rather than the label. A
select sizes to its widest option and will not wrap or ellipsise, so
without this the one thing saying what the control IS goes first. */
max-width: 60%;
min-height: var(--min-touch-target);
padding: 0 var(--space-1, 4px);
border: 1px solid var(--border-1);
border-radius: var(--radius-s, 4px);
background: var(--bg-surface);