semantic-forms 5.1.5 → 5.1.7

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.
@@ -1,6 +1,7 @@
1
1
  // #region global styles
2
2
  form.semanticForms, form.semanticForms.light, table.semanticForms {
3
3
  --semanticFormsFontFamily: sans-serif;
4
+ --semanticFormsFontSize: 16px;
4
5
  --semanticFormsFormBgColor: #fff;
5
6
  --semanticFormsFormSubBgColor: #f5f5f5;
6
7
  --semanticFormsTextColor: #000;
@@ -65,7 +66,7 @@ form.semanticForms, form.semanticForms.light, table.semanticForms {
65
66
  @media (prefers-color-scheme: dark) {
66
67
  html:not(.light) {
67
68
  body:not(.light) {
68
- form.semanticForms, table.semanticForms {
69
+ form.semanticForms:not(.light), table.semanticForms:not(.light) {
69
70
  @include dark-mode;
70
71
  }
71
72
  }
@@ -79,6 +80,10 @@ html:not(.light) {
79
80
  }
80
81
  }
81
82
  }
83
+
84
+ form.semanticForms.dark, table.semanticForms.dark {
85
+ @include dark-mode;
86
+ }
82
87
  // #endregion
83
88
 
84
89
  form.semanticForms,
@@ -86,6 +91,7 @@ form.semanticForms.light,
86
91
  table.semanticForms,
87
92
  table.semanticForms.light {
88
93
  font-family: var(--semanticFormsFontFamily);
94
+ font-size: var(--semanticFormsFontSize);
89
95
  width: 100%;
90
96
  container-type: inline-size;
91
97
  container-name: semanticForm;
@@ -128,6 +134,10 @@ table.semanticForms.light {
128
134
  touch-action: manipulation;
129
135
  outline: none;
130
136
 
137
+ &:not([type="range"]):placeholder-shown {
138
+ padding: 6px 20px;
139
+ }
140
+
131
141
  &:not([type="range"]) {
132
142
  padding: 6px 30px 6px 20px;
133
143
  }
@@ -136,6 +146,11 @@ table.semanticForms.light {
136
146
  padding: 6px 55px 6px 20px;
137
147
  }
138
148
 
149
+ &[type="range"],
150
+ &[type="color"] {
151
+ cursor: pointer;
152
+ }
153
+
139
154
  &[disabled] {
140
155
  cursor: not-allowed;
141
156
  opacity: 0.5;
@@ -226,9 +241,9 @@ table.semanticForms.light {
226
241
 
227
242
  textarea {
228
243
  resize: vertical;
244
+ line-height: 1.5;
229
245
  width: 100%;
230
246
  min-height: 38px;
231
- height: 100px;
232
247
  }
233
248
 
234
249
  input[type="search"] {
@@ -305,15 +320,18 @@ table.semanticForms.light {
305
320
  max-width: max-content;
306
321
  background-image: linear-gradient(to bottom, var(--semanticFormsButtonGradientLight) 0%, var(--semanticFormsButtonGradientDark) 100%);
307
322
  background-origin: border-box; // prevents graphical errors in Firefox
308
- border: 2px var(--semanticFormsButtonGradientDark) solid;
323
+ border: 1px var(--semanticFormsButtonGradientDark) solid;
324
+ corner-shape: squircle;
309
325
  border-radius: 20px;
310
326
  padding: 5px 25px;
311
327
  font-size: 100%;
312
328
  line-height: 1;
313
329
  user-select: none;
330
+ transform: scale(1);
331
+ transition: transform 180ms;
314
332
 
315
333
  &:active {
316
- background-image: linear-gradient(to bottom, var(--semanticFormsButtonGradientDark) 0%, var(--semanticFormsButtonGradientLight) 100%);
334
+ transform: scale(0.97);
317
335
  }
318
336
  }
319
337
 
@@ -398,6 +416,69 @@ table.semanticForms.light {
398
416
  }
399
417
  }
400
418
 
419
+ // #region summary
420
+ details {
421
+ box-sizing: border-box; // ensure sizings match across browsers
422
+ position: relative;
423
+ background-color: var(--semanticFormsNestedFieldsetBgColor); // TODO: check if this is right
424
+ border: var(--semanticFormsNestedFieldsetBorder);
425
+ border-radius: var(--semanticFormsBorderRadius);
426
+ display: flex;
427
+ flex-direction: column;
428
+ gap: 5px;
429
+ padding: 20px 10px 10px 10px;
430
+ margin-bottom: 15px;
431
+ min-height: calc(var(--semanticFormsFontSize) + 20px);
432
+
433
+ &::details-content {
434
+ visibility: hidden;
435
+ opacity: 0;
436
+ transition: opacity 250ms ease-in, visibility 0ms ease-in 250ms;
437
+ }
438
+
439
+ summary {
440
+ margin: 0;
441
+ line-height: 1;
442
+ position: absolute;
443
+ top: 10px;
444
+ left: 22px;
445
+ transition: top 250ms;
446
+
447
+ &::-webkit-details-marker,
448
+ &::marker {
449
+ content: ''; // hide default arrow, as it cannot be animated
450
+ }
451
+
452
+ &::after {
453
+ // custom arrow
454
+ content: '';
455
+ border-width: .4rem;
456
+ border-style: solid;
457
+ border-color: transparent transparent transparent var(--semanticFormsTextColor);
458
+ position: absolute;
459
+ top: 0;
460
+ left: -10px;
461
+ transform: rotate(0);
462
+ transform-origin: .2rem 50%;
463
+ transition: 250ms transform ease;
464
+ }
465
+ }
466
+ }
467
+
468
+ details[open] {
469
+ &::details-content {
470
+ visibility: visible;
471
+ opacity: 1;
472
+ transition: opacity 250ms ease-in, visibility 0ms ease-in 0ms;
473
+ }
474
+
475
+ summary {
476
+ &::after {
477
+ transform: rotate(90deg);
478
+ }
479
+ }
480
+ }
481
+
401
482
  details[open], summary {
402
483
  margin-bottom: 10px;
403
484
  }
@@ -405,6 +486,7 @@ table.semanticForms.light {
405
486
  summary {
406
487
  cursor: pointer;
407
488
  }
489
+ // #endregion
408
490
 
409
491
  // update for scrollbars
410
492
  @supports (scrollbar-color: auto) {
@@ -537,6 +619,10 @@ table.semanticForms.light {
537
619
  // shift text down to match center
538
620
  padding-top: 2px;
539
621
  font-size: var(--semanticFormsInputFontSize);
622
+ cursor: pointer;
623
+ display: flex;
624
+ align-items: center;
625
+ gap: 5px;
540
626
 
541
627
  span.required {
542
628
  cursor: help;
@@ -547,6 +633,10 @@ table.semanticForms.light {
547
633
  span.help {
548
634
  cursor: help;
549
635
  pointer-events: auto;
636
+
637
+ svg {
638
+ width: 80%;
639
+ }
550
640
  }
551
641
  }
552
642
 
@@ -676,6 +766,9 @@ table.semanticForms.light {
676
766
  user-select: none;
677
767
  color: var(--semanticFormsPlaceholderColor);
678
768
  touch-action: manipulation;
769
+ display: flex;
770
+ align-items: center;
771
+ gap: 5px;
679
772
 
680
773
  // TODO: same as below
681
774
  // &:has(span.help) {
@@ -703,6 +796,10 @@ table.semanticForms.light {
703
796
  // right: 0;
704
797
  cursor: help;
705
798
  pointer-events: auto;
799
+
800
+ svg {
801
+ width: 80%;
802
+ }
706
803
  }
707
804
 
708
805
  // // TODO: cover the case where an input is required AND has help text