semantic-forms 5.0.5 → 5.0.8

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,5 +1,5 @@
1
1
  // #region global styles
2
- form.semanticForms {
2
+ form.semanticForms, form.semanticForms.light {
3
3
  --formBackgroundColor: #fff;
4
4
  --formSubBackgroundColor: #f5f5f5;
5
5
  --formTextColor: #000;
@@ -26,7 +26,7 @@ form.semanticForms {
26
26
  --customResizer: url("data:image/svg+xml;utf8,%3Csvg width='20' height='20' viewBox='0 0 5.2916665 5.2916666' version='1.1' id='svg5' xmlns='http://www.w3.org/2000/svg' xmlns:svg='http://www.w3.org/2000/svg'%3E%3Cdefs id='defs2' /%3E%3Cg id='layer1'%3E%3Cpath style='fill:%23aaa;stroke:%23aaa;stroke-width:0.264583;stroke-dasharray:none;stroke-opacity:1' d='M 2.8245112,5.0994569 C 4.9396993,2.9842685 4.9396993,2.9842685 4.9396993,2.9842685' id='path1034' /%3E%3Cpath style='fill:%23aaa;stroke:%23aaa;stroke-width:0.264583;stroke-dasharray:none;stroke-opacity:1' d='M 1.515747,5.0406977 C 4.8873304,1.6691138 4.8873304,1.6691138 4.8873304,1.6691138' id='path1034-1' /%3E%3Cpath style='fill:%23aaa;stroke:%23aaa;stroke-width:0.264583;stroke-linecap:butt;stroke-linejoin:miter;stroke-dasharray:none;stroke-opacity:1' d='M 0.20657789,5.0909782 C 4.9312207,0.3663348 4.9312207,0.3663348 4.9312207,0.3663348' id='path1034-9' /%3E%3C/g%3E%3C/svg%3E")
27
27
  }
28
28
 
29
- form.semanticForms.dark {
29
+ @mixin dark-mode {
30
30
  --formBackgroundColor: #555;
31
31
  --inputBackgroudColor: rgba(85,85,85,0.1);
32
32
  --formSubBackgroundColor: #2f2f2f;
@@ -50,9 +50,27 @@ form.semanticForms.dark {
50
50
  filter: invert(100%);
51
51
  }
52
52
  }
53
+
54
+ @media (prefers-color-scheme: dark) {
55
+ html:not(.light) {
56
+ body:not(.light) {
57
+ form.semanticForms {
58
+ @include dark-mode;
59
+ }
60
+ }
61
+ }
62
+ }
63
+
64
+ html:not(.light) {
65
+ body:not(.light) {
66
+ form.semanticForms.dark {
67
+ @include dark-mode;
68
+ }
69
+ }
70
+ }
53
71
  // #endregion
54
72
 
55
- form.semanticForms {
73
+ form.semanticForms, form.semanticForms.light {
56
74
  width: 100%;
57
75
  container-type: inline-size;
58
76
  container-name: semanticForm;
@@ -80,111 +98,6 @@ form.semanticForms {
80
98
  padding: 0;
81
99
  }
82
100
 
83
- // #region container layout
84
- fieldset {
85
- border-radius: var(--borderRadius);
86
- background: var(--formSubBackgroundColor);
87
- border: 1px var(--subBorderColor) solid;
88
- display: flex;
89
- flex-direction: column;
90
- gap: 5px;
91
- padding: 10px 10px 20px 10px;
92
- margin-bottom: 15px;
93
-
94
- // nested fieldsets are darkened
95
- > fieldset {
96
- background-color: var(--nestedFieldset);
97
- border: var(--nestedFieldsetBorder);
98
-
99
- // add opacity to styled inputs to prevent blending with background
100
- input:not([type='submit'], [type='reset'], [type='image'], [type=checkbox], [type=radio]),
101
- select,
102
- textarea {
103
- background-color: var(--nestedInput);
104
- }
105
- }
106
- }
107
-
108
- dl:has(dt > label, dd > input, dd > select, dd > textarea) {
109
- display: grid;
110
- grid-template-columns: repeat(2, minmax(var(--inputMinWidth), 1fr));
111
- gap: 10px;
112
- margin-bottom: 10px;
113
-
114
- dd {
115
- position: relative;
116
-
117
- &:not(.checkboxes, .radios) {
118
- gap: 10px;
119
- max-width: 100%;
120
-
121
- // places all items within the <dd> horizontally
122
- &:not(.singleCheckbox) {
123
- display: flex;
124
- flex-direction: column;
125
- }
126
-
127
- &.singleCheckbox {
128
- display: flex;
129
- align-items: center;
130
-
131
- & > :not(input[type='checkbox'], label) {
132
- grid-column: 1 / -1;
133
- }
134
- }
135
- }
136
-
137
- &.checkboxes ul, &.radios ul {
138
- display: flex;
139
- flex-direction: column;
140
- margin-top: var(--inputTopMargin);
141
- padding-left: 10px;
142
- gap: 5px;
143
-
144
- li {
145
- display: flex;
146
- align-items: center;
147
- gap: 5px;
148
- }
149
- }
150
- }
151
- }
152
-
153
- p {
154
- // input/label combo
155
- &:has(input:not([type='checkbox'], [type='radio']), textarea, label) {
156
- display: flex;
157
- flex-direction: column;
158
- gap: 5px;
159
- }
160
-
161
- // checkbox or radio/label combo
162
- &:has(input[type='checkbox'], input[type='radio']) {
163
- display: flex;
164
- flex-direction: row;
165
- align-items: center;
166
- gap: 5px;
167
- }
168
- }
169
-
170
- menu:has(li > input, li > label, li > button, li > select, li > textarea),
171
- ul:has(li > input, li > label, li > button, li > select, li > textarea) {
172
- display: flex;
173
- justify-content: space-between;
174
- flex-wrap: wrap;
175
- gap: 10px;
176
- list-style-type: none;
177
- }
178
-
179
- details[open], summary {
180
- margin-bottom: 10px;
181
- }
182
-
183
- summary {
184
- cursor: pointer;
185
- }
186
- // #endregion
187
-
188
101
  // #region input styling
189
102
  input:not([type='submit'], [type='reset'], [type='image'], [type=checkbox], [type=radio]),
190
103
  select,
@@ -353,6 +266,173 @@ form.semanticForms {
353
266
  }
354
267
  // #endregion
355
268
 
269
+ // #region invalid styling
270
+ [data-invalid-text] {
271
+ display: none;
272
+ color: var(--invalid);
273
+ }
274
+
275
+ input:not([type='submit'], [type='reset'], [type='image']),
276
+ select,
277
+ textarea {
278
+ &.invalid,
279
+ &:user-invalid {
280
+ border: var(--invalidBorder) !important;
281
+
282
+ ~ label:nth-of-type(2) {
283
+ color: var(--invalid) !important;
284
+ }
285
+
286
+ ~ [data-invalid-text] {
287
+ font-size: small;
288
+ display: flex;
289
+ }
290
+ }
291
+
292
+ }
293
+ // #endregion
294
+
295
+ // disable autofill yellow
296
+ input:-webkit-autofill,
297
+ input:-webkit-autofill:hover,
298
+ input:-webkit-autofill:focus,
299
+ input:-webkit-autofill:active,
300
+ textarea:-webkit-autofill,
301
+ textarea:-webkit-autofill:hover,
302
+ textarea:-webkit-autofill:focus,
303
+ textarea:-webkit-autofill:active,
304
+ select:-webkit-autofill,
305
+ select:-webkit-autofill:hover,
306
+ select:-webkit-autofill:focus,
307
+ select:-webkit-autofill:active {
308
+ -webkit-box-shadow: 0 0 0 1000px var(--formBackgroundColor) inset;
309
+ transition: background-color 5000s ease-in-out 0s, color 5000s ease-in-out 0s;
310
+ transition-delay: 5000s;
311
+ transition-property: background-color, color;
312
+ }
313
+
314
+ fieldset {
315
+ border-radius: var(--borderRadius);
316
+ background: var(--formSubBackgroundColor);
317
+ border: 1px var(--subBorderColor) solid;
318
+ display: flex;
319
+ flex-direction: column;
320
+ gap: 5px;
321
+ padding: 10px 10px 20px 10px;
322
+ margin-bottom: 15px;
323
+
324
+ // nested fieldsets are darkened
325
+ > fieldset {
326
+ background-color: var(--nestedFieldset);
327
+ border: var(--nestedFieldsetBorder);
328
+
329
+ // add opacity to styled inputs to prevent blending with background
330
+ input:not([type='submit'], [type='reset'], [type='image'], [type=checkbox], [type=radio]),
331
+ select,
332
+ textarea {
333
+ background-color: var(--nestedInput);
334
+ }
335
+ }
336
+ }
337
+
338
+ details[open], summary {
339
+ margin-bottom: 10px;
340
+ }
341
+
342
+ summary {
343
+ cursor: pointer;
344
+ }
345
+
346
+ // update for scrollbars
347
+ @supports (scrollbar-color: auto) {
348
+ textarea {
349
+ scrollbar-color: var(--scrollbarColor) transparent;
350
+
351
+ &::-webkit-resizer {
352
+ border: none;
353
+ background-image: var(--customResizer);
354
+ background-size: 14px;
355
+ background-repeat: no-repeat;
356
+ background-position: 100%;
357
+ margin: 0 2px 2px 0;
358
+ }
359
+ }
360
+ }
361
+
362
+ // #region container layout
363
+
364
+ dl:has(dt > label, dd > input, dd > select, dd > textarea) {
365
+ display: grid;
366
+ grid-template-columns: repeat(auto-fit, minmax(var(--inputMinWidth), 1fr));
367
+ gap: 10px;
368
+ margin-bottom: 10px;
369
+
370
+ dd {
371
+ position: relative;
372
+
373
+ &:not(.checkboxes, .radios) {
374
+ gap: 10px;
375
+ max-width: 100%;
376
+
377
+ // places all items within the <dd> horizontally
378
+ &:not(.singleCheckbox) {
379
+ display: flex;
380
+ flex-direction: column;
381
+ }
382
+
383
+ &.singleCheckbox {
384
+ display: flex;
385
+ align-items: center;
386
+
387
+ & > :not(input[type='checkbox'], label) {
388
+ grid-column: 1 / -1;
389
+ }
390
+ }
391
+ }
392
+
393
+ &.checkboxes ul, &.radios ul {
394
+ display: flex;
395
+ flex-direction: column;
396
+ margin-top: var(--inputTopMargin);
397
+ padding-left: 10px;
398
+ gap: 5px;
399
+
400
+ li {
401
+ display: flex;
402
+ align-items: center;
403
+ gap: 5px;
404
+ }
405
+ }
406
+ }
407
+ }
408
+
409
+ p {
410
+ // input/label combo
411
+ &:has(input:not([type='checkbox'], [type='radio']), textarea, label) {
412
+ display: flex;
413
+ flex-direction: column;
414
+ gap: 5px;
415
+ }
416
+
417
+ // checkbox or radio/label combo
418
+ &:has(input[type='checkbox'], input[type='radio']) {
419
+ display: flex;
420
+ flex-direction: row;
421
+ align-items: center;
422
+ gap: 5px;
423
+ }
424
+ }
425
+
426
+ menu:has(li > input, li > label, li > button, li > select, li > textarea),
427
+ ul:has(li > input, li > label, li > button, li > select, li > textarea) {
428
+ display: flex;
429
+ justify-content: space-between;
430
+ flex-wrap: wrap;
431
+ gap: 10px;
432
+ list-style-type: none;
433
+ }
434
+ // #endregion
435
+
356
436
  // #region labels
357
437
 
358
438
  input[type=checkbox] + label:first-of-type,
@@ -369,7 +449,7 @@ form.semanticForms {
369
449
 
370
450
  span.help {
371
451
  cursor: help;
372
- pointer-events: auto;
452
+ pointer-events: auto;
373
453
  }
374
454
  }
375
455
 
@@ -377,6 +457,8 @@ form.semanticForms {
377
457
  div {
378
458
  position: relative;
379
459
  width: 100%;
460
+ min-width: 252px;
461
+ max-width: 365px;
380
462
 
381
463
  dd:not(.singleCheckbox, .checkboxes, .radios) {
382
464
  input:not([type='submit'], [type='reset'], [type='image']),
@@ -395,6 +477,7 @@ form.semanticForms {
395
477
  }
396
478
 
397
479
  label:first-of-type {
480
+ max-width: 230px !important; /* this prevents label text from sticking out of the input element */
398
481
  line-height: 1.2;
399
482
  font-size: var(--inputFontSize);
400
483
  position: absolute;
@@ -478,10 +561,10 @@ form.semanticForms {
478
561
  pointer-events: auto;
479
562
  color: red;
480
563
  }
481
-
564
+
482
565
  span.help {
483
566
  cursor: help;
484
- pointer-events: auto;
567
+ pointer-events: auto;
485
568
  }
486
569
  }
487
570
  }
@@ -498,10 +581,10 @@ form.semanticForms {
498
581
  transform: translateY(-100%) scale(0.7);
499
582
  top: var(--inputTopMargin);
500
583
  left: 10px;
501
-
584
+
502
585
  span.help {
503
586
  cursor: help;
504
- pointer-events: auto;
587
+ pointer-events: auto;
505
588
  }
506
589
  }
507
590
  }
@@ -526,256 +609,311 @@ form.semanticForms {
526
609
  }
527
610
  }
528
611
  // #endregion
529
-
530
612
  }
531
613
 
532
- // #region colspan classes
533
- div {
534
- &.colspan-full {
535
- grid-column: 1 / -1;
614
+ &.semanticFormsActive {
615
+ // #region colspan classes
616
+ div {
617
+ &[class^='colspan-'] {
618
+ max-width: 100%;
619
+ }
620
+
621
+ &.colspan-full {
622
+ grid-column: 1 / -1;
623
+ }
624
+
625
+ &.colspan-5 {
626
+ grid-column: span 5;
627
+ }
628
+
629
+ &.colspan-4 {
630
+ grid-column: span 4;
631
+ }
632
+
633
+ &.colspan-3 {
634
+ grid-column: span 3;
635
+ }
636
+
637
+ &.colspan-2 {
638
+ grid-column: span 2;
639
+ }
640
+
641
+ &.colspan-1 {
642
+ grid-column: span 1;
643
+ }
536
644
  }
537
645
 
538
- &.colspan-5 {
539
- grid-column: span 5;
646
+ fieldset[class^='colspan-'] dl,
647
+ dl[class^='colspan-'] {
648
+ div {
649
+ max-width: 100%;
650
+ }
540
651
  }
541
652
 
542
- &.colspan-4 {
543
- grid-column: span 4;
653
+ fieldset.colspan-full dl,
654
+ dl.colspan-full {
655
+ grid-template-columns: repeat(auto-fit, minmax(var(--inputMinWidth), 1fr));
544
656
  }
545
657
 
546
- &.colspan-3 {
547
- grid-column: span 3;
658
+ fieldset.colspan-5 dl,
659
+ dl.colspan-5 {
660
+ grid-template-columns: repeat(5, minmax(var(--inputMinWidth), 1fr));
548
661
  }
549
662
 
550
- &.colspan-2 {
551
- grid-column: span 2;
663
+ fieldset.colspan-4 dl,
664
+ dl.colspan-4 {
665
+ grid-template-columns: repeat(4, minmax(var(--inputMinWidth), 1fr));
552
666
  }
553
667
 
554
- &.colspan-1 {
555
- grid-column: span 1;
668
+
669
+ fieldset.colspan-3 dl,
670
+ dl.colspan-3 {
671
+ grid-template-columns: repeat(3, minmax(var(--inputMinWidth), 1fr));
556
672
  }
557
- }
558
673
 
559
- fieldset.colspan-full dl,
560
- dl.colspan-full {
561
- grid-template-columns: repeat(auto-fit, minmax(var(--inputMinWidth), 1fr));
562
- }
674
+ fieldset.colspan-2 dl,
675
+ dl.colspan-2 {
676
+ grid-template-columns: repeat(2, minmax(var(--inputMinWidth), 1fr));
677
+ }
563
678
 
564
- fieldset.colspan-5 dl,
565
- dl.colspan-5 {
566
- grid-template-columns: repeat(5, minmax(var(--inputMinWidth), 1fr));
567
- }
679
+ fieldset.colspan-1 dl,
680
+ dl.colspan-1 {
681
+ grid-template-columns: repeat(1, minmax(var(--inputMinWidth), 1fr));
682
+ }
683
+ // #endregion
568
684
 
569
- fieldset.colspan-4 dl,
570
- dl.colspan-4 {
571
- grid-template-columns: repeat(4, minmax(var(--inputMinWidth), 1fr));
572
- }
685
+ // #region container queries
686
+ // The container is the <fieldset> element
687
+ @container semanticForm (width > 2250px) {
688
+ &.lowFlow fieldset dl,
689
+ &.lowFlow dl {
690
+ grid-template-columns: repeat(6, minmax(var(--inputMinWidth), 1fr));
573
691
 
692
+ & dt:nth-of-type(6n + 1),
693
+ & dd:nth-of-type(6n + 1) {
694
+ grid-column: 1;
695
+ }
574
696
 
575
- fieldset.colspan-3 dl,
576
- dl.colspan-3 {
577
- grid-template-columns: repeat(3, minmax(var(--inputMinWidth), 1fr));
578
- }
697
+ & dt:nth-of-type(6n + 2),
698
+ & dd:nth-of-type(6n + 2) {
699
+ grid-column: 2;
700
+ }
579
701
 
580
- fieldset.colspan-2 dl,
581
- dl.colspan-2 {
582
- grid-template-columns: repeat(2, minmax(var(--inputMinWidth), 1fr));
583
- }
702
+ & dt:nth-of-type(6n + 3),
703
+ & dd:nth-of-type(6n + 3) {
704
+ grid-column: 3;
705
+ }
584
706
 
585
- fieldset.colspan-1 dl,
586
- dl.colspan-1 {
587
- grid-template-columns: repeat(1, minmax(var(--inputMinWidth), 1fr));
588
- }
707
+ & dt:nth-of-type(6n + 4),
708
+ & dd:nth-of-type(6n + 4) {
709
+ grid-column: 4;
710
+ }
589
711
 
590
- // low flow version
591
- &.lowFlow fieldset.colspan-full dl,
592
- &.lowFlow dl.colspan-full,
593
- &.lowFlow fieldset.colspan-5 dl,
594
- &.lowFlow dl.colspan-5 {
595
- grid-template-columns: repeat(5, minmax(var(--inputMinWidth), 1fr));
712
+ & dt:nth-of-type(6n + 5),
713
+ & dd:nth-of-type(6n + 5) {
714
+ grid-column: 5;
715
+ }
596
716
 
597
- & dt:nth-of-type(5n + 1),
598
- & dd:nth-of-type(5n + 1) {
599
- grid-column: 1;
717
+ & dt:nth-of-type(6n + 6),
718
+ & dd:nth-of-type(6n + 6) {
719
+ grid-column: 6;
720
+ }
721
+ }
600
722
  }
601
723
 
602
- & dt:nth-of-type(5n + 2),
603
- & dd:nth-of-type(5n + 2) {
604
- grid-column: 2;
605
- }
724
+ @container semanticForm (width < 2250px) {
725
+ &.lowFlow fieldset dl,
726
+ &.lowFlow dl {
727
+ grid-template-columns: repeat(5, minmax(var(--inputMinWidth), 1fr));
606
728
 
607
- & dt:nth-of-type(5n + 3),
608
- & dd:nth-of-type(5n + 3) {
609
- grid-column: 3;
610
- }
729
+ & dt:nth-of-type(5n + 1),
730
+ & dd:nth-of-type(5n + 1) {
731
+ grid-column: 1;
732
+ }
611
733
 
612
- & dt:nth-of-type(5n + 4),
613
- & dd:nth-of-type(5n + 4) {
614
- grid-column: 4;
615
- }
734
+ & dt:nth-of-type(5n + 2),
735
+ & dd:nth-of-type(5n + 2) {
736
+ grid-column: 2;
737
+ }
616
738
 
617
- & dt:nth-of-type(5n + 5),
618
- & dd:nth-of-type(5n + 5) {
619
- grid-column: 5;
620
- }
621
- }
739
+ & dt:nth-of-type(5n + 3),
740
+ & dd:nth-of-type(5n + 3) {
741
+ grid-column: 3;
742
+ }
622
743
 
623
- &.lowFlow fieldset.colspan-4 dl,
624
- &.lowFlow dl.colspan-4 {
625
- grid-template-columns: repeat(4, minmax(var(--inputMinWidth), 1fr));
744
+ & dt:nth-of-type(5n + 4),
745
+ & dd:nth-of-type(5n + 4) {
746
+ grid-column: 4;
747
+ }
626
748
 
627
- & dt:nth-of-type(4n + 1),
628
- & dd:nth-of-type(4n + 1) {
629
- grid-column: 1;
749
+ & dt:nth-of-type(5n + 5),
750
+ & dd:nth-of-type(5n + 5) {
751
+ grid-column: 5;
752
+ }
753
+ }
630
754
  }
631
755
 
632
- & dt:nth-of-type(4n + 2),
633
- & dd:nth-of-type(4n + 2) {
634
- grid-column: 2;
635
- }
756
+ @container semanticForm (width < 1300px) {
757
+ fieldset.colspan-5 dl,
758
+ dl.colspan-5 {
759
+ grid-template-columns: repeat(4, minmax(var(--inputMinWidth), 1fr)) !important;
760
+ }
636
761
 
637
- & dt:nth-of-type(4n + 3),
638
- & dd:nth-of-type(4n + 3) {
639
- grid-column: 3;
640
- }
762
+ div.colspan-5 {
763
+ grid-column: span 4 !important;
764
+ }
641
765
 
642
- & dt:nth-of-type(4n + 4),
643
- & dd:nth-of-type(4n + 4) {
644
- grid-column: 4;
645
- }
646
- }
766
+ &.lowFlow fieldset dl,
767
+ &.lowFlow dl,
768
+ &.lowFlow fieldset.colspan-5 dl,
769
+ &.lowFlow dl.colspan-5 {
770
+ grid-template-columns: repeat(4, minmax(var(--inputMinWidth), 1fr));
647
771
 
648
- &.lowFlow fieldset.colspan-3 dl,
649
- &.lowFlow dl.colspan-3 {
650
- grid-template-columns: repeat(3, minmax(var(--inputMinWidth), 1fr));
772
+ & dt:nth-of-type(4n + 1),
773
+ & dd:nth-of-type(4n + 1) {
774
+ grid-column: 1;
775
+ }
651
776
 
652
- // 1, 4, 7, ...
653
- & dt:nth-of-type(3n + 1),
654
- & dd:nth-of-type(3n + 1) {
655
- grid-column: 1;
656
- }
777
+ & dt:nth-of-type(4n + 2),
778
+ & dd:nth-of-type(4n + 2) {
779
+ grid-column: 2;
780
+ }
657
781
 
658
- // 2, 5, 8, ...
659
- & dt:nth-of-type(3n + 2),
660
- & dd:nth-of-type(3n + 2) {
661
- grid-column: 2;
662
- }
782
+ & dt:nth-of-type(4n + 3),
783
+ & dd:nth-of-type(4n + 3) {
784
+ grid-column: 3;
785
+ }
663
786
 
664
- // 3, 6, 9, ...
665
- & dt:nth-of-type(3n + 3),
666
- & dd:nth-of-type(3n + 3) {
667
- grid-column: 3;
787
+ & dt:nth-of-type(4n + 4),
788
+ & dd:nth-of-type(4n + 4) {
789
+ grid-column: 4;
790
+ }
791
+ }
668
792
  }
669
- }
670
793
 
671
- &.lowFlow fieldset.colspan-2 dl,
672
- &.lowFlow dl.colspan-2 {
673
- grid-template-columns: repeat(2, minmax(var(--inputMinWidth), 1fr));
794
+ @container semanticForm (width < 1050px) {
795
+ fieldset.colspan-4 dl,
796
+ fieldset.colspan-5 dl,
797
+ dl.colspan-4,
798
+ dl.colspan-5 {
799
+ grid-template-columns: repeat(3, minmax(var(--inputMinWidth), 1fr)) !important;
800
+ }
674
801
 
675
- & dt:nth-of-type(2n + 1),
676
- & dd:nth-of-type(2n + 1) {
677
- grid-column: 1;
678
- }
802
+ div.colspan-4, div.colspan-5 {
803
+ grid-column: span 3 !important;
804
+ }
679
805
 
680
- & dt:nth-of-type(2n + 2),
681
- & dd:nth-of-type(2n + 2) {
682
- grid-column: 2;
683
- }
684
- }
806
+ &.lowFlow fieldset dl,
807
+ &.lowFlow dl,
808
+ &.lowFlow fieldset.colspan-4 dl,
809
+ &.lowFlow dl.colspan-4,
810
+ &.lowFlow fieldset.colspan-5 dl,
811
+ &.lowFlow dl.colspan-5 {
812
+ grid-template-columns: repeat(3, minmax(var(--inputMinWidth), 1fr));
813
+
814
+ & dt:nth-of-type(3n + 1),
815
+ & dd:nth-of-type(3n + 1) {
816
+ grid-column: 1;
817
+ }
685
818
 
686
- &.lowFlow fieldset.colspan-1 dl,
687
- &.lowFlow dl.colspan-1 {
688
- grid-template-columns: repeat(1, minmax(var(--inputMinWidth), 1fr));
819
+ & dt:nth-of-type(3n + 2),
820
+ & dd:nth-of-type(3n + 2) {
821
+ grid-column: 2;
822
+ }
689
823
 
690
- & dt:nth-of-type(n + 1),
691
- & dd:nth-of-type(n + 1) {
692
- grid-column: 1;
824
+ & dt:nth-of-type(3n + 3),
825
+ & dd:nth-of-type(3n + 3) {
826
+ grid-column: 3;
827
+ }
828
+ }
693
829
  }
694
- }
695
830
 
696
- // #endregion
831
+ @container semanticForm (width < 800px) {
832
+ fieldset.colspan-3 dl,
833
+ fieldset.colspan-4 dl,
834
+ fieldset.colspan-5 dl,
835
+ dl.colspan-3,
836
+ dl.colspan-4,
837
+ dl.colspan-5 {
838
+ grid-template-columns: repeat(2, minmax(var(--inputMinWidth), 1fr)) !important;
839
+ }
697
840
 
698
- // #region invalid styling
699
- [data-invalid-text] {
700
- display: none;
701
- color: var(--invalid);
702
- }
841
+ div.colspan-3,
842
+ div.colspan-4,
843
+ div.colspan-5 {
844
+ grid-column: span 2 !important;
845
+ }
703
846
 
704
- input:not([type='submit'], [type='reset'], [type='image']),
705
- select,
706
- textarea {
707
- &.invalid,
708
- &:user-invalid {
709
- border: var(--invalidBorder) !important;
847
+ &.lowFlow fieldset dl,
848
+ &.lowFlow dl,
849
+ &.lowFlow fieldset.colspan-3 dl,
850
+ &.lowFlow dl.colspan-3,
851
+ &.lowFlow fieldset.colspan-4 dl,
852
+ &.lowFlow dl.colspan-4,
853
+ &.lowFlow fieldset.colspan-5 dl,
854
+ &.lowFlow dl.colspan-5 {
855
+ grid-template-columns: repeat(2, minmax(var(--inputMinWidth), 1fr));
710
856
 
711
- ~ label:nth-of-type(2) {
712
- color: var(--invalid) !important;
713
- }
857
+ & dt:nth-of-type(2n + 1),
858
+ & dd:nth-of-type(2n + 1) {
859
+ grid-column: 1;
860
+ }
714
861
 
715
- ~ [data-invalid-text] {
716
- font-size: small;
717
- display: flex;
862
+ & dt:nth-of-type(2n + 2),
863
+ & dd:nth-of-type(2n + 2) {
864
+ grid-column: 2;
865
+ }
718
866
  }
719
867
  }
720
868
 
721
- }
722
- // #endregion
869
+ @container semanticForm (width < 550px) {
870
+ fieldset.colspan-2 dl,
871
+ fieldset.colspan-3 dl,
872
+ fieldset.colspan-4 dl,
873
+ fieldset.colspan-5 dl,
874
+ dl.colspan-2,
875
+ dl.colspan-3,
876
+ dl.colspan-4,
877
+ dl.colspan-5,
878
+ dl {
879
+ grid-template-columns: repeat(1, minmax(var(--inputMinWidth), 1fr)) !important;
880
+ }
723
881
 
724
- // disable autofill yellow
725
- input:-webkit-autofill,
726
- input:-webkit-autofill:hover,
727
- input:-webkit-autofill:focus,
728
- input:-webkit-autofill:active,
729
- textarea:-webkit-autofill,
730
- textarea:-webkit-autofill:hover,
731
- textarea:-webkit-autofill:focus,
732
- textarea:-webkit-autofill:active,
733
- select:-webkit-autofill,
734
- select:-webkit-autofill:hover,
735
- select:-webkit-autofill:focus,
736
- select:-webkit-autofill:active {
737
- -webkit-box-shadow: 0 0 0 1000px var(--formBackgroundColor) inset;
738
- transition: background-color 5000s ease-in-out 0s, color 5000s ease-in-out 0s;
739
- transition-delay: 5000s;
740
- transition-property: background-color, color;
741
- }
882
+ div.colspan-2, div.colspan-3, div.colspan-4, div.colspan-5 {
883
+ grid-column: span 1 !important;
884
+ }
742
885
 
743
- // update for scrollbars
744
- @supports (scrollbar-color: auto) {
745
- textarea {
746
- scrollbar-color: var(--scrollbarColor) transparent;
886
+ &.lowFlow fieldset dl,
887
+ &.lowFlow dl,
888
+ &.lowFlow fieldset.colspan-2 dl,
889
+ &.lowFlow dl.colspan-2,
890
+ &.lowFlow fieldset.colspan-3 dl,
891
+ &.lowFlow dl.colspan-3,
892
+ &.lowFlow fieldset.colspan-4 dl,
893
+ &.lowFlow dl.colspan-4,
894
+ &.lowFlow fieldset.colspan-5 dl,
895
+ &.lowFlow dl.colspan-5 {
896
+ grid-template-columns: repeat(1, minmax(var(--inputMinWidth), 1fr));
747
897
 
748
- &::-webkit-resizer {
749
- border: none;
750
- background-image: var(--customResizer);
751
- background-size: 14px;
752
- background-repeat: no-repeat;
753
- background-position: 100%;
754
- margin: 0 2px 2px 0;
898
+ & dt:nth-of-type(n + 1),
899
+ & dd:nth-of-type(n + 1) {
900
+ grid-column: 1;
901
+ }
755
902
  }
756
903
  }
904
+ // #endregion
757
905
  }
758
906
 
759
907
  // #region low flow form
760
- &.lowFlow {
908
+ &:not(.semanticFormsActive) {
761
909
  dl {
762
- grid-template-columns: repeat(2, minmax(var(--inputMinWidth), 1fr));
763
- grid-auto-flow: dense;
910
+ display: flex;
911
+ flex-direction: column;
764
912
  gap: 5px;
765
913
 
766
- // 1, 4, 7, ...
767
- & > dt:nth-of-type(2n + 1),
768
- & > dd:nth-of-type(2n + 1) {
769
- grid-column: 1;
770
- }
771
-
772
- // 2, 5, 8, ...
773
- & > dt:nth-of-type(2n + 2),
774
- & > dd:nth-of-type(2n + 2) {
775
- grid-column: 2;
776
- }
777
-
778
914
  dt {
915
+ max-width: 365px !important; /* this matches the max-width of js-enabled inputs */
916
+
779
917
  // add required asterisk
780
918
  &:has(+ dd input:required) {
781
919
  label::after {
@@ -788,6 +926,7 @@ form.semanticForms {
788
926
 
789
927
  dd {
790
928
  margin-bottom: 10px;
929
+ max-width: 365px !important; /* this matches the max-width of js-enabled inputs */
791
930
 
792
931
  // nudge single checkboxes to match checkbox groups
793
932
  &:not(.checkboxes) {
@@ -818,225 +957,4 @@ form.semanticForms {
818
957
  }
819
958
  }
820
959
  // #endregion
821
-
822
- // #region container queries
823
- // The container is the <fieldset> element
824
- @container semanticForm (width > 2250px) {
825
- &.lowFlow fieldset dl,
826
- &.lowFlow dl {
827
- grid-template-columns: repeat(6, minmax(var(--inputMinWidth), 1fr));
828
-
829
- & dt:nth-of-type(6n + 1),
830
- & dd:nth-of-type(6n + 1) {
831
- grid-column: 1;
832
- }
833
-
834
- & dt:nth-of-type(6n + 2),
835
- & dd:nth-of-type(6n + 2) {
836
- grid-column: 2;
837
- }
838
-
839
- & dt:nth-of-type(6n + 3),
840
- & dd:nth-of-type(6n + 3) {
841
- grid-column: 3;
842
- }
843
-
844
- & dt:nth-of-type(6n + 4),
845
- & dd:nth-of-type(6n + 4) {
846
- grid-column: 4;
847
- }
848
-
849
- & dt:nth-of-type(6n + 5),
850
- & dd:nth-of-type(6n + 5) {
851
- grid-column: 5;
852
- }
853
-
854
- & dt:nth-of-type(6n + 6),
855
- & dd:nth-of-type(6n + 6) {
856
- grid-column: 6;
857
- }
858
- }
859
- }
860
-
861
- @container semanticForm (width < 2250px) {
862
- &.lowFlow fieldset dl,
863
- &.lowFlow dl {
864
- grid-template-columns: repeat(5, minmax(var(--inputMinWidth), 1fr));
865
-
866
- & dt:nth-of-type(5n + 1),
867
- & dd:nth-of-type(5n + 1) {
868
- grid-column: 1;
869
- }
870
-
871
- & dt:nth-of-type(5n + 2),
872
- & dd:nth-of-type(5n + 2) {
873
- grid-column: 2;
874
- }
875
-
876
- & dt:nth-of-type(5n + 3),
877
- & dd:nth-of-type(5n + 3) {
878
- grid-column: 3;
879
- }
880
-
881
- & dt:nth-of-type(5n + 4),
882
- & dd:nth-of-type(5n + 4) {
883
- grid-column: 4;
884
- }
885
-
886
- & dt:nth-of-type(5n + 5),
887
- & dd:nth-of-type(5n + 5) {
888
- grid-column: 5;
889
- }
890
- }
891
- }
892
-
893
- @container semanticForm (width < 1300px) {
894
- fieldset.colspan-5 dl,
895
- dl.colspan-5 {
896
- grid-template-columns: repeat(4, minmax(var(--inputMinWidth), 1fr)) !important;
897
- }
898
-
899
- div.colspan-5 {
900
- grid-column: span 4 !important;
901
- }
902
-
903
- &.lowFlow fieldset dl,
904
- &.lowFlow dl,
905
- &.lowFlow fieldset.colspan-5 dl,
906
- &.lowFlow dl.colspan-5 {
907
- grid-template-columns: repeat(4, minmax(var(--inputMinWidth), 1fr));
908
-
909
- & dt:nth-of-type(4n + 1),
910
- & dd:nth-of-type(4n + 1) {
911
- grid-column: 1;
912
- }
913
-
914
- & dt:nth-of-type(4n + 2),
915
- & dd:nth-of-type(4n + 2) {
916
- grid-column: 2;
917
- }
918
-
919
- & dt:nth-of-type(4n + 3),
920
- & dd:nth-of-type(4n + 3) {
921
- grid-column: 3;
922
- }
923
-
924
- & dt:nth-of-type(4n + 4),
925
- & dd:nth-of-type(4n + 4) {
926
- grid-column: 4;
927
- }
928
- }
929
- }
930
-
931
- @container semanticForm (width < 1050px) {
932
- fieldset.colspan-4 dl,
933
- fieldset.colspan-5 dl,
934
- dl.colspan-4,
935
- dl.colspan-5 {
936
- grid-template-columns: repeat(3, minmax(var(--inputMinWidth), 1fr)) !important;
937
- }
938
-
939
- div.colspan-4, div.colspan-5 {
940
- grid-column: span 3 !important;
941
- }
942
-
943
- &.lowFlow fieldset dl,
944
- &.lowFlow dl,
945
- &.lowFlow fieldset.colspan-4 dl,
946
- &.lowFlow dl.colspan-4,
947
- &.lowFlow fieldset.colspan-5 dl,
948
- &.lowFlow dl.colspan-5 {
949
- grid-template-columns: repeat(3, minmax(var(--inputMinWidth), 1fr));
950
-
951
- & dt:nth-of-type(3n + 1),
952
- & dd:nth-of-type(3n + 1) {
953
- grid-column: 1;
954
- }
955
-
956
- & dt:nth-of-type(3n + 2),
957
- & dd:nth-of-type(3n + 2) {
958
- grid-column: 2;
959
- }
960
-
961
- & dt:nth-of-type(3n + 3),
962
- & dd:nth-of-type(3n + 3) {
963
- grid-column: 3;
964
- }
965
- }
966
- }
967
-
968
- @container semanticForm (width < 800px) {
969
- fieldset.colspan-3 dl,
970
- fieldset.colspan-4 dl,
971
- fieldset.colspan-5 dl,
972
- dl.colspan-3,
973
- dl.colspan-4,
974
- dl.colspan-5 {
975
- grid-template-columns: repeat(2, minmax(var(--inputMinWidth), 1fr)) !important;
976
- }
977
-
978
- div.colspan-3,
979
- div.colspan-4,
980
- div.colspan-5 {
981
- grid-column: span 2 !important;
982
- }
983
-
984
- &.lowFlow fieldset dl,
985
- &.lowFlow dl,
986
- &.lowFlow fieldset.colspan-3 dl,
987
- &.lowFlow dl.colspan-3,
988
- &.lowFlow fieldset.colspan-4 dl,
989
- &.lowFlow dl.colspan-4,
990
- &.lowFlow fieldset.colspan-5 dl,
991
- &.lowFlow dl.colspan-5 {
992
- grid-template-columns: repeat(2, minmax(var(--inputMinWidth), 1fr));
993
-
994
- & dt:nth-of-type(2n + 1),
995
- & dd:nth-of-type(2n + 1) {
996
- grid-column: 1;
997
- }
998
-
999
- & dt:nth-of-type(2n + 2),
1000
- & dd:nth-of-type(2n + 2) {
1001
- grid-column: 2;
1002
- }
1003
- }
1004
- }
1005
-
1006
- @container semanticForm (width < 550px) {
1007
- fieldset.colspan-2 dl,
1008
- fieldset.colspan-3 dl,
1009
- fieldset.colspan-4 dl,
1010
- fieldset.colspan-5 dl,
1011
- dl.colspan-2,
1012
- dl.colspan-3,
1013
- dl.colspan-4,
1014
- dl.colspan-5,
1015
- dl {
1016
- grid-template-columns: repeat(1, minmax(var(--inputMinWidth), 1fr)) !important;
1017
- }
1018
-
1019
- div.colspan-2, div.colspan-3, div.colspan-4, div.colspan-5 {
1020
- grid-column: span 1 !important;
1021
- }
1022
-
1023
- &.lowFlow fieldset dl,
1024
- &.lowFlow dl,
1025
- &.lowFlow fieldset.colspan-2 dl,
1026
- &.lowFlow dl.colspan-2,
1027
- &.lowFlow fieldset.colspan-3 dl,
1028
- &.lowFlow dl.colspan-3,
1029
- &.lowFlow fieldset.colspan-4 dl,
1030
- &.lowFlow dl.colspan-4,
1031
- &.lowFlow fieldset.colspan-5 dl,
1032
- &.lowFlow dl.colspan-5 {
1033
- grid-template-columns: repeat(1, minmax(var(--inputMinWidth), 1fr));
1034
-
1035
- & dt:nth-of-type(n + 1),
1036
- & dd:nth-of-type(n + 1) {
1037
- grid-column: 1;
1038
- }
1039
- }
1040
- }
1041
- // #endregion
1042
960
  }