semantic-forms 5.0.4 → 5.0.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,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,19 @@ form.semanticForms.dark {
50
50
  filter: invert(100%);
51
51
  }
52
52
  }
53
+
54
+ @media (prefers-color-scheme: dark) {
55
+ form.semanticForms {
56
+ @include dark-mode;
57
+ }
58
+ }
59
+
60
+ form.semanticForms.dark {
61
+ @include dark-mode;
62
+ }
53
63
  // #endregion
54
64
 
55
- form.semanticForms {
65
+ form.semanticForms, form.semanticForms.light {
56
66
  width: 100%;
57
67
  container-type: inline-size;
58
68
  container-name: semanticForm;
@@ -80,111 +90,6 @@ form.semanticForms {
80
90
  padding: 0;
81
91
  }
82
92
 
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
93
  // #region input styling
189
94
  input:not([type='submit'], [type='reset'], [type='image'], [type=checkbox], [type=radio]),
190
95
  select,
@@ -352,6 +257,173 @@ form.semanticForms {
352
257
  }
353
258
  }
354
259
  // #endregion
260
+
261
+ // #region invalid styling
262
+ [data-invalid-text] {
263
+ display: none;
264
+ color: var(--invalid);
265
+ }
266
+
267
+ input:not([type='submit'], [type='reset'], [type='image']),
268
+ select,
269
+ textarea {
270
+ &.invalid,
271
+ &:user-invalid {
272
+ border: var(--invalidBorder) !important;
273
+
274
+ ~ label:nth-of-type(2) {
275
+ color: var(--invalid) !important;
276
+ }
277
+
278
+ ~ [data-invalid-text] {
279
+ font-size: small;
280
+ display: flex;
281
+ }
282
+ }
283
+
284
+ }
285
+ // #endregion
286
+
287
+ // disable autofill yellow
288
+ input:-webkit-autofill,
289
+ input:-webkit-autofill:hover,
290
+ input:-webkit-autofill:focus,
291
+ input:-webkit-autofill:active,
292
+ textarea:-webkit-autofill,
293
+ textarea:-webkit-autofill:hover,
294
+ textarea:-webkit-autofill:focus,
295
+ textarea:-webkit-autofill:active,
296
+ select:-webkit-autofill,
297
+ select:-webkit-autofill:hover,
298
+ select:-webkit-autofill:focus,
299
+ select:-webkit-autofill:active {
300
+ -webkit-box-shadow: 0 0 0 1000px var(--formBackgroundColor) inset;
301
+ transition: background-color 5000s ease-in-out 0s, color 5000s ease-in-out 0s;
302
+ transition-delay: 5000s;
303
+ transition-property: background-color, color;
304
+ }
305
+
306
+ fieldset {
307
+ border-radius: var(--borderRadius);
308
+ background: var(--formSubBackgroundColor);
309
+ border: 1px var(--subBorderColor) solid;
310
+ display: flex;
311
+ flex-direction: column;
312
+ gap: 5px;
313
+ padding: 10px 10px 20px 10px;
314
+ margin-bottom: 15px;
315
+
316
+ // nested fieldsets are darkened
317
+ > fieldset {
318
+ background-color: var(--nestedFieldset);
319
+ border: var(--nestedFieldsetBorder);
320
+
321
+ // add opacity to styled inputs to prevent blending with background
322
+ input:not([type='submit'], [type='reset'], [type='image'], [type=checkbox], [type=radio]),
323
+ select,
324
+ textarea {
325
+ background-color: var(--nestedInput);
326
+ }
327
+ }
328
+ }
329
+
330
+ details[open], summary {
331
+ margin-bottom: 10px;
332
+ }
333
+
334
+ summary {
335
+ cursor: pointer;
336
+ }
337
+
338
+ // update for scrollbars
339
+ @supports (scrollbar-color: auto) {
340
+ textarea {
341
+ scrollbar-color: var(--scrollbarColor) transparent;
342
+
343
+ &::-webkit-resizer {
344
+ border: none;
345
+ background-image: var(--customResizer);
346
+ background-size: 14px;
347
+ background-repeat: no-repeat;
348
+ background-position: 100%;
349
+ margin: 0 2px 2px 0;
350
+ }
351
+ }
352
+ }
353
+
354
+ // #region container layout
355
+
356
+ dl:has(dt > label, dd > input, dd > select, dd > textarea) {
357
+ display: grid;
358
+ grid-template-columns: repeat(auto-fit, minmax(var(--inputMinWidth), 1fr));
359
+ gap: 10px;
360
+ margin-bottom: 10px;
361
+
362
+ dd {
363
+ position: relative;
364
+
365
+ &:not(.checkboxes, .radios) {
366
+ gap: 10px;
367
+ max-width: 100%;
368
+
369
+ // places all items within the <dd> horizontally
370
+ &:not(.singleCheckbox) {
371
+ display: flex;
372
+ flex-direction: column;
373
+ }
374
+
375
+ &.singleCheckbox {
376
+ display: flex;
377
+ align-items: center;
378
+
379
+ & > :not(input[type='checkbox'], label) {
380
+ grid-column: 1 / -1;
381
+ }
382
+ }
383
+ }
384
+
385
+ &.checkboxes ul, &.radios ul {
386
+ display: flex;
387
+ flex-direction: column;
388
+ margin-top: var(--inputTopMargin);
389
+ padding-left: 10px;
390
+ gap: 5px;
391
+
392
+ li {
393
+ display: flex;
394
+ align-items: center;
395
+ gap: 5px;
396
+ }
397
+ }
398
+ }
399
+ }
400
+
401
+ p {
402
+ // input/label combo
403
+ &:has(input:not([type='checkbox'], [type='radio']), textarea, label) {
404
+ display: flex;
405
+ flex-direction: column;
406
+ gap: 5px;
407
+ }
408
+
409
+ // checkbox or radio/label combo
410
+ &:has(input[type='checkbox'], input[type='radio']) {
411
+ display: flex;
412
+ flex-direction: row;
413
+ align-items: center;
414
+ gap: 5px;
415
+ }
416
+ }
417
+
418
+ menu:has(li > input, li > label, li > button, li > select, li > textarea),
419
+ ul:has(li > input, li > label, li > button, li > select, li > textarea) {
420
+ display: flex;
421
+ justify-content: space-between;
422
+ flex-wrap: wrap;
423
+ gap: 10px;
424
+ list-style-type: none;
425
+ }
426
+ // #endregion
355
427
 
356
428
  // #region labels
357
429
 
@@ -369,7 +441,7 @@ form.semanticForms {
369
441
 
370
442
  span.help {
371
443
  cursor: help;
372
- pointer-events: auto;
444
+ pointer-events: auto;
373
445
  }
374
446
  }
375
447
 
@@ -377,6 +449,8 @@ form.semanticForms {
377
449
  div {
378
450
  position: relative;
379
451
  width: 100%;
452
+ min-width: 252px;
453
+ max-width: 365px;
380
454
 
381
455
  dd:not(.singleCheckbox, .checkboxes, .radios) {
382
456
  input:not([type='submit'], [type='reset'], [type='image']),
@@ -395,6 +469,7 @@ form.semanticForms {
395
469
  }
396
470
 
397
471
  label:first-of-type {
472
+ max-width: 230px !important; /* this prevents label text from sticking out of the input element */
398
473
  line-height: 1.2;
399
474
  font-size: var(--inputFontSize);
400
475
  position: absolute;
@@ -478,10 +553,10 @@ form.semanticForms {
478
553
  pointer-events: auto;
479
554
  color: red;
480
555
  }
481
-
556
+
482
557
  span.help {
483
558
  cursor: help;
484
- pointer-events: auto;
559
+ pointer-events: auto;
485
560
  }
486
561
  }
487
562
  }
@@ -498,10 +573,10 @@ form.semanticForms {
498
573
  transform: translateY(-100%) scale(0.7);
499
574
  top: var(--inputTopMargin);
500
575
  left: 10px;
501
-
576
+
502
577
  span.help {
503
578
  cursor: help;
504
- pointer-events: auto;
579
+ pointer-events: auto;
505
580
  }
506
581
  }
507
582
  }
@@ -526,256 +601,311 @@ form.semanticForms {
526
601
  }
527
602
  }
528
603
  // #endregion
529
-
530
604
  }
531
605
 
532
- // #region colspan classes
533
- div {
534
- &.colspan-full {
535
- grid-column: 1 / -1;
606
+ &.semanticFormsActive {
607
+ // #region colspan classes
608
+ div {
609
+ &[class^='colspan-'] {
610
+ max-width: 100%;
611
+ }
612
+
613
+ &.colspan-full {
614
+ grid-column: 1 / -1;
615
+ }
616
+
617
+ &.colspan-5 {
618
+ grid-column: span 5;
619
+ }
620
+
621
+ &.colspan-4 {
622
+ grid-column: span 4;
623
+ }
624
+
625
+ &.colspan-3 {
626
+ grid-column: span 3;
627
+ }
628
+
629
+ &.colspan-2 {
630
+ grid-column: span 2;
631
+ }
632
+
633
+ &.colspan-1 {
634
+ grid-column: span 1;
635
+ }
536
636
  }
537
-
538
- &.colspan-5 {
539
- grid-column: span 5;
637
+
638
+ fieldset[class^='colspan-'] dl,
639
+ dl[class^='colspan-'] {
640
+ div {
641
+ max-width: 100%;
642
+ }
540
643
  }
541
-
542
- &.colspan-4 {
543
- grid-column: span 4;
644
+
645
+ fieldset.colspan-full dl,
646
+ dl.colspan-full {
647
+ grid-template-columns: repeat(auto-fit, minmax(var(--inputMinWidth), 1fr));
544
648
  }
545
-
546
- &.colspan-3 {
547
- grid-column: span 3;
649
+
650
+ fieldset.colspan-5 dl,
651
+ dl.colspan-5 {
652
+ grid-template-columns: repeat(5, minmax(var(--inputMinWidth), 1fr));
548
653
  }
549
-
550
- &.colspan-2 {
551
- grid-column: span 2;
654
+
655
+ fieldset.colspan-4 dl,
656
+ dl.colspan-4 {
657
+ grid-template-columns: repeat(4, minmax(var(--inputMinWidth), 1fr));
552
658
  }
553
-
554
- &.colspan-1 {
555
- grid-column: span 1;
659
+
660
+
661
+ fieldset.colspan-3 dl,
662
+ dl.colspan-3 {
663
+ grid-template-columns: repeat(3, minmax(var(--inputMinWidth), 1fr));
556
664
  }
557
- }
558
-
559
- fieldset.colspan-full dl,
560
- dl.colspan-full {
561
- grid-template-columns: repeat(auto-fit, minmax(var(--inputMinWidth), 1fr));
562
- }
563
-
564
- fieldset.colspan-5 dl,
565
- dl.colspan-5 {
566
- grid-template-columns: repeat(5, minmax(var(--inputMinWidth), 1fr));
567
- }
665
+
666
+ fieldset.colspan-2 dl,
667
+ dl.colspan-2 {
668
+ grid-template-columns: repeat(2, minmax(var(--inputMinWidth), 1fr));
669
+ }
670
+
671
+ fieldset.colspan-1 dl,
672
+ dl.colspan-1 {
673
+ grid-template-columns: repeat(1, minmax(var(--inputMinWidth), 1fr));
674
+ }
675
+ // #endregion
568
676
 
569
- fieldset.colspan-4 dl,
570
- dl.colspan-4 {
571
- grid-template-columns: repeat(4, minmax(var(--inputMinWidth), 1fr));
572
- }
677
+ // #region container queries
678
+ // The container is the <fieldset> element
679
+ @container semanticForm (width > 2250px) {
680
+ &.lowFlow fieldset dl,
681
+ &.lowFlow dl {
682
+ grid-template-columns: repeat(6, minmax(var(--inputMinWidth), 1fr));
573
683
 
684
+ & dt:nth-of-type(6n + 1),
685
+ & dd:nth-of-type(6n + 1) {
686
+ grid-column: 1;
687
+ }
574
688
 
575
- fieldset.colspan-3 dl,
576
- dl.colspan-3 {
577
- grid-template-columns: repeat(3, minmax(var(--inputMinWidth), 1fr));
578
- }
689
+ & dt:nth-of-type(6n + 2),
690
+ & dd:nth-of-type(6n + 2) {
691
+ grid-column: 2;
692
+ }
579
693
 
580
- fieldset.colspan-2 dl,
581
- dl.colspan-2 {
582
- grid-template-columns: repeat(2, minmax(var(--inputMinWidth), 1fr));
583
- }
694
+ & dt:nth-of-type(6n + 3),
695
+ & dd:nth-of-type(6n + 3) {
696
+ grid-column: 3;
697
+ }
584
698
 
585
- fieldset.colspan-1 dl,
586
- dl.colspan-1 {
587
- grid-template-columns: repeat(1, minmax(var(--inputMinWidth), 1fr));
588
- }
699
+ & dt:nth-of-type(6n + 4),
700
+ & dd:nth-of-type(6n + 4) {
701
+ grid-column: 4;
702
+ }
589
703
 
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));
704
+ & dt:nth-of-type(6n + 5),
705
+ & dd:nth-of-type(6n + 5) {
706
+ grid-column: 5;
707
+ }
596
708
 
597
- & dt:nth-of-type(5n + 1),
598
- & dd:nth-of-type(5n + 1) {
599
- grid-column: 1;
709
+ & dt:nth-of-type(6n + 6),
710
+ & dd:nth-of-type(6n + 6) {
711
+ grid-column: 6;
712
+ }
713
+ }
600
714
  }
601
715
 
602
- & dt:nth-of-type(5n + 2),
603
- & dd:nth-of-type(5n + 2) {
604
- grid-column: 2;
605
- }
716
+ @container semanticForm (width < 2250px) {
717
+ &.lowFlow fieldset dl,
718
+ &.lowFlow dl {
719
+ grid-template-columns: repeat(5, minmax(var(--inputMinWidth), 1fr));
606
720
 
607
- & dt:nth-of-type(5n + 3),
608
- & dd:nth-of-type(5n + 3) {
609
- grid-column: 3;
610
- }
721
+ & dt:nth-of-type(5n + 1),
722
+ & dd:nth-of-type(5n + 1) {
723
+ grid-column: 1;
724
+ }
611
725
 
612
- & dt:nth-of-type(5n + 4),
613
- & dd:nth-of-type(5n + 4) {
614
- grid-column: 4;
615
- }
726
+ & dt:nth-of-type(5n + 2),
727
+ & dd:nth-of-type(5n + 2) {
728
+ grid-column: 2;
729
+ }
616
730
 
617
- & dt:nth-of-type(5n + 5),
618
- & dd:nth-of-type(5n + 5) {
619
- grid-column: 5;
620
- }
621
- }
731
+ & dt:nth-of-type(5n + 3),
732
+ & dd:nth-of-type(5n + 3) {
733
+ grid-column: 3;
734
+ }
622
735
 
623
- &.lowFlow fieldset.colspan-4 dl,
624
- &.lowFlow dl.colspan-4 {
625
- grid-template-columns: repeat(4, minmax(var(--inputMinWidth), 1fr));
736
+ & dt:nth-of-type(5n + 4),
737
+ & dd:nth-of-type(5n + 4) {
738
+ grid-column: 4;
739
+ }
626
740
 
627
- & dt:nth-of-type(4n + 1),
628
- & dd:nth-of-type(4n + 1) {
629
- grid-column: 1;
741
+ & dt:nth-of-type(5n + 5),
742
+ & dd:nth-of-type(5n + 5) {
743
+ grid-column: 5;
744
+ }
745
+ }
630
746
  }
631
747
 
632
- & dt:nth-of-type(4n + 2),
633
- & dd:nth-of-type(4n + 2) {
634
- grid-column: 2;
635
- }
748
+ @container semanticForm (width < 1300px) {
749
+ fieldset.colspan-5 dl,
750
+ dl.colspan-5 {
751
+ grid-template-columns: repeat(4, minmax(var(--inputMinWidth), 1fr)) !important;
752
+ }
636
753
 
637
- & dt:nth-of-type(4n + 3),
638
- & dd:nth-of-type(4n + 3) {
639
- grid-column: 3;
640
- }
754
+ div.colspan-5 {
755
+ grid-column: span 4 !important;
756
+ }
641
757
 
642
- & dt:nth-of-type(4n + 4),
643
- & dd:nth-of-type(4n + 4) {
644
- grid-column: 4;
645
- }
646
- }
758
+ &.lowFlow fieldset dl,
759
+ &.lowFlow dl,
760
+ &.lowFlow fieldset.colspan-5 dl,
761
+ &.lowFlow dl.colspan-5 {
762
+ grid-template-columns: repeat(4, minmax(var(--inputMinWidth), 1fr));
647
763
 
648
- &.lowFlow fieldset.colspan-3 dl,
649
- &.lowFlow dl.colspan-3 {
650
- grid-template-columns: repeat(3, minmax(var(--inputMinWidth), 1fr));
764
+ & dt:nth-of-type(4n + 1),
765
+ & dd:nth-of-type(4n + 1) {
766
+ grid-column: 1;
767
+ }
651
768
 
652
- // 1, 4, 7, ...
653
- & dt:nth-of-type(3n + 1),
654
- & dd:nth-of-type(3n + 1) {
655
- grid-column: 1;
656
- }
769
+ & dt:nth-of-type(4n + 2),
770
+ & dd:nth-of-type(4n + 2) {
771
+ grid-column: 2;
772
+ }
657
773
 
658
- // 2, 5, 8, ...
659
- & dt:nth-of-type(3n + 2),
660
- & dd:nth-of-type(3n + 2) {
661
- grid-column: 2;
662
- }
774
+ & dt:nth-of-type(4n + 3),
775
+ & dd:nth-of-type(4n + 3) {
776
+ grid-column: 3;
777
+ }
663
778
 
664
- // 3, 6, 9, ...
665
- & dt:nth-of-type(3n + 3),
666
- & dd:nth-of-type(3n + 3) {
667
- grid-column: 3;
779
+ & dt:nth-of-type(4n + 4),
780
+ & dd:nth-of-type(4n + 4) {
781
+ grid-column: 4;
782
+ }
783
+ }
668
784
  }
669
- }
670
785
 
671
- &.lowFlow fieldset.colspan-2 dl,
672
- &.lowFlow dl.colspan-2 {
673
- grid-template-columns: repeat(2, minmax(var(--inputMinWidth), 1fr));
786
+ @container semanticForm (width < 1050px) {
787
+ fieldset.colspan-4 dl,
788
+ fieldset.colspan-5 dl,
789
+ dl.colspan-4,
790
+ dl.colspan-5 {
791
+ grid-template-columns: repeat(3, minmax(var(--inputMinWidth), 1fr)) !important;
792
+ }
674
793
 
675
- & dt:nth-of-type(2n + 1),
676
- & dd:nth-of-type(2n + 1) {
677
- grid-column: 1;
678
- }
794
+ div.colspan-4, div.colspan-5 {
795
+ grid-column: span 3 !important;
796
+ }
679
797
 
680
- & dt:nth-of-type(2n + 2),
681
- & dd:nth-of-type(2n + 2) {
682
- grid-column: 2;
683
- }
684
- }
798
+ &.lowFlow fieldset dl,
799
+ &.lowFlow dl,
800
+ &.lowFlow fieldset.colspan-4 dl,
801
+ &.lowFlow dl.colspan-4,
802
+ &.lowFlow fieldset.colspan-5 dl,
803
+ &.lowFlow dl.colspan-5 {
804
+ grid-template-columns: repeat(3, minmax(var(--inputMinWidth), 1fr));
805
+
806
+ & dt:nth-of-type(3n + 1),
807
+ & dd:nth-of-type(3n + 1) {
808
+ grid-column: 1;
809
+ }
685
810
 
686
- &.lowFlow fieldset.colspan-1 dl,
687
- &.lowFlow dl.colspan-1 {
688
- grid-template-columns: repeat(1, minmax(var(--inputMinWidth), 1fr));
811
+ & dt:nth-of-type(3n + 2),
812
+ & dd:nth-of-type(3n + 2) {
813
+ grid-column: 2;
814
+ }
689
815
 
690
- & dt:nth-of-type(n + 1),
691
- & dd:nth-of-type(n + 1) {
692
- grid-column: 1;
816
+ & dt:nth-of-type(3n + 3),
817
+ & dd:nth-of-type(3n + 3) {
818
+ grid-column: 3;
819
+ }
820
+ }
693
821
  }
694
- }
695
822
 
696
- // #endregion
823
+ @container semanticForm (width < 800px) {
824
+ fieldset.colspan-3 dl,
825
+ fieldset.colspan-4 dl,
826
+ fieldset.colspan-5 dl,
827
+ dl.colspan-3,
828
+ dl.colspan-4,
829
+ dl.colspan-5 {
830
+ grid-template-columns: repeat(2, minmax(var(--inputMinWidth), 1fr)) !important;
831
+ }
697
832
 
698
- // #region invalid styling
699
- [data-invalid-text] {
700
- display: none;
701
- color: var(--invalid);
702
- }
833
+ div.colspan-3,
834
+ div.colspan-4,
835
+ div.colspan-5 {
836
+ grid-column: span 2 !important;
837
+ }
703
838
 
704
- input:not([type='submit'], [type='reset'], [type='image']),
705
- select,
706
- textarea {
707
- &.invalid,
708
- &:user-invalid {
709
- border: var(--invalidBorder) !important;
839
+ &.lowFlow fieldset dl,
840
+ &.lowFlow dl,
841
+ &.lowFlow fieldset.colspan-3 dl,
842
+ &.lowFlow dl.colspan-3,
843
+ &.lowFlow fieldset.colspan-4 dl,
844
+ &.lowFlow dl.colspan-4,
845
+ &.lowFlow fieldset.colspan-5 dl,
846
+ &.lowFlow dl.colspan-5 {
847
+ grid-template-columns: repeat(2, minmax(var(--inputMinWidth), 1fr));
710
848
 
711
- ~ label:nth-of-type(2) {
712
- color: var(--invalid) !important;
713
- }
849
+ & dt:nth-of-type(2n + 1),
850
+ & dd:nth-of-type(2n + 1) {
851
+ grid-column: 1;
852
+ }
714
853
 
715
- ~ [data-invalid-text] {
716
- font-size: small;
717
- display: flex;
854
+ & dt:nth-of-type(2n + 2),
855
+ & dd:nth-of-type(2n + 2) {
856
+ grid-column: 2;
857
+ }
718
858
  }
719
859
  }
720
860
 
721
- }
722
- // #endregion
861
+ @container semanticForm (width < 550px) {
862
+ fieldset.colspan-2 dl,
863
+ fieldset.colspan-3 dl,
864
+ fieldset.colspan-4 dl,
865
+ fieldset.colspan-5 dl,
866
+ dl.colspan-2,
867
+ dl.colspan-3,
868
+ dl.colspan-4,
869
+ dl.colspan-5,
870
+ dl {
871
+ grid-template-columns: repeat(1, minmax(var(--inputMinWidth), 1fr)) !important;
872
+ }
723
873
 
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
- }
874
+ div.colspan-2, div.colspan-3, div.colspan-4, div.colspan-5 {
875
+ grid-column: span 1 !important;
876
+ }
742
877
 
743
- // update for scrollbars
744
- @supports (scrollbar-color: auto) {
745
- textarea {
746
- scrollbar-color: var(--scrollbarColor) transparent;
878
+ &.lowFlow fieldset dl,
879
+ &.lowFlow dl,
880
+ &.lowFlow fieldset.colspan-2 dl,
881
+ &.lowFlow dl.colspan-2,
882
+ &.lowFlow fieldset.colspan-3 dl,
883
+ &.lowFlow dl.colspan-3,
884
+ &.lowFlow fieldset.colspan-4 dl,
885
+ &.lowFlow dl.colspan-4,
886
+ &.lowFlow fieldset.colspan-5 dl,
887
+ &.lowFlow dl.colspan-5 {
888
+ grid-template-columns: repeat(1, minmax(var(--inputMinWidth), 1fr));
747
889
 
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;
890
+ & dt:nth-of-type(n + 1),
891
+ & dd:nth-of-type(n + 1) {
892
+ grid-column: 1;
893
+ }
755
894
  }
756
895
  }
896
+ // #endregion
757
897
  }
758
898
 
759
899
  // #region low flow form
760
- &.lowFlow {
900
+ &:not(.semanticFormsActive) {
761
901
  dl {
762
- grid-template-columns: repeat(2, minmax(var(--inputMinWidth), 1fr));
763
- grid-auto-flow: dense;
902
+ display: flex;
903
+ flex-direction: column;
764
904
  gap: 5px;
765
905
 
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
906
  dt {
907
+ max-width: 365px !important; /* this matches the max-width of js-enabled inputs */
908
+
779
909
  // add required asterisk
780
910
  &:has(+ dd input:required) {
781
911
  label::after {
@@ -788,6 +918,7 @@ form.semanticForms {
788
918
 
789
919
  dd {
790
920
  margin-bottom: 10px;
921
+ max-width: 365px !important; /* this matches the max-width of js-enabled inputs */
791
922
 
792
923
  // nudge single checkboxes to match checkbox groups
793
924
  &:not(.checkboxes) {
@@ -818,225 +949,4 @@ form.semanticForms {
818
949
  }
819
950
  }
820
951
  // #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
952
  }