@loidolt/theme-styles 0.5.0 → 0.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,323 @@
1
+ /* @loidolt/theme-maps. The map itself is painted by MapLibre from the same tokens (read at
2
+ runtime through `createTokenColors`); this file dresses MapLibre's controls, popups and
3
+ attribution, and the loidolt pieces placed on the map. It sits in `loidolt.components`, after
4
+ the `loidolt.vendor` layer MapLibre's own stylesheet goes in, so it wins without `!important`. */
5
+ .ldt-map {
6
+ position: relative;
7
+ min-width: 0;
8
+ height: var(--ldt-map-height, 25rem);
9
+ overflow: hidden;
10
+ border: var(--loidolt-border-width) solid var(--loidolt-border);
11
+ background: var(--loidolt-map-land);
12
+ }
13
+ .ldt-map__canvas {
14
+ position: absolute;
15
+ inset: 0;
16
+ }
17
+ .ldt-map__canvas[hidden],
18
+ .ldt-map__children[hidden] {
19
+ display: none;
20
+ }
21
+ .ldt-map__alert {
22
+ margin: 0.75rem;
23
+ }
24
+ .ldt-map :where(.maplibregl-map) {
25
+ color: var(--loidolt-text);
26
+ font: var(--loidolt-font-size-sm) / var(--loidolt-font-line-height-normal)
27
+ var(--loidolt-font-utility);
28
+ }
29
+
30
+ /* Controls stay above markers, which can be placed anywhere — including under a corner. */
31
+ .ldt-map
32
+ :where(
33
+ .maplibregl-ctrl-top-left,
34
+ .maplibregl-ctrl-top-right,
35
+ .maplibregl-ctrl-bottom-left,
36
+ .maplibregl-ctrl-bottom-right
37
+ ) {
38
+ z-index: var(--loidolt-z-raised);
39
+ }
40
+
41
+ /* Control groups: square, hairline-bordered, on the surface — the toolbar look. */
42
+ .ldt-map .maplibregl-ctrl-group {
43
+ border: var(--loidolt-border-width) solid var(--loidolt-border-strong);
44
+ border-radius: 0;
45
+ background: var(--loidolt-surface);
46
+ box-shadow: none;
47
+ }
48
+ .ldt-map .maplibregl-ctrl-group button {
49
+ width: 2rem;
50
+ height: 2rem;
51
+ color: var(--loidolt-text);
52
+ }
53
+ .ldt-map .maplibregl-ctrl-group button + button {
54
+ border-top: var(--loidolt-border-width) solid var(--loidolt-border);
55
+ }
56
+ .ldt-map .maplibregl-ctrl-group button:not(:disabled):hover {
57
+ background: var(--loidolt-surface-alt);
58
+ }
59
+ .ldt-map .maplibregl-ctrl-group button:focus-visible {
60
+ box-shadow: none;
61
+ }
62
+ /* MapLibre's icons are dark images, invisible on a dark surface. Masks of our own glyphs, filled
63
+ with the text colour, follow every theme. */
64
+ .ldt-map .maplibregl-ctrl button .maplibregl-ctrl-icon {
65
+ background-image: none;
66
+ background-color: currentColor;
67
+ mask: var(--ldt-map-icon) center / 1rem 1rem no-repeat;
68
+ }
69
+ .ldt-map .maplibregl-ctrl-zoom-in {
70
+ --ldt-map-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M8 3v10M3 8h10' stroke='black' stroke-width='1.5'/%3E%3C/svg%3E");
71
+ }
72
+ .ldt-map .maplibregl-ctrl-zoom-out {
73
+ --ldt-map-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3 8h10' stroke='black' stroke-width='1.5'/%3E%3C/svg%3E");
74
+ }
75
+ .ldt-map .maplibregl-ctrl-compass {
76
+ --ldt-map-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M8 2 11 8H5z'/%3E%3Cpath d='M5 8h6L8 14z' fill-opacity='.35'/%3E%3C/svg%3E");
77
+ }
78
+ .ldt-map .maplibregl-ctrl-fullscreen,
79
+ .ldt-map .maplibregl-ctrl-shrink {
80
+ --ldt-map-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='black' stroke-width='1.5'%3E%3Cpath d='M2 6V2h4M10 2h4v4M14 10v4h-4M6 14H2v-4'/%3E%3C/svg%3E");
81
+ }
82
+ .ldt-map .maplibregl-ctrl-geolocate {
83
+ --ldt-map-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='black' stroke-width='1.5'%3E%3Cpath d='M8 1v3M8 12v3M1 8h3M12 8h3'/%3E%3Crect x='4.5' y='4.5' width='7' height='7'/%3E%3C/svg%3E");
84
+ }
85
+ .ldt-map .maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-active {
86
+ color: var(--loidolt-accent);
87
+ }
88
+ .ldt-map .maplibregl-ctrl-attrib-button {
89
+ --ldt-map-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M7 7h2v6H7zM7 3h2v2H7z'/%3E%3C/svg%3E");
90
+ }
91
+
92
+ /* Attribution: required by the tile licence, so readable — just quiet. */
93
+ .ldt-map .maplibregl-ctrl-attrib,
94
+ .ldt-map .maplibregl-ctrl-attrib.maplibregl-compact {
95
+ border-radius: 0;
96
+ color: var(--loidolt-text-muted);
97
+ background: var(--loidolt-surface);
98
+ font-size: var(--loidolt-font-size-xs);
99
+ }
100
+ .ldt-map .maplibregl-ctrl-attrib a {
101
+ display: inline-block;
102
+ padding-block: 0.35rem;
103
+ color: var(--loidolt-text);
104
+ line-height: 1.5;
105
+ }
106
+ .ldt-map .maplibregl-ctrl-attrib-button {
107
+ border-radius: 0;
108
+ background-color: transparent;
109
+ }
110
+ .ldt-map .maplibregl-ctrl-scale {
111
+ border-color: var(--loidolt-text-muted);
112
+ color: var(--loidolt-text);
113
+ background: var(--loidolt-surface);
114
+ font-size: var(--loidolt-font-size-xs);
115
+ }
116
+
117
+ /* Controls of our own: legends, coordinates, the basemap switcher. */
118
+ .ldt-map-control {
119
+ padding: 0.5rem 0.65rem;
120
+ border: var(--loidolt-border-width) solid var(--loidolt-border-strong);
121
+ color: var(--loidolt-text);
122
+ background: var(--loidolt-surface);
123
+ }
124
+ .ldt-map-control.ldt-basemap-switcher {
125
+ padding: 0;
126
+ border: 0;
127
+ background: transparent;
128
+ }
129
+ .ldt-map-legend {
130
+ display: grid;
131
+ gap: 0.4rem;
132
+ min-width: 9rem;
133
+ max-width: 16rem;
134
+ font: var(--loidolt-font-size-sm) var(--loidolt-font-utility);
135
+ }
136
+ .ldt-map-legend__title,
137
+ .ldt-map-legend__summary {
138
+ margin: 0;
139
+ color: var(--loidolt-text-muted);
140
+ font: var(--loidolt-font-size-xs) var(--loidolt-font-utility);
141
+ letter-spacing: var(--loidolt-font-tracking-utility);
142
+ text-transform: uppercase;
143
+ }
144
+ .ldt-map-legend__summary {
145
+ cursor: pointer;
146
+ }
147
+ .ldt-map-legend__section {
148
+ display: grid;
149
+ gap: 0.35rem;
150
+ }
151
+ .ldt-map-legend__items {
152
+ display: grid;
153
+ gap: 0.25rem;
154
+ margin: 0;
155
+ padding: 0;
156
+ list-style: none;
157
+ }
158
+ .ldt-map-legend__item {
159
+ display: flex;
160
+ gap: 0.5rem;
161
+ align-items: center;
162
+ }
163
+ .ldt-map-legend__key {
164
+ flex: none;
165
+ width: 0.75rem;
166
+ height: 0.75rem;
167
+ background: var(--ldt-legend-color);
168
+ }
169
+ .ldt-map-legend__key--line {
170
+ height: 0.2rem;
171
+ }
172
+ .ldt-map-legend__key--dot {
173
+ border-radius: var(--loidolt-border-radius-pill);
174
+ }
175
+ .ldt-map-legend__ramp {
176
+ height: 0.6rem;
177
+ }
178
+ .ldt-map-legend__ends {
179
+ display: flex;
180
+ justify-content: space-between;
181
+ margin: 0;
182
+ color: var(--loidolt-text-muted);
183
+ font-size: var(--loidolt-font-size-xs);
184
+ }
185
+ .ldt-map-coordinates {
186
+ display: flex;
187
+ gap: 0.75rem;
188
+ margin: 0;
189
+ font: var(--loidolt-font-size-xs) var(--loidolt-font-mono);
190
+ font-variant-numeric: tabular-nums;
191
+ }
192
+
193
+ /* The layer manager: a titled list of switches, sliders and move buttons. */
194
+ .ldt-layer-manager {
195
+ min-width: 13rem;
196
+ max-width: min(18rem, calc(100vw - 4rem));
197
+ /* Never taller than the map, so it cannot run into the controls in the corner below it. */
198
+ max-height: calc(var(--ldt-map-height, 25rem) - 4.5rem);
199
+ overflow-y: auto;
200
+ }
201
+ .ldt-layer-manager__title {
202
+ margin: 0;
203
+ }
204
+ .ldt-layer-manager__toggle {
205
+ width: 100%;
206
+ padding: 0.15rem 0;
207
+ border: 0;
208
+ color: var(--loidolt-text-muted);
209
+ background: none;
210
+ font: var(--loidolt-font-size-xs) var(--loidolt-font-utility);
211
+ letter-spacing: var(--loidolt-font-tracking-utility);
212
+ text-align: start;
213
+ text-transform: uppercase;
214
+ cursor: pointer;
215
+ }
216
+ .ldt-layer-manager__list {
217
+ display: grid;
218
+ gap: 0.5rem;
219
+ margin: 0.4rem 0 0;
220
+ padding: 0;
221
+ list-style: none;
222
+ }
223
+ .ldt-layer-manager__list[hidden] {
224
+ display: none;
225
+ }
226
+ .ldt-layer-manager__row {
227
+ display: grid;
228
+ grid-template-columns: minmax(0, 1fr) auto;
229
+ gap: 0.35rem 0.5rem;
230
+ align-items: center;
231
+ padding-top: 0.5rem;
232
+ border-top: var(--loidolt-border-width) solid var(--loidolt-border-soft);
233
+ }
234
+ .ldt-layer-manager__row:first-child {
235
+ padding-top: 0;
236
+ border-top: 0;
237
+ }
238
+ .ldt-layer-manager__move {
239
+ display: flex;
240
+ gap: 0.15rem;
241
+ }
242
+ .ldt-layer-manager__opacity {
243
+ grid-column: 1 / -1;
244
+ }
245
+
246
+ /* Markers: the loidolt pin or dot, in a button that takes focus. */
247
+ .ldt-map-marker {
248
+ display: block;
249
+ padding: 0;
250
+ border: 0;
251
+ color: inherit;
252
+ background: none;
253
+ cursor: pointer;
254
+ }
255
+ span.ldt-map-marker {
256
+ cursor: default;
257
+ }
258
+
259
+ /* Popups: square, on the surface, no tip — the same frame as a popover. */
260
+ .ldt-map-popup .maplibregl-popup-content {
261
+ padding: 0;
262
+ border: var(--loidolt-border-width) solid var(--loidolt-border-strong);
263
+ border-radius: 0;
264
+ color: var(--loidolt-text);
265
+ background: var(--loidolt-surface);
266
+ box-shadow: var(--loidolt-shadow-popover);
267
+ }
268
+ .ldt-map-popup .maplibregl-popup-tip {
269
+ display: none;
270
+ }
271
+ .ldt-map-popup__content {
272
+ display: grid;
273
+ grid-template-columns: minmax(0, 1fr) auto;
274
+ align-items: start;
275
+ gap: 0.25rem;
276
+ max-width: min(18rem, 80vw);
277
+ padding: 0.5rem 0.35rem 0.6rem 0.75rem;
278
+ }
279
+ .ldt-map-popup__body > :first-child {
280
+ margin-top: 0.3rem;
281
+ }
282
+ .ldt-map-popup__body > :last-child {
283
+ margin-bottom: 0;
284
+ }
285
+
286
+ /* The feature list: every place on the map, as rows. */
287
+ .ldt-map-features__list {
288
+ margin: 0;
289
+ padding: 0;
290
+ border-top: var(--loidolt-border-width) solid var(--loidolt-border-soft);
291
+ list-style: none;
292
+ }
293
+ .ldt-map-features__item {
294
+ display: grid;
295
+ gap: 0.1rem;
296
+ width: 100%;
297
+ padding: 0.55rem 0.75rem;
298
+ border: 0;
299
+ border-bottom: var(--loidolt-border-width) solid var(--loidolt-border-soft);
300
+ border-left: 3px solid transparent;
301
+ color: var(--loidolt-text);
302
+ background: none;
303
+ font: inherit;
304
+ text-align: start;
305
+ cursor: pointer;
306
+ }
307
+ .ldt-map-features__item:hover {
308
+ background: var(--loidolt-surface-alt);
309
+ }
310
+ .ldt-map-features__item[aria-current='true'] {
311
+ border-left-color: var(--loidolt-accent);
312
+ background: var(--loidolt-surface-alt);
313
+ }
314
+ .ldt-map-features__description {
315
+ color: var(--loidolt-text-muted);
316
+ font-size: var(--loidolt-font-size-sm);
317
+ }
318
+
319
+ @media (forced-colors: active) {
320
+ .ldt-map .maplibregl-ctrl button .maplibregl-ctrl-icon {
321
+ background-color: ButtonText;
322
+ }
323
+ }