@jungherz-de/glasskit 1.24.0 → 1.25.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.
package/glasskit.css CHANGED
@@ -1,6 +1,6 @@
1
1
  /* ============================================================
2
2
  GLASSKIT COMPONENT LIBRARY
3
- Jungherz GmbH – v1.24.0
3
+ Jungherz GmbH – v1.25.0
4
4
 
5
5
  Features:
6
6
  - Scoped Reset (box-sizing fix)
@@ -420,34 +420,63 @@
420
420
 
421
421
 
422
422
  /* ============================================================
423
- 1d. SURFACE PRESET – SOLID
423
+ 1d. SURFACE PRESETS – SOLID AND TINT
424
424
  ============================================================ */
425
- /* Opt-in, next to the theme and the density: <html data-surface="solid">.
426
- Opaque surfaces without blur and gloss, for admin screens, forms on a
427
- plain background, designs without glass (since 1.24.0). Each surface
428
- takes the colour the glass shows over the theme's middle background,
429
- --gl-color-bg-mid: one surface above another keeps its place in the
430
- order, and a re-branded background carries over. Blur, the inner shine
431
- (--gl-inset-*) and the gloss are off. Borders, drop shadows, the tints
432
- of badges and chips and the dimming overlay stay as they are.
433
-
434
- The bare selector matches <html>, like the density preset. A theme scope
425
+ /* Opt-in, next to the theme and the density, on <html>.
426
+
427
+ data-surface="solid" (since 1.24.0): opaque surfaces without blur and
428
+ gloss, for admin screens, forms on a plain background, designs without
429
+ glass. Each surface takes the colour the glass shows over the theme's
430
+ middle background, --gl-color-bg-mid: one surface above another keeps
431
+ its place in the order, and a re-branded background carries over.
432
+
433
+ data-surface="tint" (since 1.25.0): for a page with a background of its
434
+ own — a brand colour, a photo, a pattern — where a surface mixed over
435
+ --gl-color-bg-mid would stand out as a foreign block. The surfaces in the
436
+ flow of the page become see-through tints of the text colour, nothing
437
+ blurred: a field on a card stays as see-through as the card, and its
438
+ contrast follows the text. What lies over other content keeps the solid
439
+ values: modal, sheet, popover, toast and the tab bars (1e). So do the
440
+ milk surfaces, light plates for dark ink: a see-through secondary button
441
+ would lose its text on a dark page.
442
+
443
+ Both turn off the blur, the inner shine (--gl-inset-*) and the gloss.
444
+ Borders, drop shadows, the tints of badges and chips and the dimming
445
+ overlay stay as they are; a blur behind dialogs stays where a project
446
+ sets --gl-blur-overlay.
447
+
448
+ The bare selectors match <html>, like the density preset. A theme scope
435
449
  inside the page — an element with its own data-theme — re-declares its
436
- theme's glass tokens, so the preset names it too. build-styles-js.mjs
437
- moves both blocks into tokensCss, after the density block. */
450
+ theme's glass tokens, so the presets name it too. build-styles-js.mjs
451
+ moves the three blocks into tokensCss, after the density block. */
452
+
453
+ /* Solid, dark theme — and the ground of the tint preset. The solid
454
+ surfaces are kept under names of their own as well, --gl-solid-*: the
455
+ panels of the tint preset take them from there (1e). */
438
456
  [data-surface="solid"],
439
- [data-surface="solid"] [data-theme="dark"] {
440
- --gl-surface-1: color-mix(in srgb, #ffffff 8%, var(--gl-color-bg-mid));
441
- --gl-surface-2: color-mix(in srgb, #ffffff 10%, var(--gl-color-bg-mid));
442
- --gl-surface-3: color-mix(in srgb, #ffffff 14%, var(--gl-color-bg-mid));
443
- --gl-surface-4: color-mix(in srgb, #ffffff 16%, var(--gl-color-bg-mid));
444
- --gl-surface-5: color-mix(in srgb, #ffffff 22%, var(--gl-color-bg-mid));
457
+ [data-surface="tint"],
458
+ [data-surface="solid"] [data-theme="dark"],
459
+ [data-surface="tint"] [data-theme="dark"] {
460
+ --gl-solid-surface-1: color-mix(in srgb, #ffffff 8%, var(--gl-color-bg-mid));
461
+ --gl-solid-surface-2: color-mix(in srgb, #ffffff 10%, var(--gl-color-bg-mid));
462
+ --gl-solid-surface-3: color-mix(in srgb, #ffffff 14%, var(--gl-color-bg-mid));
463
+ --gl-solid-surface-4: color-mix(in srgb, #ffffff 16%, var(--gl-color-bg-mid));
464
+ --gl-solid-surface-5: color-mix(in srgb, #ffffff 22%, var(--gl-color-bg-mid));
465
+ --gl-solid-card-glow-top: color-mix(in srgb, #ffffff 32%, var(--gl-color-bg-mid));
466
+ --gl-solid-card-glow-mid: color-mix(in srgb, #ffffff 22%, var(--gl-color-bg-mid));
467
+ --gl-solid-card-glow-low: color-mix(in srgb, #ffffff 14%, var(--gl-color-bg-mid));
468
+ --gl-solid-card-glow-bottom: color-mix(in srgb, #ffffff 8%, var(--gl-color-bg-mid));
469
+ --gl-surface-1: var(--gl-solid-surface-1);
470
+ --gl-surface-2: var(--gl-solid-surface-2);
471
+ --gl-surface-3: var(--gl-solid-surface-3);
472
+ --gl-surface-4: var(--gl-solid-surface-4);
473
+ --gl-surface-5: var(--gl-solid-surface-5);
445
474
  --gl-surface-milk: color-mix(in srgb, #ffffff 55%, var(--gl-color-bg-mid));
446
475
  --gl-surface-milk-strong: color-mix(in srgb, #ffffff 75%, var(--gl-color-bg-mid));
447
- --gl-card-glow-top: color-mix(in srgb, #ffffff 32%, var(--gl-color-bg-mid));
448
- --gl-card-glow-mid: color-mix(in srgb, #ffffff 22%, var(--gl-color-bg-mid));
449
- --gl-card-glow-low: color-mix(in srgb, #ffffff 14%, var(--gl-color-bg-mid));
450
- --gl-card-glow-bottom: color-mix(in srgb, #ffffff 8%, var(--gl-color-bg-mid));
476
+ --gl-card-glow-top: var(--gl-solid-card-glow-top);
477
+ --gl-card-glow-mid: var(--gl-solid-card-glow-mid);
478
+ --gl-card-glow-low: var(--gl-solid-card-glow-low);
479
+ --gl-card-glow-bottom: var(--gl-solid-card-glow-bottom);
451
480
  --gl-toggle-thumb-bg: linear-gradient(to bottom, #ffffff 0%, #f0f0f0 100%);
452
481
  --gl-shadow-glow: 0 4px 16px rgba(0, 0, 0, 0.15);
453
482
  --gl-blur: 0px;
@@ -464,20 +493,33 @@
464
493
  --gl-gloss-progress: none;
465
494
  --gl-range-thumb-border: 2px solid transparent;
466
495
  }
496
+ /* Solid, light theme — and the tint preset's ground in it. */
467
497
  [data-surface="solid"][data-theme="light"],
468
498
  [data-surface="solid"] [data-theme="light"],
469
- [data-theme="light"] [data-surface="solid"] {
470
- --gl-surface-1: color-mix(in srgb, #ffffff 50%, var(--gl-color-bg-mid));
471
- --gl-surface-2: color-mix(in srgb, #ffffff 60%, var(--gl-color-bg-mid));
472
- --gl-surface-3: color-mix(in srgb, #ffffff 70%, var(--gl-color-bg-mid));
473
- --gl-surface-4: color-mix(in srgb, #ffffff 75%, var(--gl-color-bg-mid));
474
- --gl-surface-5: color-mix(in srgb, #ffffff 85%, var(--gl-color-bg-mid));
499
+ [data-theme="light"] [data-surface="solid"],
500
+ [data-surface="tint"][data-theme="light"],
501
+ [data-surface="tint"] [data-theme="light"],
502
+ [data-theme="light"] [data-surface="tint"] {
503
+ --gl-solid-surface-1: color-mix(in srgb, #ffffff 50%, var(--gl-color-bg-mid));
504
+ --gl-solid-surface-2: color-mix(in srgb, #ffffff 60%, var(--gl-color-bg-mid));
505
+ --gl-solid-surface-3: color-mix(in srgb, #ffffff 70%, var(--gl-color-bg-mid));
506
+ --gl-solid-surface-4: color-mix(in srgb, #ffffff 75%, var(--gl-color-bg-mid));
507
+ --gl-solid-surface-5: color-mix(in srgb, #ffffff 85%, var(--gl-color-bg-mid));
508
+ --gl-solid-card-glow-top: color-mix(in srgb, #ffffff 90%, var(--gl-color-bg-mid));
509
+ --gl-solid-card-glow-mid: color-mix(in srgb, #ffffff 78%, var(--gl-color-bg-mid));
510
+ --gl-solid-card-glow-low: color-mix(in srgb, #ffffff 65%, var(--gl-color-bg-mid));
511
+ --gl-solid-card-glow-bottom: color-mix(in srgb, #ffffff 50%, var(--gl-color-bg-mid));
512
+ --gl-surface-1: var(--gl-solid-surface-1);
513
+ --gl-surface-2: var(--gl-solid-surface-2);
514
+ --gl-surface-3: var(--gl-solid-surface-3);
515
+ --gl-surface-4: var(--gl-solid-surface-4);
516
+ --gl-surface-5: var(--gl-solid-surface-5);
475
517
  --gl-surface-milk: color-mix(in srgb, #ffffff 85%, var(--gl-color-bg-mid));
476
518
  --gl-surface-milk-strong: color-mix(in srgb, #ffffff 92%, var(--gl-color-bg-mid));
477
- --gl-card-glow-top: color-mix(in srgb, #ffffff 90%, var(--gl-color-bg-mid));
478
- --gl-card-glow-mid: color-mix(in srgb, #ffffff 78%, var(--gl-color-bg-mid));
479
- --gl-card-glow-low: color-mix(in srgb, #ffffff 65%, var(--gl-color-bg-mid));
480
- --gl-card-glow-bottom: color-mix(in srgb, #ffffff 50%, var(--gl-color-bg-mid));
519
+ --gl-card-glow-top: var(--gl-solid-card-glow-top);
520
+ --gl-card-glow-mid: var(--gl-solid-card-glow-mid);
521
+ --gl-card-glow-low: var(--gl-solid-card-glow-low);
522
+ --gl-card-glow-bottom: var(--gl-solid-card-glow-bottom);
481
523
  --gl-shadow-glow: 0 2px 8px rgba(0, 0, 0, 0.05),
482
524
  0 4px 12px rgba(0, 0, 0, 0.04);
483
525
  --gl-inset-subtle: inset 0 0 0 transparent;
@@ -485,6 +527,45 @@
485
527
  --gl-inset-strong: inset 0 0 0 transparent;
486
528
  --gl-inset-milk: inset 0 0 0 transparent;
487
529
  }
530
+ /* Tint: the surfaces in the flow of the page become see-through tints of
531
+ the text colour. One block for both themes: the text colour is the
532
+ theme's. It comes after the solid blocks and outranks the light one. */
533
+ :root[data-surface="tint"],
534
+ [data-surface="tint"][data-theme],
535
+ [data-surface="tint"] [data-theme],
536
+ [data-theme] [data-surface="tint"] {
537
+ --gl-surface-1: color-mix(in srgb, var(--gl-color-text) 4%, transparent);
538
+ --gl-surface-2: color-mix(in srgb, var(--gl-color-text) 6%, transparent);
539
+ --gl-surface-3: color-mix(in srgb, var(--gl-color-text) 9%, transparent);
540
+ --gl-surface-4: color-mix(in srgb, var(--gl-color-text) 12%, transparent);
541
+ --gl-surface-5: color-mix(in srgb, var(--gl-color-text) 16%, transparent);
542
+ --gl-card-glow-top: color-mix(in srgb, var(--gl-color-text) 16%, transparent);
543
+ --gl-card-glow-mid: color-mix(in srgb, var(--gl-color-text) 12%, transparent);
544
+ --gl-card-glow-low: color-mix(in srgb, var(--gl-color-text) 9%, transparent);
545
+ --gl-card-glow-bottom: color-mix(in srgb, var(--gl-color-text) 6%, transparent);
546
+ }
547
+
548
+
549
+ /* ============================================================
550
+ 1e. TINT PRESET – PANELS
551
+ ============================================================ */
552
+ /* What lies over other content stays opaque under data-surface="tint":
553
+ it takes the solid surfaces the preset keeps under --gl-solid-*, and so
554
+ does what sits inside it — a field in a modal, a row in a popover. A
555
+ component rule, not a token block, so that it also matches inside the
556
+ shadow roots of GlassKit Elements, on the theme wrapper that mirrors
557
+ data-surface. */
558
+ [data-surface="tint"] :is(.glass-modal, .glass-sheet, .glass-popover, .glass-toast, .glass-tab-bar, .glass-tab-bar__accessory) {
559
+ --gl-surface-1: var(--gl-solid-surface-1);
560
+ --gl-surface-2: var(--gl-solid-surface-2);
561
+ --gl-surface-3: var(--gl-solid-surface-3);
562
+ --gl-surface-4: var(--gl-solid-surface-4);
563
+ --gl-surface-5: var(--gl-solid-surface-5);
564
+ --gl-card-glow-top: var(--gl-solid-card-glow-top);
565
+ --gl-card-glow-mid: var(--gl-solid-card-glow-mid);
566
+ --gl-card-glow-low: var(--gl-solid-card-glow-low);
567
+ --gl-card-glow-bottom: var(--gl-solid-card-glow-bottom);
568
+ }
488
569
 
489
570
 
490
571
  /* ============================================================
@@ -802,6 +883,9 @@ a.glass-btn { display: inline-flex; text-decoration: none; }
802
883
  color: var(--gl-icon-strong);
803
884
  padding-inline-start: var(--gl-space-2xs);
804
885
  }
886
+ /* Without text a label takes no room: an empty one kept the group's gap
887
+ above its field (until 1.24.0). */
888
+ .glass-label:empty { display: none; }
805
889
 
806
890
  .glass-input {
807
891
  width: 100%; height: var(--gl-control-height, 52px);
@@ -818,7 +902,15 @@ a.glass-btn { display: inline-flex; text-decoration: none; }
818
902
  outline: none;
819
903
  box-shadow: var(--gl-inset-subtle);
820
904
  -webkit-tap-highlight-color: transparent;
905
+ /* A value or placeholder too long for the field ends in an ellipsis
906
+ while the field is not being edited (since 1.25.0). */
907
+ text-overflow: ellipsis;
821
908
  }
909
+ /* The browser's own picker button of a date or time field, and the arrow
910
+ of a datalist, unless --gl-input-picker-icon is none (since 1.25.0) —
911
+ when the field's prefix is the picker, for instance; call showPicker()
912
+ from it then. Unset, revert keeps each browser's own. */
913
+ .glass-input::-webkit-calendar-picker-indicator { display: var(--gl-input-picker-icon, revert); }
822
914
 
823
915
  .glass-input::placeholder { color: var(--gl-placeholder); }
824
916
 
@@ -931,7 +1023,13 @@ a.glass-btn { display: inline-flex; text-decoration: none; }
931
1023
  transition: var(--gl-transition);
932
1024
  outline: none;
933
1025
  box-shadow: var(--gl-inset-subtle);
1026
+ /* --gl-textarea-field-sizing: content lets text areas grow with their
1027
+ text (since 1.25.0); off by default, because it ignores rows. Browsers
1028
+ without field-sizing keep the fixed height. */
1029
+ field-sizing: var(--gl-textarea-field-sizing, fixed);
934
1030
  }
1031
+ /* Nothing to resize in a text area that cannot be edited (since 1.25.0). */
1032
+ .glass-textarea:read-only { resize: none; }
935
1033
  .glass-textarea::placeholder { color: var(--gl-placeholder); }
936
1034
  .glass-textarea:focus {
937
1035
  border-color: var(--gl-border-focus);
@@ -1031,7 +1129,9 @@ a.glass-btn { display: inline-flex; text-decoration: none; }
1031
1129
 
1032
1130
  .glass-toggle__track {
1033
1131
  position: relative; width: var(--gl-toggle-width, 52px); height: var(--gl-toggle-height, 30px);
1034
- background: var(--gl-surface-2);
1132
+ /* --gl-toggle-track-bg and -checked (since 1.25.0): a stronger track for
1133
+ a page without glass, where the surface can be hard to see. */
1134
+ background: var(--gl-toggle-track-bg, var(--gl-surface-2));
1035
1135
  backdrop-filter: blur(var(--gl-blur-soft));
1036
1136
  -webkit-backdrop-filter: blur(var(--gl-blur-soft));
1037
1137
  border: 1.5px solid var(--gl-border-medium);
@@ -1059,9 +1159,9 @@ a.glass-btn { display: inline-flex; text-decoration: none; }
1059
1159
  }
1060
1160
 
1061
1161
  .glass-toggle__input:checked + .glass-toggle__track {
1062
- background: linear-gradient(135deg,
1162
+ background: var(--gl-toggle-track-bg-checked, linear-gradient(135deg,
1063
1163
  var(--gl-color-primary) 0%, var(--gl-color-primary-dark) 100%
1064
- );
1164
+ ));
1065
1165
  border-color: var(--gl-border-warm);
1066
1166
  }
1067
1167
 
@@ -1180,12 +1280,15 @@ a.glass-btn { display: inline-flex; text-decoration: none; }
1180
1280
  margin-top: max(0px, calc((1lh - var(--gl-check-size, 24px)) / 2));
1181
1281
  }
1182
1282
 
1283
+ /* --gl-radio-* (since 1.25.0): fill, rim and dot, for a look without glass —
1284
+ a ring in the text colour that turns the accent colour when checked, say.
1285
+ The two rims are whole border values, so give both the same width. */
1183
1286
  .glass-radio__circle {
1184
1287
  width: var(--gl-check-size, 24px); height: var(--gl-check-size, 24px);
1185
1288
  border-radius: var(--gl-radius-pill);
1186
- background: var(--gl-surface-2);
1289
+ background: var(--gl-radio-bg, var(--gl-surface-2));
1187
1290
  backdrop-filter: blur(var(--gl-blur-soft));
1188
- border: 1.5px solid var(--gl-border-medium);
1291
+ border: var(--gl-radio-border, 1.5px solid var(--gl-border-medium));
1189
1292
  display: flex; align-items: center; justify-content: center;
1190
1293
  transition: var(--gl-transition);
1191
1294
  box-shadow: var(--gl-inset-subtle);
@@ -1194,18 +1297,18 @@ a.glass-btn { display: inline-flex; text-decoration: none; }
1194
1297
  }
1195
1298
 
1196
1299
  .glass-radio__dot {
1197
- width: 10px; height: 10px;
1300
+ width: var(--gl-radio-dot-size, 10px); height: var(--gl-radio-dot-size, 10px);
1198
1301
  border-radius: var(--gl-radius-pill);
1199
- background: white;
1302
+ background: var(--gl-radio-dot-color, white);
1200
1303
  opacity: 0; transform: scale(0);
1201
1304
  transition: var(--gl-transition-fast);
1202
1305
  }
1203
1306
 
1204
1307
  .glass-radio__input:checked + .glass-radio__circle {
1205
- background: linear-gradient(135deg,
1308
+ background: var(--gl-radio-bg-checked, linear-gradient(135deg,
1206
1309
  var(--gl-color-primary) 0%, var(--gl-color-primary-dark) 100%
1207
- );
1208
- border-color: var(--gl-border-warm);
1310
+ ));
1311
+ border: var(--gl-radio-border-checked, 1.5px solid var(--gl-border-warm));
1209
1312
  }
1210
1313
  .glass-radio__input:checked + .glass-radio__circle .glass-radio__dot { opacity: 1; transform: scale(1); }
1211
1314
  .glass-radio__input:focus-visible + .glass-radio__circle { box-shadow: var(--gl-shadow-focus); }
@@ -1353,11 +1456,15 @@ a.glass-btn { display: inline-flex; text-decoration: none; }
1353
1456
  /* ============================================================
1354
1457
  16. MODAL
1355
1458
  ============================================================ */
1459
+ /* The dimmer behind a dialog blurs with --gl-blur-overlay where a project
1460
+ sets it, else with --gl-blur-soft (since 1.25.0). The surface presets set
1461
+ the blur tokens to 0 but leave this one alone: a blurred dimmer suits a
1462
+ page without glass as well. */
1356
1463
  .glass-modal-overlay {
1357
1464
  position: fixed; inset: 0;
1358
1465
  background: var(--gl-surface-overlay);
1359
- backdrop-filter: blur(var(--gl-blur-soft));
1360
- -webkit-backdrop-filter: blur(var(--gl-blur-soft));
1466
+ backdrop-filter: blur(var(--gl-blur-overlay, var(--gl-blur-soft)));
1467
+ -webkit-backdrop-filter: blur(var(--gl-blur-overlay, var(--gl-blur-soft)));
1361
1468
  display: flex; align-items: center; justify-content: center;
1362
1469
  padding: var(--gl-space-lg); z-index: 1000;
1363
1470
  opacity: 0; pointer-events: none;
@@ -2566,8 +2673,9 @@ dialog.glass-modal-overlay::backdrop { background: transparent; }
2566
2673
  position: fixed; inset: 0; z-index: 1000;
2567
2674
  display: flex; align-items: flex-end; justify-content: center;
2568
2675
  background: var(--gl-surface-overlay);
2569
- backdrop-filter: blur(var(--gl-blur-soft));
2570
- -webkit-backdrop-filter: blur(var(--gl-blur-soft));
2676
+ /* Like the modal's dimmer: --gl-blur-overlay where set (1.25.0). */
2677
+ backdrop-filter: blur(var(--gl-blur-overlay, var(--gl-blur-soft)));
2678
+ -webkit-backdrop-filter: blur(var(--gl-blur-overlay, var(--gl-blur-soft)));
2571
2679
  font-family: var(--gl-font-family);
2572
2680
  -webkit-font-smoothing: antialiased;
2573
2681
  opacity: 0;