Repository navigation
Expand file tree
/
Copy pathexamples-theming.html
More file actions
1736 lines (1554 loc) · 79.6 KB
/
Copy pathexamples-theming.html
File metadata and controls
1736 lines (1554 loc) · 79.6 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
<meta name="kmwc:title" content="Theming & Sizing">
<meta name="kmwc:subtitle" content="Customize appearance with CSS custom properties — dark mode and theme presets, the --base-* typography integration, and REM-based sizing of inputs and fonts.">
<!-- Light-DOM pre-upgrade rule (= dist/style.css): reserves the input height before the JS defines the element -->
<link rel="stylesheet" href="/src/css/main.css">
<!-- Merged from base-variables page: page-specific styles -->
<style>
/* TH11 typography panel: a kit .card; each row is a kit .controls row, so
attachControlsPersistence('theming') still finds the inputs. */
/* .controls-header / .control-section / .section-desc, .control-row / .control-group
and the fields come from the kit. */
/* The font-link field takes the rest of its row (and shrinks on a phone). */
.font-link-group {
flex: 1 1 18rem;
min-width: 0;
max-width: 32rem;
}
.font-link-input {
width: 100%;
}
/* Multiselect wrapper for better layout */
.multiselect-wrapper {
display: flex;
flex-direction: column;
gap: 1rem;
}
/* Current values dump — box from the kit's `.log-panel--dark` (a console, dark in
both themes); green + preformatted for the terminal-style values readout. */
.current-values {
--log-max-height: 300px;
color: var(--kmwc-console-highlight-color);
margin-top: 2rem;
font-size: 0.75rem;
line-height: 1.6;
white-space: pre-wrap;
}
.current-values-header {
color: var(--kmwc-console-info-color);
font-weight: bold;
margin-bottom: 0.5rem;
}
</style>
<!-- Merged from sizes page: Google Fonts -->
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&family=Montserrat:wght@400;500;600&family=Fira+Code:wght@400;500&family=Quicksand:wght@400;500;600&family=Lexend:wght@400;500;600&display=swap" rel="stylesheet">
<!-- Merged from sizes page: page-specific styles -->
<style>
/* Narrow input examples */
.narrow-demo-grid {
display: flex;
gap: 2rem;
flex-wrap: wrap;
align-items: flex-start;
}
.narrow-demo-card {
flex: 0 0 auto;
text-align: center;
}
.narrow-demo-card h4 {
margin: 0 0 0.5rem 0;
font-size: 0.875rem;
color: var(--kmwc-text-color-2);
}
/* Font family overrides via --base-font-family */
#font-system { --base-font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; }
#font-inter { --base-font-family: "Inter", sans-serif; }
#font-montserrat { --base-font-family: "Montserrat", sans-serif; }
#font-quicksand { --base-font-family: "Quicksand", sans-serif; }
#font-lexend { --base-font-family: "Lexend", sans-serif; }
#font-mono { --base-font-family: "Fira Code", monospace; }
/* Gray-fill variant of the kit's `.demo-card`. */
.comparison-card {
--demo-card-bg: var(--kmwc-elevated-bg);
--demo-card-border: none;
}
</style>
<!-- Page-specific styles -->
<!-- Theme gallery (TH01–TH06) and the color-scheme demo: each card IS a fixed theme —
its colours are the demo, so they stay put when the page theme flips. -->
<style data-kmwc-fixed-colors>
/* Grid comes from the kit's `.card-grid`; wider min for side-by-side themes. */
.theme-grid {
--grid-min: 500px;
margin-bottom: 2rem;
}
/* Theme card base styling */
.theme-card {
padding: 1.5rem;
border-radius: 8px;
}
.theme-card p {
font-size: 0.875rem;
}
/* Dark Mode Theme */
.dark-theme {
background: #1a1a1a;
}
.dark-theme h2,
.dark-theme p,
.dark-theme label {
color: #e5e5e5;
}
#dark-mode {
/* Base theme variables - these cascade to all components */
--base-input-bg: #2a2a2a;
--base-dropdown-bg: #2a2a2a;
--base-text-color-1: #e5e5e5;
--base-text-color-3: #808080;
--base-border-color: #404040;
--base-border: 1px solid #404040; /* Sets all component borders at once */
--base-hover-bg: #3a3a3a;
--base-primary-color: #667eea;
/* Component-specific overrides */
--ms-dropdown-box-shadow: 0 8px 16px rgba(0, 0, 0, 0.6);
/* Badges - slightly lighter border for visibility */
--ms-badge-text-bg: #3a3a3a;
--ms-badge-text-border: 1px solid #505050;
/* Selected popover */
--ms-selected-popover-header-bg: rgba(102, 126, 234, 0.1);
--ms-selected-popover-close-bg-hover: #3a3a3a;
/* Checkboxes */
--ms-checkbox-bg: #3a3a3a;
--ms-checkbox-border: 1px solid #606060;
/* Scrollbar */
--ms-scrollbar-thumb-bg: #505050;
--ms-scrollbar-thumb-bg-hover: #707070;
}
/* Neon/Cyberpunk Theme */
.neon-theme {
background: #0a0a0a;
position: relative;
}
.neon-theme::before {
content: '';
position: absolute;
inset: 0;
background: linear-gradient(45deg, rgba(255,0,255,0.1), rgba(0,255,255,0.1));
pointer-events: none;
}
.neon-theme h2,
.neon-theme p,
.neon-theme label {
color: #00ffff;
text-shadow: 0 0 10px rgba(0, 255, 255, 0.5);
}
#neon-mode {
/* Base theme variables */
--base-input-bg: #1a0a1a;
--base-dropdown-bg: #1a0a1a;
--base-text-color-1: #00ffff;
--base-primary-color: #ff00ff;
--ms-actions-bg: rgba(255, 0, 255, 0.3); /* sticky actions bar (defaults to the dropdown bg) */
/* Custom icons — one --base-icon-* swap re-skins the lot: the toggle chevron
(+ fullscreen pager) and every ✕ (badge remove, popover close, count clear).
Techy double-chevron + a chunky filled square-x for the cyberpunk vibe. */
--base-icon-chevron: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='m6 17 5-5-5-5'/><path d='m13 17 5-5-5-5'/></svg>");
--base-icon-close: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='black'><path d='M19 2h-14a3 3 0 0 0 -3 3v14a3 3 0 0 0 3 3h14a3 3 0 0 0 3 -3v-14a3 3 0 0 0 -3 -3zm-9.387 6.21l.094 .083l2.293 2.292l2.293 -2.292a1 1 0 0 1 1.497 1.32l-.083 .094l-2.292 2.293l2.292 2.293a1 1 0 0 1 -1.32 1.497l-.094 -.083l-2.293 -2.292l-2.293 2.292a1 1 0 0 1 -1.497 -1.32l.083 -.094l2.292 -2.293l-2.292 -2.293a1 1 0 0 1 1.32 -1.497z'/></svg>");
/* Search glyph (never rotated — feeds the fullscreen overlay's search-mode toggle).
A solid magnifier for the glow. Visible when the overlay opens on a phone viewport. */
--base-icon-search: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='black'><path d='M14 3.072a8 8 0 0 1 2.617 11.424l4.944 4.943a1.5 1.5 0 0 1 -2.008 2.225l-.114 -.103l-4.943 -4.944a8 8 0 0 1 -12.49 -6.332l-.006 -.285l.005 -.285a8 8 0 0 1 11.995 -6.643z'/></svg>");
/* Hover/focus on options. --ms-option-bg-hover cascades from --ms-primary-bg,
which reads --base-hover-bg (or falls back to a color-mix tint of --base-main-bg).
This theme overrides the option hover directly so the magenta carries to interaction. */
--ms-option-bg-hover: rgba(255, 0, 255, 0.3);
--ms-option-bg-focused: rgba(255, 0, 255, 0.3);
/* Component-specific overrides */
--ms-dropdown-border: 1px solid #ff00ff;
--ms-dropdown-box-shadow: 0 0 20px rgba(255, 0, 255, 0.5);
/* Badges */
--ms-badge-text-bg: rgba(255, 0, 255, 0.3);
--ms-badge-text-border: 1px solid #ff00ff;
--ms-badge-remove-bg: #00ffff;
--ms-badge-remove-color: #1a0a1a;
/* Selected popover */
--ms-selected-popover-border: 1px solid #ff00ff;
--ms-selected-popover-header-bg: rgba(255, 0, 255, 0.2);
--ms-selected-popover-close-color: #ff00ff;
--ms-selected-popover-close-bg-hover: rgba(255, 0, 255, 0.3);
/* Checkboxes */
--ms-checkbox-bg: #1a0a1a;
--ms-checkbox-border: 1px solid #ff00ff;
--ms-checkbox-checkmark-color: #00ffff;
/* Scrollbar */
--ms-scrollbar-track-bg: #1a0a1a;
--ms-scrollbar-thumb-bg: #ff00ff;
--ms-scrollbar-thumb-bg-hover: #00ffff;
}
/* TH07–TH10 work in light AND dark: every colour a preset sets is a
light-dark(<light>, <dark>) pair, resolved by the color-scheme the card inherits from
the page — the component's own variables work the same way. A preset that set only the
light value (text #333, but the panel background left to the component) turned into
dark text on a dark panel once the page went dark. */
/* Audi Corporate Theme */
.audi-theme {
background: light-dark(#f7f7f7, #1c1c1e);
}
.audi-theme h2 {
color: light-dark(#bb0a30, #f0435f);
font-weight: 300;
letter-spacing: 0.05em;
}
.audi-theme p,
.audi-theme label {
color: light-dark(#555555, #b0b0b0);
}
#audi-mode {
/* Base theme variables */
--base-main-bg: light-dark(#ffffff, #242426);
--base-text-color-1: light-dark(#333333, #e5e5e5);
--base-text-color-3: light-dark(#666666, #a0a0a0);
--base-border-color: light-dark(#d0d0d0, #4a4a4c);
--base-hover-bg: light-dark(#f5f5f5, #2e2e30);
--base-primary-color: light-dark(#bb0a30, #e0284e);
/* Component-specific overrides */
--ms-input-border-radius: 2px;
--ms-dropdown-border-radius: 2px;
--ms-dropdown-box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
/* Badges */
--ms-badge-text-bg: light-dark(#f5f5f5, #2e2e30);
--ms-badge-text-color: light-dark(#333333, #e5e5e5);
--ms-badge-text-border: 1px solid light-dark(#d0d0d0, #4a4a4c);
--ms-badge-border-radius: 2px;
/* Checkboxes */
--ms-checkbox-border-radius: 2px;
/* Scrollbar */
--ms-scrollbar-track-bg: light-dark(#f7f7f7, #1c1c1e);
--ms-scrollbar-thumb-bg: light-dark(#d0d0d0, #4a4a4c);
--ms-scrollbar-thumb-bg-hover: light-dark(#bb0a30, #e0284e);
}
/* Rounded/Soft Theme */
.rounded-theme {
background: linear-gradient(135deg, light-dark(#ffecd2, #3a2a24) 0%, light-dark(#fcb69f, #4a2a2c) 100%);
}
#rounded-mode {
/* Base theme variables */
--base-main-bg: light-dark(#ffffff, #2e2220);
--base-text-color-1: light-dark(#5a3e36, #f3dcd3);
--base-border-color: light-dark(#f0d0c0, #6b4a40);
--base-hover-bg: light-dark(#fff5f0, #3a2a26);
--base-primary-color: #ff6b9d;
--base-primary-bg-subtle: light-dark(#ffe5f0, #4a2236);
/* Custom icons — soft rounded glyphs (circle chevron + circle x) to match the
pill shapes. One --base-icon-* swap covers the toggle chevron and every ✕. */
--base-icon-chevron: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><circle cx='12' cy='12' r='10'/><path d='m10 8 4 4-4 4'/></svg>");
--base-icon-close: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><circle cx='12' cy='12' r='10'/><path d='m15 9-6 6'/><path d='m9 9 6 6'/></svg>");
/* Component-specific overrides */
--ms-input-border-radius: 24px;
--ms-dropdown-border-radius: 16px;
--ms-dropdown-box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
/* Badges */
--ms-badge-text-border: 1px solid light-dark(#ffc0dd, #8a3a5c);
--ms-badge-border-radius: 20px;
/* Checkboxes */
--ms-checkbox-border-radius: 8px;
--ms-checkbox-border: 1px solid light-dark(#ffc0dd, #8a3a5c);
/* Scrollbar */
--ms-scrollbar-track-bg: light-dark(#fff5f0, #2e2220);
--ms-scrollbar-thumb-bg: light-dark(#ffc0dd, #8a3a5c);
--ms-scrollbar-thumb-bg-hover: #ff6b9d;
}
/* Sharp/Minimal Theme */
.sharp-theme {
background: light-dark(#ffffff, #000000);
border: 2px solid light-dark(#000000, #ffffff);
}
#sharp-mode {
/* Base theme variables */
--base-main-bg: light-dark(#ffffff, #000000);
--base-text-color-1: light-dark(#000000, #ffffff);
--base-border-color: light-dark(#000000, #ffffff);
--base-hover-bg: light-dark(#f0f0f0, #1a1a1a);
--base-primary-color: light-dark(#000000, #ffffff);
/* Custom icons — hard geometric glyphs (filled squares) for the brutalist look.
One --base-icon-* swap re-skins the toggle chevron and every ✕. */
--base-icon-chevron: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='black'><path d='M19 2a3 3 0 0 1 3 3v14a3 3 0 0 1 -3 3h-14a3 3 0 0 1 -3 -3v-14a3 3 0 0 1 3 -3zm-10.387 6.21a1 1 0 0 0 -1.32 .083l-.083 .094a1 1 0 0 0 .083 1.32l2.292 2.293l-2.292 2.293l-.083 .094a1 1 0 0 0 1.497 1.32l3 -3l.083 -.094a1 1 0 0 0 -.083 -1.32l-3 -3zm5 0a1 1 0 0 0 -1.32 .083l-.083 .094a1 1 0 0 0 .083 1.32l2.292 2.293l-2.292 2.293l-.083 .094a1 1 0 0 0 1.497 1.32l3 -3l.083 -.094a1 1 0 0 0 -.083 -1.32l-3 -3z'/></svg>");
--base-icon-close: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='black'><path d='M19 2h-14a3 3 0 0 0 -3 3v14a3 3 0 0 0 3 3h14a3 3 0 0 0 3 -3v-14a3 3 0 0 0 -3 -3zm-9.387 6.21l.094 .083l2.293 2.292l2.293 -2.292a1 1 0 0 1 1.497 1.32l-.083 .094l-2.292 2.293l2.292 2.293a1 1 0 0 1 -1.32 1.497l-.094 -.083l-2.293 -2.292l-2.293 2.292a1 1 0 0 1 -1.497 -1.32l.083 -.094l2.292 -2.293l-2.292 -2.293a1 1 0 0 1 1.32 -1.497z'/></svg>");
/* Component-specific overrides */
--ms-input-border: 2px solid light-dark(#000000, #ffffff);
--ms-input-border-radius: 0;
--ms-dropdown-border: 2px solid light-dark(#000000, #ffffff);
--ms-dropdown-border-radius: 0;
--ms-dropdown-box-shadow: none;
/* Badges */
--ms-badge-text-bg: light-dark(#000000, #ffffff);
--ms-badge-text-color: light-dark(#ffffff, #000000);
--ms-badge-text-border: 2px solid light-dark(#000000, #ffffff);
--ms-badge-border-radius: 0;
--ms-badge-remove-bg: light-dark(#ffffff, #000000);
--ms-badge-remove-color: light-dark(#000000, #ffffff);
/* Checkboxes */
--ms-checkbox-border-radius: 0;
--ms-checkbox-border: 2px solid light-dark(#000000, #ffffff);
/* Scrollbar */
--ms-scrollbar-width: 12px;
--ms-scrollbar-track-bg: light-dark(#ffffff, #000000);
--ms-scrollbar-thumb-bg: light-dark(#000000, #ffffff);
--ms-scrollbar-thumb-bg-hover: light-dark(#333333, #cccccc);
--ms-scrollbar-thumb-border-radius: 0;
}
/* Material Design Theme */
.material-theme {
background: linear-gradient(135deg, light-dark(#e3f2fd, #0d2236) 0%, light-dark(#f3e5f5, #2a1530) 100%);
}
#material-mode {
/* Base theme variables */
--base-main-bg: light-dark(#ffffff, #1e1e1e);
--base-text-color-1: light-dark(#212121, #e0e0e0);
--base-text-color-3: light-dark(#757575, #9e9e9e);
--base-hover-bg: light-dark(#f5f5f5, #2c2c2c);
--base-primary-color: #1976d2;
--base-primary-bg-subtle: light-dark(#e3f2fd, #0d2a45);
/* Custom icon + rotation OPT-OUT. Material's dropdown indicator is a PRE-ORIENTED
downward triangle (arrow_drop_down), so we hand the toggle a down-caret glyph and
tell it NOT to rotate the source (0° closed) while still flipping up on open (180°).
This is the escape hatch from the directional-chevron contract, via the new
--ms-toggle-rotate-* pair. */
--base-icon-chevron: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='black'><path d='M18 9c.852 0 1.297 .986 .783 1.623l-.076 .084l-6 6a1 1 0 0 1 -1.32 .083l-.094 -.083l-6 -6l-.083 -.094l-.054 -.077l-.054 -.096l-.017 -.036l-.027 -.067l-.032 -.108l-.01 -.053l-.01 -.06l-.004 -.057v-.118l.005 -.058l.009 -.06l.01 -.052l.032 -.108l.027 -.067l.07 -.132l.065 -.09l.073 -.081l.094 -.083l.077 -.054l.096 -.054l.036 -.017l.067 -.027l.108 -.032l.053 -.01l.06 -.01l.057 -.004l12.059 -.002z'/></svg>");
--ms-toggle-rotate-closed: 0deg;
--ms-toggle-rotate-open: 180deg;
/* The pager rotates its glyph ±90°, so it needs a RIGHT-pointing chevron — give it one
via its own token so our pre-oriented down-caret above doesn't leak into it. This is
the fix that lets a pre-oriented toggle glyph coexist with a correct pager. */
--ms-fullscreen-nav-btn-icon: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='m9 18 6-6-6-6'/></svg>");
/* Component-specific overrides */
--ms-input-border: 1px solid transparent;
--ms-input-border-radius: 4px;
--ms-dropdown-border: 1px solid transparent;
--ms-dropdown-border-radius: 4px;
--ms-dropdown-box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
/* Badges */
--ms-badge-border-radius: 16px;
/* Checkboxes */
--ms-checkbox-border-radius: 2px;
/* Scrollbar */
--ms-scrollbar-track-bg: transparent;
--ms-scrollbar-thumb-bg: light-dark(#bdbdbd, #555555);
--ms-scrollbar-thumb-bg-hover: #1976d2;
}
/* The kit's .form-text, toned to each theme card's own text colour. */
.theme-card .form-text {
font-size: 0.75rem;
color: inherit;
opacity: 0.7;
}
/* Built-in color-scheme demo. The card's OWN chrome follows the same signal it
passes to the picker, so the whole panel flips coherently:
- Auto → no data-theme: the card and the picker both inherit the page's scheme (the
page's <html data-theme> / color-scheme; on a page with no signal, the OS).
- Light → data-theme="light" (section signal, read via theme-source="closest" on the picker)
- Dark → data-theme="dark"
No component color overrides here (no --ms- or --base- vars): dark styling is 100%
the component built-in light-dark() fallbacks, driven only by color-scheme. */
/* The dark card is a near-black *page* surface, deliberately DARKER than the
component's built-in dark input background (~#1a1a1a) so the picker reads as an
elevated panel and its border doesn't vanish into a same-colour card. */
.scheme-demo {
padding: 1.5rem;
border-radius: 8px;
border: 1px solid;
transition: background-color .2s ease, color .2s ease, border-color .2s ease;
/* Auto (no data-theme): follow the inherited color-scheme, like the picker does. */
background: light-dark(#ffffff, #0c0c0e);
color: light-dark(#111827, #e5e5e5);
border-color: light-dark(#e2e8f0, #2e2e33);
}
.scheme-demo[data-theme="light"] {
color-scheme: light;
background: #ffffff;
color: #111827;
border-color: #e2e8f0;
}
.scheme-demo[data-theme="dark"] {
color-scheme: dark;
background: #0c0c0e;
color: #e5e5e5;
border-color: #2e2e33;
}
.scheme-demo .form-text { color: inherit; }
</style>
<style>
/* Segmented Auto / Light / Dark switch built from radios. */
.segmented {
display: inline-flex;
border: 1px solid var(--kmwc-border-color-strong);
border-radius: var(--kmwc-radius-md);
overflow: hidden;
margin-bottom: 1.25rem;
}
.segmented label {
padding: 0.4rem 1rem;
cursor: pointer;
font-size: 0.9rem;
background: var(--kmwc-elevated-bg);
color: var(--kmwc-text-color-2);
border-inline-start: 1px solid var(--kmwc-border-color-strong);
}
.segmented label:first-of-type { border-inline-start: none; }
.segmented input { position: absolute; opacity: 0; pointer-events: none; }
.segmented label:has(input:checked) { background: var(--kmwc-accent-color); color: var(--kmwc-text-color-on-accent); }
</style>
<!-- Built-in Color Scheme (auto / light / dark) -->
<section class="example-section" style="margin-bottom: 3rem;">
<h2>TH01 · Built-in Color Scheme — auto / light / dark</h2>
<p>
Every picker ships <strong>dark-ready</strong>: all <code>--ms-*</code> color defaults are
wrapped in CSS <code>light-dark()</code>, keyed on the host's <code>color-scheme</code>. You
never override <code>--base-*</code> to go dark (that's what the theme cards further down do,
for <em>custom</em> palettes) — you just <strong>signal the scheme</strong> and the component
picks the right branch. Three ways, in priority order:
</p>
<ul>
<li><strong>Per-instance</strong> — <code>data-theme="dark"</code> / <code>"light"</code> on the
<code><web-multiselect></code> itself (highest priority; overrides any ancestor).</li>
<li><strong>Page signal</strong> — <code>.dark</code> (Tailwind), <code>[data-bs-theme="dark"]</code>
(Bootstrap 5.3+) or <code>[data-theme="dark"]</code> on <code><html></code> / <code><body></code>,
detected once for every Keenmate component. For a themed <em>section</em> (like the card below),
add <code>theme-source="closest"</code> to the picker.</li>
<li><strong>Follow the OS</strong> — set no explicit signal and let the page opt into
<code>color-scheme: light dark</code>; both the page and the picker track the system setting.</li>
</ul>
<div class="segmented" role="radiogroup" aria-label="Color scheme">
<label><input type="radio" name="scheme" value="auto" checked> Auto (page)</label>
<label><input type="radio" name="scheme" value="light"> Light</label>
<label><input type="radio" name="scheme" value="dark"> Dark</label>
</div>
<!-- The card carries the signal; the picker inside inherits it. -->
<div class="scheme-demo" id="scheme-demo">
<div class="form-group" style="max-width: 420px;">
<label for="scheme-select" style="display:block; margin-bottom:.4rem; font-weight:600;">Select technologies</label>
<web-multiselect id="scheme-select" multiple="true" show-checkboxes="true"
badges-display-mode="badges" theme-source="closest"></web-multiselect>
<span class="form-text">Open the dropdown — the panel, options, checkboxes, badges and scrollbar all flip with the scheme. No per-instance color overrides in play.</span>
</div>
</div>
<details class="mt-1">
<summary>Show code</summary>
<div class="code-block" data-language="html"><pre><code><!-- 1. Per-instance (wins over everything) -->
<web-multiselect data-theme="dark"></web-multiselect>
<!-- 2. Page signal (detected once for every Keenmate component) -->
<html class="dark"> <!-- Tailwind -->
<html data-bs-theme="dark"> <!-- Bootstrap 5.3+ -->
<!-- …or a themed section: point the picker at it -->
<div data-theme="dark"> … <web-multiselect theme-source="closest"></web-multiselect> … </div>
<!-- 3. Follow the OS: opt the page into system switching -->
<style> html { color-scheme: light dark; } </style>
<web-multiselect></web-multiselect> <!-- no signal → tracks prefers-color-scheme -->
// switch at runtime — it's just an attribute
picker.setAttribute('data-theme', 'dark'); // or 'light'
picker.removeAttribute('data-theme'); // back to inherit/OS</code></pre></div>
</details>
</section>
<!-- Grouped options + fullscreen mode switch, themed -->
<section class="example-section" style="margin-bottom: 3rem;">
<h2>TH02 · Grouped options + fullscreen mode switch</h2>
<p>
Everything at once: <strong>grouped options</strong> (<code>group-member</code>) rendered in the
<strong>fullscreen overlay</strong>, with the built-in <code>filter</code>↔<code>navigate</code>
toggle (<code>show-search-mode-toggle</code>) in the search header — all following the same
built-in color scheme. Pick a scheme, tick <em>Preview as fullscreen</em>, open the picker, then
tap the leading icon in the search bar (magnifier = navigate, funnel = filter). Group headers,
matched rows, checkboxes, badges and the <code>N of M</code> match navigator all stay themed
with zero per-instance color overrides.
</p>
<div class="segmented" role="radiogroup" aria-label="Color scheme">
<label><input type="radio" name="scheme2" value="auto" checked> Auto (page)</label>
<label><input type="radio" name="scheme2" value="light"> Light</label>
<label><input type="radio" name="scheme2" value="dark"> Dark</label>
</div>
<label class="toggle-label" style="margin-inline-start: 1rem;">
<input type="checkbox" id="grouped-fs-preview"> Preview as fullscreen (desktop)
</label>
<kmwc-demo>
<div class="scheme-demo" id="grouped-demo">
<div class="form-group" style="max-width: 420px;">
<label for="grouped-select" style="display:block; margin-bottom:.4rem; font-weight:600;">Select technologies</label>
<web-multiselect id="grouped-select" multiple="true" show-checkboxes="true"
group-member="group" search-mode="navigate" show-search-mode-toggle
badges-display-mode="partial" max-visible-badge-count="3" theme-source="closest"></web-multiselect>
<span class="form-text">Grouped by Frontend / Runtimes / Languages. In the fullscreen sheet, tap the leading search icon to switch filter ↔ navigate.</span>
</div>
</div>
<script type="module" data-kmwc-show>
const picker = document.getElementById('grouped-select');
picker.valueMember = 'value';
picker.displayValueMember = 'label';
picker.options = [
{ value: 'react', label: 'React', group: 'Frontend' },
{ value: 'vue', label: 'Vue.js', group: 'Frontend' },
{ value: 'angular', label: 'Angular', group: 'Frontend' },
{ value: 'svelte', label: 'Svelte', group: 'Frontend' },
{ value: 'nodejs', label: 'Node.js', group: 'Runtimes' },
{ value: 'deno', label: 'Deno', group: 'Runtimes' },
{ value: 'typescript', label: 'TypeScript', group: 'Languages' },
{ value: 'javascript', label: 'JavaScript', group: 'Languages' },
{ value: 'python', label: 'Python', group: 'Languages' },
{ value: 'rust', label: 'Rust', group: 'Languages' },
{ value: 'go', label: 'Go', group: 'Languages' },
{ value: 'java', label: 'Java', group: 'Languages' },
{ value: 'csharp', label: 'C#', group: 'Languages' },
{ value: 'php', label: 'PHP', group: 'Languages' },
{ value: 'ruby', label: 'Ruby', group: 'Languages' }
];
picker.setSelected(['react', 'vue', 'typescript', 'rust']);
// Theme it like everything else: just signal the scheme
// (data-theme="dark" | "light" on an ancestor, or follow the OS).
</script>
</kmwc-demo>
</section>
<!-- Input Sizes Section -->
<section class="example-section" style="margin-bottom: 3rem;">
<h2>TH03 · Sizing — scale the whole picker with <code>--ms-rem</code></h2>
<p>
There's no <code>size</code> attribute — the component scales everything (input height, font,
padding, checkboxes, badges, dropdown) off a single base unit, <code>--ms-rem</code>
(default <code>10px</code>). Set it on the element (or a theme layer) and the whole picker
scales proportionally. For one-off tweaks, override the individual <code>--ms-input-*</code>
variables instead. The presets below are just different <code>--ms-rem</code> values.</p>
<!-- Size Reference Table — --ms-rem drives input height (3.5×) and font (1.4×). -->
<table class="reference-table table-scroll">
<thead>
<tr>
<th>Preset</th>
<th><code>--ms-rem</code></th>
<th>Input height <span style="font-weight:400;">(3.5×)</span></th>
<th>Font <span style="font-weight:400;">(1.4×)</span></th>
</tr>
</thead>
<tbody>
<tr>
<td><code>xs</code></td>
<td><code>8px</code></td>
<td>28px</td>
<td>11px</td>
</tr>
<tr>
<td><code>sm</code></td>
<td><code>9px</code></td>
<td>31px</td>
<td>13px</td>
</tr>
<tr class="is-highlight">
<td><code>md</code> (default)</td>
<td><strong>10px</strong></td>
<td><strong>35px</strong></td>
<td>14px</td>
</tr>
<tr>
<td><code>lg</code></td>
<td><code>12px</code></td>
<td>42px</td>
<td>17px</td>
</tr>
<tr>
<td><code>xl</code></td>
<td><code>14px</code></td>
<td>49px</td>
<td>20px</td>
</tr>
</tbody>
</table>
<p style="font-size: 0.875rem; color: var(--kmwc-text-color-3); margin-bottom: 1.5rem;">
<strong>Note:</strong> the input height is <code>calc(3.5 * var(--ms-rem))</code> and font
<code>calc(1.4 * var(--ms-rem))</code>, so both track the base unit. For Pure Admin, set
<code>--ms-rem: 1rem</code> (with <code>html { font-size: 10px }</code>).
</p>
<div style="display: flex; flex-direction: column; gap: 1.5rem; max-width: 500px;">
<div class="form-group">
<label>Extra Small (xs)</label>
<web-multiselect
id="size-xs"
style="--ms-rem: 8px"
placeholder="Extra small input..."
multiple="false">
</web-multiselect>
</div>
<div class="form-group">
<label>Small (sm)</label>
<web-multiselect
id="size-sm"
style="--ms-rem: 9px"
placeholder="Small input..."
multiple="false">
</web-multiselect>
</div>
<div class="form-group">
<label>Medium (md) - Default</label>
<web-multiselect
id="size-md"
style="--ms-rem: 10px"
placeholder="Medium input (default)..."
multiple="false">
</web-multiselect>
</div>
<div class="form-group">
<label>Large (lg)</label>
<web-multiselect
id="size-lg"
style="--ms-rem: 12px"
placeholder="Large input..."
multiple="false">
</web-multiselect>
</div>
<div class="form-group">
<label>Extra Large (xl)</label>
<web-multiselect
id="size-xl"
style="--ms-rem: 14px"
placeholder="Extra large input..."
multiple="false">
</web-multiselect>
</div>
</div>
</section>
<h2 style="margin-bottom: 1.5rem;">TH04 · Theme Examples</h2>
<div class="card-grid theme-grid">
<!-- Dark Mode Theme -->
<div class="theme-card dark-theme">
<h2>TH05 · Dark Mode</h2>
<p>High contrast dark theme for low-light environments</p>
<div class="form-group">
<label for="dark-mode">Select Technologies</label>
<web-multiselect
id="dark-mode"
placeholder="Choose your stack..."
show-checkboxes="true"
show-select-all="true">
</web-multiselect>
<span class="form-text">Dark backgrounds with light text and purple accents</span>
</div>
</div>
<!-- Neon/Cyberpunk Theme -->
<div class="theme-card neon-theme">
<h2>TH06 · Neon/Cyberpunk</h2>
<p>Bright neon colors with glowing effects</p>
<div class="form-group">
<label for="neon-mode">Select Technologies</label>
<web-multiselect
id="neon-mode"
placeholder="Choose your stack..."
show-checkboxes="true"
show-select-all="true">
</web-multiselect>
<span class="form-text">Cyan and magenta with glowing shadows · custom double-chevron + square-x icons via <code>--base-icon-*</code></span>
</div>
</div>
<!-- Audi Corporate Theme -->
<div class="theme-card audi-theme">
<h2>TH07 · Audi Corporate</h2>
<p>Clean, minimal corporate styling with subtle borders</p>
<div class="form-group">
<label for="audi-mode">Select Technologies</label>
<web-multiselect
id="audi-mode"
placeholder="Choose your stack..."
show-checkboxes="true"
show-select-all="true">
</web-multiselect>
<span class="form-text">Professional gray with Audi red accents</span>
</div>
</div>
<!-- Rounded/Soft Theme -->
<div class="theme-card rounded-theme">
<h2>TH08 · Rounded/Soft</h2>
<p>Large border-radius with soft shadows and pastel colors</p>
<div class="form-group">
<label for="rounded-mode">Select Technologies</label>
<web-multiselect
id="rounded-mode"
placeholder="Choose your stack..."
show-checkboxes="true"
show-select-all="true">
</web-multiselect>
<span class="form-text">Warm gradient background with pink accents · soft circle icons via <code>--base-icon-*</code></span>
</div>
</div>
<!-- Sharp/Minimal Theme -->
<div class="theme-card sharp-theme">
<h2>TH09 · Sharp/Minimal</h2>
<p>No border-radius, flat design, pure black and white</p>
<div class="form-group">
<label for="sharp-mode">Select Technologies</label>
<web-multiselect
id="sharp-mode"
placeholder="Choose your stack..."
show-checkboxes="true"
show-select-all="true">
</web-multiselect>
<span class="form-text">Brutalist design with sharp edges · filled square icons via <code>--base-icon-*</code></span>
</div>
</div>
<!-- Material Design Theme -->
<div class="theme-card material-theme">
<h2>TH10 · Material Design</h2>
<p>Elevation shadows, vibrant colors, standard radius</p>
<div class="form-group">
<label for="material-mode">Select Technologies</label>
<web-multiselect
id="material-mode"
placeholder="Choose your stack..."
show-checkboxes="true"
show-select-all="true">
</web-multiselect>
<span class="form-text">Google Material Design principles · pre-oriented down-caret with <code>--ms-toggle-rotate-*</code> opt-out</span>
</div>
</div>
</div>
<!-- ===== Merged from base-variables page ===== -->
<!-- Controls Panel -->
<div class="card">
<div class="controls-header">
<h2>TH11 · Typography Controls</h2>
<button class="btn-danger" id="resetBtn">Reset All</button>
</div>
<!-- Font Link -->
<div class="control-section">
<h3>Font Link (Google Fonts, etc.)</h3>
<div class="control-row controls">
<div class="control-group font-link-group">
<label for="fontLink">Paste <link> tag or URL</label>
<input type="text" id="fontLink" class="font-link-input" placeholder="e.g., https://fonts.googleapis.com/css2?family=Lexend...">
</div>
<button id="loadFontBtn" class="btn-outline">Load Font</button>
</div>
</div>
<!-- Font Family -->
<div class="control-section">
<h3>Font Family</h3>
<div class="control-row controls">
<div class="control-group">
<label for="fontFamily">--base-font-family</label>
<input type="text" id="fontFamily" placeholder="e.g., 'Lexend', sans-serif">
</div>
</div>
</div>
<!-- Font Sizes -->
<div class="control-section">
<h3>Font Sizes (unitless multipliers)</h3>
<p class="section-desc">
<strong>2xs:</strong> tiny labels •
<strong>xs:</strong> group labels, hints •
<strong>sm:</strong> option text, badges •
<strong>base:</strong> input text •
<strong>lg:</strong> large displays
</p>
<div class="control-row controls">
<div class="control-group">
<label for="fontSize2xs">2xs</label>
<input type="number" id="fontSize2xs" value="1" step="0.1">
</div>
<div class="control-group">
<label for="fontSizeXs">xs</label>
<input type="number" id="fontSizeXs" value="1.2" step="0.1">
</div>
<div class="control-group">
<label for="fontSizeSm">sm</label>
<input type="number" id="fontSizeSm" value="1.4" step="0.1">
</div>
<div class="control-group">
<label for="fontSizeBase">base</label>
<input type="number" id="fontSizeBase" value="1.6" step="0.1">
</div>
<div class="control-group">
<label for="fontSizeLg">lg</label>
<input type="number" id="fontSizeLg" value="1.8" step="0.1">
</div>
</div>
</div>
<!-- Font Weights -->
<div class="control-section">
<h3>Font Weights</h3>
<div class="control-row controls">
<div class="control-group">
<label for="fontWeightNormal">normal</label>
<input type="number" id="fontWeightNormal" value="400" step="100" min="100" max="900">
</div>
<div class="control-group">
<label for="fontWeightMedium">medium</label>
<input type="number" id="fontWeightMedium" value="500" step="100" min="100" max="900">
</div>
<div class="control-group">
<label for="fontWeightSemibold">semibold</label>
<input type="number" id="fontWeightSemibold" value="600" step="100" min="100" max="900">
</div>
</div>
</div>
<!-- Line Heights -->
<div class="control-section">
<h3>Line Heights</h3>
<div class="control-row controls">
<div class="control-group">
<label for="lineHeightTight">tight</label>
<input type="number" id="lineHeightTight" value="1.25" step="0.05" min="1" max="3">
</div>
<div class="control-group">
<label for="lineHeightNormal">normal</label>
<input type="number" id="lineHeightNormal" value="1.5" step="0.05" min="1" max="3">
</div>
<div class="control-group">
<label for="lineHeightRelaxed">relaxed</label>
<input type="number" id="lineHeightRelaxed" value="1.75" step="0.05" min="1" max="3">
</div>
</div>
</div>
</div>
<!-- Demo Cards -->
<div class="grid-2">
<!-- Single Select -->
<div class="demo-card">
<h3>Single Select</h3>
<p>Basic single selection. Tests input styling and dropdown typography.</p>
<web-multiselect
id="singleSelect"
placeholder="Select a framework..."
multiple="false"
></web-multiselect>
</div>
<!-- Multi Select with Badges -->
<div class="demo-card">
<h3>Multi Select with Badges</h3>
<p>Multiple selection with badge display. Tests badge typography and sizing.</p>
<web-multiselect
id="multiBadges"
placeholder="Select frameworks..."
badges-display-mode="badges"
show-checkboxes="true"
></web-multiselect>
</div>
<!-- Multi Select with Count -->
<div class="demo-card">
<h3>Multi Select with Count</h3>
<p>Count display mode. Tests counter typography.</p>
<web-multiselect
id="multiCount"
placeholder="Select languages..."
badges-display-mode="count"
show-checkboxes="true"
></web-multiselect>
</div>
<!-- With Groups -->
<div class="demo-card">
<h3>Grouped Options</h3>
<p>Tests group label typography and styling.</p>
<web-multiselect
id="grouped"
placeholder="Select technologies..."
show-checkboxes="true"
></web-multiselect>
</div>
</div>
<!-- Current Values Display -->
<div class="log-panel log-panel--dark current-values">
<div class="current-values-header">/* Current --base-* CSS Variables */</div>
<div id="currentValues">:root {
/* No overrides set - using component defaults */
}</div>
</div>
<!-- ===== Merged from sizes page ===== -->
<!-- Scaling with --ms-rem -->
<section class="example-section">
<h2>TH12 · Global Scaling with --ms-rem</h2>
<p>The <code>--ms-rem</code> CSS variable (default: 10px) controls the base unit for all dimensions. Change it to scale the entire component proportionally.</p>
<p>Set it inline, as below, or from a class (<code>web-multiselect.compact { --ms-rem: 8px; }</code>).</p>
<kmwc-demo>
<div class="form-group">
<label>Compact — 80%, great for dense UIs</label>
<web-multiselect id="rem-compact" style="--ms-rem: 8px;"
placeholder="Compact scaling..." multiple="false"></web-multiselect>
</div>
<div class="form-group">
<label>Default — <code>--ms-rem: 10px</code></label>
<web-multiselect id="rem-default"
placeholder="Default scaling..." multiple="false"></web-multiselect>
</div>
<div class="form-group">
<label>Large — 120%, better touch targets</label>
<web-multiselect id="rem-large" style="--ms-rem: 12px;"
placeholder="Large scaling..." multiple="false"></web-multiselect>
</div>
<div class="form-group">
<label>Extra large — 150%, accessibility focused</label>
<web-multiselect id="rem-xl" style="--ms-rem: 15px;"
placeholder="Extra large scaling..." multiple="false"></web-multiselect>
</div>
</kmwc-demo>
</section>
<!-- Fine-grained Control -->
<section class="example-section">
<h2>TH13 · Fine-Grained Control</h2>
<p>Override individual CSS variables for precise control over specific dimensions.</p>
<kmwc-demo>