leaflet-theme-control 0.0.1

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,503 @@
1
+ /* CSS Custom Properties for easy theming */
2
+ :root {
3
+ /* Primary colors */
4
+ --ltc-primary: #2196f3;
5
+ --ltc-primary-dark: #1976d2;
6
+ --ltc-primary-light: #64b5f6;
7
+ --ltc-primary-bg: #e3f2fd;
8
+
9
+ /* Success/Custom badge */
10
+ --ltc-success: #4caf50;
11
+
12
+ /* Neutral colors - Light mode */
13
+ --ltc-bg: white;
14
+ --ltc-bg-hover: #f4f4f4;
15
+ --ltc-bg-secondary: #f5f5f5;
16
+ --ltc-bg-tertiary: #e0e0e0;
17
+ --ltc-text: #333;
18
+ --ltc-text-secondary: #666;
19
+ --ltc-text-tertiary: #aaa;
20
+ --ltc-border: #e0e0e0;
21
+ --ltc-border-dark: #bbb;
22
+
23
+ /* Component specific */
24
+ --ltc-shadow: rgba(0, 0, 0, 0.15);
25
+ --ltc-slider-track: #e0e0e0;
26
+ --ltc-slider-thumb-shadow: rgba(0, 0, 0, 0.2);
27
+ }
28
+
29
+ /* Dark mode custom properties */
30
+ :root[data-control-style="dark"] {
31
+ --ltc-bg: #2d2d2d;
32
+ --ltc-bg-hover: #404040;
33
+ --ltc-bg-secondary: #3a3a3a;
34
+ --ltc-bg-tertiary: #454545;
35
+ --ltc-text: #e0e0e0;
36
+ --ltc-text-secondary: #aaa;
37
+ --ltc-text-tertiary: #666;
38
+ --ltc-border: #404040;
39
+ --ltc-border-dark: #555;
40
+ --ltc-primary-bg: #1e3a5f;
41
+ --ltc-primary-light: #90caf9;
42
+ --ltc-slider-track: #404040;
43
+ --ltc-bg-overlay: rgba(45, 45, 45, 0.95);
44
+ --ltc-bg-overlay-hover: rgba(60, 60, 60, 0.95);
45
+ --ltc-bg-overlay-disabled: rgba(35, 35, 35, 0.95);
46
+ --ltc-bg-overlay-light: rgba(45, 45, 45, 0.9);
47
+ --ltc-bg-overlay-scale: rgba(45, 45, 45, 0.8);
48
+ }
49
+
50
+ /* Theme Control Button */
51
+
52
+ .leaflet-control-theme-button {
53
+ width: 30px;
54
+ height: 30px;
55
+ font-size: 16px;
56
+ border: none;
57
+ background: var(--ltc-bg);
58
+ cursor: pointer;
59
+ border-radius: 4px;
60
+ transition: background 0.2s;
61
+ }
62
+
63
+ .leaflet-control-theme-button:hover {
64
+ background: var(--ltc-bg-hover);
65
+ }
66
+
67
+ /* Theme Panel Styles */
68
+
69
+ .leaflet-theme-panel {
70
+ position: absolute;
71
+ top: 60px;
72
+ right: 10px;
73
+ width: 320px;
74
+ max-width: calc(100vw - 20px);
75
+ max-height: calc(100vh - 80px);
76
+ overflow-y: auto;
77
+ background: var(--ltc-bg);
78
+ border-radius: 8px;
79
+ box-shadow: 0 4px 12px var(--ltc-shadow);
80
+ z-index: 1000;
81
+ font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
82
+ pointer-events: all;
83
+ color: var(--ltc-text);
84
+ }
85
+
86
+ /* Panel Header */
87
+ .theme-panel-header {
88
+ display: flex;
89
+ justify-content: space-between;
90
+ align-items: center;
91
+ padding: 15px;
92
+ border-bottom: 1px solid var(--ltc-border);
93
+ }
94
+
95
+ .theme-panel-header h3 {
96
+ margin: 0;
97
+ font-size: 16px;
98
+ font-weight: 600;
99
+ flex: 1;
100
+ text-align: center;
101
+ }
102
+
103
+ .theme-panel-back,
104
+ .theme-panel-close {
105
+ width: 28px;
106
+ height: 28px;
107
+ border: none;
108
+ background: transparent;
109
+ font-size: 20px;
110
+ line-height: 1;
111
+ cursor: pointer;
112
+ color: var(--ltc-text-secondary);
113
+ border-radius: 4px;
114
+ padding: 0;
115
+ flex-shrink: 0;
116
+ }
117
+
118
+ .theme-panel-back {
119
+ margin-right: 8px;
120
+ }
121
+
122
+ .theme-panel-close {
123
+ margin-left: 8px;
124
+ font-size: 24px;
125
+ }
126
+
127
+ .theme-panel-back:hover,
128
+ .theme-panel-close:hover {
129
+ background: var(--ltc-bg-secondary);
130
+ color: var(--ltc-text);
131
+ }
132
+
133
+ .theme-panel-back:focus,
134
+ .theme-panel-close:focus {
135
+ outline: 2px solid var(--ltc-primary);
136
+ outline-offset: 2px;
137
+ }
138
+
139
+ /* Panel Body */
140
+ .theme-panel-body {
141
+ padding: 10px;
142
+ }
143
+
144
+ /* Theme Selector */
145
+ .theme-row {
146
+ display: flex;
147
+ align-items: center;
148
+ gap: 8px;
149
+ margin-bottom: 8px;
150
+ }
151
+
152
+ .theme-row.active .theme-select-btn {
153
+ background: var(--ltc-primary-bg);
154
+ border-color: var(--ltc-primary);
155
+ }
156
+
157
+ .theme-select-btn {
158
+ flex: 1;
159
+ display: flex;
160
+ align-items: center;
161
+ gap: 10px;
162
+ padding: 12px 14px;
163
+ border: 2px solid var(--ltc-border);
164
+ background: var(--ltc-bg);
165
+ border-radius: 6px;
166
+ cursor: pointer;
167
+ transition: all 0.2s;
168
+ font-size: 14px;
169
+ text-align: left;
170
+ }
171
+
172
+ .theme-select-btn:hover {
173
+ background: var(--ltc-bg-secondary);
174
+ border-color: var(--ltc-border-dark);
175
+ }
176
+
177
+ .theme-select-btn:focus {
178
+ outline: 2px solid var(--ltc-primary);
179
+ outline-offset: 2px;
180
+ }
181
+
182
+ .theme-row.active .theme-select-btn:hover {
183
+ background: var(--ltc-primary-bg);
184
+ border-color: var(--ltc-primary);
185
+ }
186
+
187
+ .theme-icon {
188
+ font-size: 20px;
189
+ flex-shrink: 0;
190
+ }
191
+
192
+ .theme-name {
193
+ flex: 1;
194
+ font-weight: 500;
195
+ color: var(--ltc-text);
196
+ }
197
+
198
+ .theme-custom-badge {
199
+ font-size: 11px;
200
+ padding: 2px 6px;
201
+ background: var(--ltc-success);
202
+ color: white;
203
+ border-radius: 3px;
204
+ font-weight: 600;
205
+ }
206
+
207
+ .theme-active-badge {
208
+ font-size: 16px;
209
+ color: var(--ltc-primary);
210
+ }
211
+
212
+ .theme-edit-btn {
213
+ width: 36px;
214
+ height: 44px;
215
+ border: none;
216
+ background: var(--ltc-bg-secondary);
217
+ border-radius: 6px;
218
+ cursor: pointer;
219
+ font-size: 16px;
220
+ transition: all 0.2s;
221
+ flex-shrink: 0;
222
+ }
223
+
224
+ .theme-edit-btn:hover {
225
+ background: var(--ltc-border);
226
+ }
227
+
228
+ .theme-edit-btn:focus {
229
+ outline: 2px solid var(--ltc-primary);
230
+ outline-offset: 2px;
231
+ }
232
+
233
+ /* Theme Editor Sliders */
234
+ .theme-editor-sliders {
235
+ padding: 15px;
236
+ }
237
+
238
+ /* Control Style Selector */
239
+ .control-style-selector {
240
+ margin-bottom: 20px;
241
+ padding-bottom: 16px;
242
+ border-bottom: 1px solid var(--ltc-border);
243
+ }
244
+
245
+ .control-style-selector label {
246
+ display: block;
247
+ font-size: 13px;
248
+ font-weight: 500;
249
+ color: var(--ltc-text);
250
+ margin-bottom: 8px;
251
+ }
252
+
253
+ .control-style-buttons {
254
+ display: flex;
255
+ gap: 8px;
256
+ }
257
+
258
+ .control-style-btn {
259
+ flex: 1;
260
+ padding: 8px 12px;
261
+ border: 2px solid var(--ltc-border);
262
+ background: var(--ltc-bg);
263
+ color: var(--ltc-text);
264
+ border-radius: 6px;
265
+ cursor: pointer;
266
+ font-size: 13px;
267
+ transition: all 0.2s;
268
+ font-weight: 500;
269
+ }
270
+
271
+ .control-style-btn:hover {
272
+ background: var(--ltc-bg-secondary);
273
+ border-color: var(--ltc-border-dark);
274
+ }
275
+
276
+ .control-style-btn.active {
277
+ background: var(--ltc-primary-bg);
278
+ border-color: var(--ltc-primary);
279
+ color: var(--ltc-primary-dark);
280
+ }
281
+
282
+ .control-style-btn:focus {
283
+ outline: 2px solid var(--ltc-primary);
284
+ outline-offset: 2px;
285
+ }
286
+
287
+ .theme-editor-slider {
288
+ margin-bottom: 16px;
289
+ }
290
+
291
+ .theme-editor-slider:last-child {
292
+ margin-bottom: 0;
293
+ }
294
+
295
+ .theme-editor-slider label {
296
+ display: flex;
297
+ justify-content: space-between;
298
+ align-items: center;
299
+ margin-bottom: 6px;
300
+ font-size: 13px;
301
+ }
302
+
303
+ .slider-label {
304
+ font-weight: 500;
305
+ color: var(--ltc-text);
306
+ }
307
+
308
+ .slider-value {
309
+ color: var(--ltc-text-secondary);
310
+ font-family: monospace;
311
+ font-size: 12px;
312
+ min-width: 50px;
313
+ text-align: right;
314
+ }
315
+
316
+ .theme-editor-slider input[type="range"] {
317
+ width: 100%;
318
+ height: 24px;
319
+ border-radius: 12px;
320
+ background: transparent;
321
+ outline: none;
322
+ -webkit-appearance: none;
323
+ cursor: pointer;
324
+ }
325
+
326
+ .theme-editor-slider input[type="range"]::-webkit-slider-runnable-track {
327
+ width: 100%;
328
+ height: 8px;
329
+ background: var(--ltc-slider-track);
330
+ border-radius: 4px;
331
+ }
332
+
333
+ .theme-editor-slider input[type="range"]::-webkit-slider-thumb {
334
+ -webkit-appearance: none;
335
+ appearance: none;
336
+ width: 20px;
337
+ height: 20px;
338
+ border-radius: 50%;
339
+ background: var(--ltc-primary);
340
+ cursor: pointer;
341
+ transition: all 0.2s;
342
+ margin-top: -6px;
343
+ box-shadow: 0 2px 4px var(--ltc-slider-thumb-shadow);
344
+ }
345
+
346
+ .theme-editor-slider input[type="range"]::-webkit-slider-thumb:hover {
347
+ background: var(--ltc-primary-dark);
348
+ transform: scale(1.15);
349
+ }
350
+
351
+ .theme-editor-slider input[type="range"]:focus {
352
+ outline: none;
353
+ }
354
+
355
+ .theme-editor-slider input[type="range"]:focus::-webkit-slider-thumb {
356
+ outline: 2px solid var(--ltc-primary);
357
+ outline-offset: 2px;
358
+ }
359
+
360
+ .theme-editor-slider input[type="range"]::-moz-range-track {
361
+ width: 100%;
362
+ height: 8px;
363
+ background: var(--ltc-slider-track);
364
+ border-radius: 4px;
365
+ }
366
+
367
+ .theme-editor-slider input[type="range"]::-moz-range-thumb {
368
+ width: 20px;
369
+ height: 20px;
370
+ border-radius: 50%;
371
+ background: var(--ltc-primary);
372
+ cursor: pointer;
373
+ border: none;
374
+ transition: all 0.2s;
375
+ box-shadow: 0 2px 4px var(--ltc-slider-thumb-shadow);
376
+ }
377
+
378
+ .theme-editor-slider input[type="range"]::-moz-range-thumb:hover {
379
+ background: var(--ltc-primary-dark);
380
+ transform: scale(1.15);
381
+ }
382
+
383
+ .theme-editor-slider input[type="range"]:focus::-moz-range-thumb {
384
+ outline: 2px solid var(--ltc-primary);
385
+ outline-offset: 2px;
386
+ }
387
+
388
+ /* Touch-friendly larger hit area */
389
+ @media (hover: none) and (pointer: coarse) {
390
+ .theme-editor-slider input[type="range"] {
391
+ height: 32px;
392
+ }
393
+
394
+ .theme-editor-slider input[type="range"]::-webkit-slider-thumb {
395
+ width: 28px;
396
+ height: 28px;
397
+ margin-top: -10px;
398
+ }
399
+
400
+ .theme-editor-slider input[type="range"]::-moz-range-thumb {
401
+ width: 28px;
402
+ height: 28px;
403
+ }
404
+ }
405
+
406
+ /* Panel Footer */
407
+ .theme-panel-footer {
408
+ padding: 15px;
409
+ border-top: 1px solid var(--ltc-border);
410
+ }
411
+
412
+ .theme-panel-footer button {
413
+ width: 100%;
414
+ padding: 10px 16px;
415
+ border: none;
416
+ border-radius: 6px;
417
+ font-size: 14px;
418
+ font-weight: 500;
419
+ cursor: pointer;
420
+ transition: all 0.2s;
421
+ }
422
+
423
+ .theme-editor-reset {
424
+ background: var(--ltc-bg-secondary);
425
+ color: var(--ltc-text-secondary);
426
+ }
427
+
428
+ .theme-editor-reset:hover {
429
+ background: var(--ltc-border);
430
+ color: var(--ltc-text);
431
+ }
432
+
433
+ .theme-editor-reset:focus {
434
+ outline: 2px solid var(--ltc-primary);
435
+ outline-offset: 2px;
436
+ }
437
+
438
+ /* Leaflet Controls - adapt to control style */
439
+
440
+ /* Theme Control Button */
441
+ :root[data-control-style="dark"] .leaflet-control-theme-button {
442
+ color: white;
443
+ border-color: rgba(255, 255, 255, 0.1);
444
+ }
445
+
446
+ /* All Leaflet controls */
447
+ :root[data-control-style="dark"] .leaflet-bar,
448
+ :root[data-control-style="dark"] .leaflet-control-layers,
449
+ :root[data-control-style="dark"] .leaflet-control-scale {
450
+ background: var(--ltc-bg-overlay);
451
+ border-color: var(--ltc-border-dark);
452
+ }
453
+
454
+ /* Zoom buttons and other bar buttons */
455
+ :root[data-control-style="dark"] .leaflet-bar a,
456
+ :root[data-control-style="dark"] .leaflet-control-layers-toggle {
457
+ background: var(--ltc-bg-overlay);
458
+ color: var(--ltc-text);
459
+ border-color: var(--ltc-border-dark);
460
+ }
461
+
462
+ :root[data-control-style="dark"] .leaflet-bar a:hover,
463
+ :root[data-control-style="dark"] .leaflet-control-layers-toggle:hover {
464
+ background: var(--ltc-bg-overlay-hover);
465
+ color: white;
466
+ }
467
+
468
+ :root[data-control-style="dark"] .leaflet-bar a.leaflet-disabled {
469
+ background: var(--ltc-bg-overlay-disabled);
470
+ color: var(--ltc-text-tertiary);
471
+ }
472
+
473
+ /* Layers control */
474
+ :root[data-control-style="dark"] .leaflet-control-layers-expanded {
475
+ background: var(--ltc-bg-overlay);
476
+ color: var(--ltc-text);
477
+ }
478
+
479
+ :root[data-control-style="dark"] .leaflet-control-layers-separator {
480
+ border-color: var(--ltc-border-dark);
481
+ }
482
+
483
+ /* Scale control */
484
+ :root[data-control-style="dark"] .leaflet-control-scale-line {
485
+ background: var(--ltc-bg-overlay-scale);
486
+ border-color: var(--ltc-text);
487
+ color: var(--ltc-text);
488
+ }
489
+
490
+ /* Attribution control */
491
+ :root[data-control-style="dark"] .leaflet-control-attribution {
492
+ background: var(--ltc-bg-overlay-light);
493
+ color: var(--ltc-text);
494
+ }
495
+
496
+ :root[data-control-style="dark"] .leaflet-control-attribution a {
497
+ color: var(--ltc-primary-light);
498
+ }
499
+
500
+ :root[data-control-style="dark"] .leaflet-control-attribution a:hover {
501
+ color: var(--ltc-primary-light);
502
+ filter: brightness(1.1);
503
+ }