semantic-forms 5.0.10 → 5.1.1

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,50 +1,49 @@
1
1
  // #region global styles
2
2
  form.semanticForms, form.semanticForms.light {
3
- --formBackgroundColor: #fff;
4
- --formSubBackgroundColor: #f5f5f5;
5
- --formTextColor: #000;
6
- --buttonBackgroundColor: #f5f5f5;
7
- --borderColor: #c0c0c0;
8
- --subBorderColor: #c0c0c0;
9
- --placeholderColor: rgba(0, 0, 0, 0.75);
10
- --scrollbarColor: #c0c0c0;
11
- --clearButtonColor: #000;
12
- --buttonGradientLight: #fff;
13
- --buttonGradientDark: #c0c0c0;
14
- --invalid: #f00;
15
- --invalidBorder: 1px solid var(--invalid);
16
- --inputHeight: 38px;
17
- --inputFontSize: 16px;
18
- --inputTopMargin: 15px;
19
- --inputMinWidth: 250px;
20
- --borderRadius: 10px;
21
- --nestedFieldset: rgba(0, 0, 0, .05);
22
- --nestedFieldsetBorder: 1px rgba(0, 0, 0, .2) solid;
23
- --nestedInput: #fff;
24
- --border: 1px var(--borderColor) solid;
25
- --selectIcon: url("data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='100' height='100' fill='%23000'%3E%3Cpolygon points='0,0 100,0 50,50'/%3E%3C/svg%3E");
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")
3
+ --semanticFormsFontFamily: sans-serif;
4
+ --semanticFormsFormBgColor: #fff;
5
+ --semanticFormsFormSubBgColor: #f5f5f5;
6
+ --semanticFormsTextColor: #000;
7
+ --semanticFormsBorderColor: #c0c0c0;
8
+ --semanticFormsSubBorderColor: #c0c0c0;
9
+ --semanticFormsPlaceholderColor: rgba(0, 0, 0, 0.75);
10
+ --semanticFormsScrollbarColor: #c0c0c0;
11
+ --semanticFormsClearButtonColor: #000;
12
+ --semanticFormsButtonGradientLight: #fff;
13
+ --semanticFormsButtonGradientDark: #c0c0c0;
14
+ --semanticFormsInvalid: #f00;
15
+ --semanticFormsInvalidBorder: 1px solid var(--semanticFormsInvalid);
16
+ --semanticFormsInputHeight: 38px;
17
+ --semanticFormsInputFontSize: 16px;
18
+ --semanticFormsInputTopMargin: 15px;
19
+ --semanticFormsInputMinWidth: 250px;
20
+ --semanticFormsBorderRadius: 10px;
21
+ --semanticFormsNestedFieldsetBgColor: rgba(0, 0, 0, .05);
22
+ --semanticFormsNestedFieldsetBorder: 1px rgba(0, 0, 0, .2) solid;
23
+ --semanticFormsNestedInputBgColor: #fff;
24
+ --semanticFormsBorder: 1px var(--semanticFormsBorderColor) solid;
25
+ --semanticFormsSelectIcon: url("data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='100' height='100' fill='%23000'%3E%3Cpolygon points='0,0 100,0 50,50'/%3E%3C/svg%3E");
26
+ --semanticFormsCustomResizer: 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
29
  @mixin dark-mode {
30
- --formBackgroundColor: #555;
30
+ --semanticFormsFormBgColor: #555;
31
31
  --inputBackgroudColor: rgba(85,85,85,0.1);
32
- --formSubBackgroundColor: #2f2f2f;
33
- --formTextColor: #fff;
34
- --buttonBackgroundColor: #454545;
35
- --borderColor: #656565;
36
- --subBorderColor: #3f3f3f;
37
- --placeholderColor: rgba(255, 255, 255, 0.85);
38
- --scrollbarColor: #373737;
39
- --clearButtonColor: #fff;
40
- --buttonGradientLight: #6f6f6f;
41
- --buttonGradientDark: #373737;
42
- --nestedFieldset: rgba(255, 255, 255, .05);
43
- --nestedFieldsetBorder: 1px rgba(255, 255, 255, .1) solid;
44
- --nestedInput: rgba(255, 255, 255, .15);
45
- --border: none;
46
- --selectIcon: url("data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='100' height='100' fill='%23fff'%3E%3Cpolygon stroke='%23fff' points='0,0 100,0 50,50'/%3E%3C/svg%3E");
47
- --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:%23c9c9c9;stroke:%23c9c9c9;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:%23c9c9c9;stroke:%23c9c9c9;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:%23c9c9c9;stroke:%23c9c9c9;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");
32
+ --semanticFormsFormSubBgColor: #2f2f2f;
33
+ --semanticFormsTextColor: #fff;
34
+ --semanticFormsBorderColor: #656565;
35
+ --semanticFormsSubBorderColor: #3f3f3f;
36
+ --semanticFormsPlaceholderColor: rgba(255, 255, 255, 0.85);
37
+ --semanticFormsScrollbarColor: #373737;
38
+ --semanticFormsClearButtonColor: #fff;
39
+ --semanticFormsButtonGradientLight: #6f6f6f;
40
+ --semanticFormsButtonGradientDark: #373737;
41
+ --semanticFormsNestedFieldsetBgColor: rgba(255, 255, 255, .05);
42
+ --semanticFormsNestedFieldsetBorder: 1px rgba(255, 255, 255, .1) solid;
43
+ --semanticFormsNestedInputBgColor: rgba(255, 255, 255, .15);
44
+ --semanticFormsBorder: none;
45
+ --semanticFormsSelectIcon: url("data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='100' height='100' fill='%23fff'%3E%3Cpolygon stroke='%23fff' points='0,0 100,0 50,50'/%3E%3C/svg%3E");
46
+ --semanticFormsCustomResizer: 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:%23c9c9c9;stroke:%23c9c9c9;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:%23c9c9c9;stroke:%23c9c9c9;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:%23c9c9c9;stroke:%23c9c9c9;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");
48
47
 
49
48
  input::-webkit-calendar-picker-indicator {
50
49
  filter: invert(100%);
@@ -71,6 +70,7 @@ html:not(.light) {
71
70
  // #endregion
72
71
 
73
72
  form.semanticForms, form.semanticForms.light {
73
+ font-family: var(--semanticFormsFontFamily);
74
74
  width: 100%;
75
75
  container-type: inline-size;
76
76
  container-name: semanticForm;
@@ -91,8 +91,8 @@ form.semanticForms, form.semanticForms.light {
91
91
  dd:has(> input, > select, > textarea, > ul, > menu),
92
92
  div:has(dt, dd),
93
93
  dd > p {
94
- color: var(--formTextColor);
95
- font-family: sans-serif;
94
+ color: var(--semanticFormsTextColor);
95
+ font-family: var(--semanticFormsFontFamily);
96
96
  box-sizing: border-box;
97
97
  margin: 0;
98
98
  padding: 0;
@@ -102,10 +102,10 @@ form.semanticForms, form.semanticForms.light {
102
102
  input:not([type='submit'], [type='reset'], [type='image'], [type=checkbox], [type=radio]),
103
103
  select,
104
104
  textarea {
105
- font-size: var(--inputFontSize);
106
- background: var(--formBackgroundColor);
107
- border: var(--border);
108
- border-radius: var(--borderRadius);
105
+ font-size: var(--semanticFormsInputFontSize);
106
+ background: var(--semanticFormsFormBgColor);
107
+ border: var(--semanticFormsBorder);
108
+ border-radius: var(--semanticFormsBorderRadius);
109
109
  width: 100%;
110
110
  touch-action: manipulation;
111
111
  outline: none;
@@ -139,18 +139,18 @@ form.semanticForms, form.semanticForms.light {
139
139
  // custom focus highlight
140
140
  &:focus {
141
141
  outline: none;
142
- box-shadow: 0 0 0 1px var(--borderColor);
142
+ box-shadow: 0 0 0 1px var(--semanticFormsBorderColor);
143
143
  }
144
144
  }
145
145
 
146
146
  input:not([type='submit'], [type='reset'], [type='image'], [type=checkbox], [type=radio]),
147
147
  select {
148
- height: var(--inputHeight);
148
+ height: var(--semanticFormsInputHeight);
149
149
  }
150
150
 
151
151
  // specific styling for color input
152
152
  input[type=color] {
153
- height: var(--inputHeight);
153
+ height: var(--semanticFormsInputHeight);
154
154
  padding: 4px !important;
155
155
  padding-right: 30px !important;
156
156
  }
@@ -164,19 +164,19 @@ form.semanticForms, form.semanticForms.light {
164
164
  cursor: pointer;
165
165
 
166
166
  & ~ label:first-of-type {
167
- color: var(--formTextColor) !important;
167
+ color: var(--semanticFormsTextColor) !important;
168
168
  }
169
169
  }
170
170
 
171
171
  input[type=file] {
172
172
  cursor: pointer;
173
- font-size: var(--inputFontSize);
173
+ font-size: var(--semanticFormsInputFontSize);
174
174
  }
175
175
 
176
176
  select {
177
177
  cursor: pointer;
178
178
  // custom dropdown graphic on select element
179
- background-image: var(--selectIcon);
179
+ background-image: var(--semanticFormsSelectIcon);
180
180
  background-size: 14px;
181
181
  background-position: calc(100% - 8px) 16px;
182
182
  background-repeat: no-repeat;
@@ -206,7 +206,7 @@ form.semanticForms, form.semanticForms.light {
206
206
  position: absolute;
207
207
  height: min-content;
208
208
  // account for margin above each input
209
- top: calc(var(--inputTopMargin) + 6px);
209
+ top: calc(var(--semanticFormsInputTopMargin) + 6px);
210
210
  right: 0;
211
211
  width: 25px;
212
212
  height: 25px;
@@ -214,7 +214,7 @@ form.semanticForms, form.semanticForms.light {
214
214
  padding: 5px;
215
215
  background: none;
216
216
  border: none;
217
- color: var(--clearButtonColor);
217
+ color: var(--semanticFormsClearButtonColor);
218
218
  display: flex;
219
219
  align-items: center;
220
220
  justify-content: center;
@@ -246,15 +246,16 @@ form.semanticForms, form.semanticForms.light {
246
246
  -webkit-appearance: none;
247
247
  cursor: pointer;
248
248
  max-width: max-content;
249
- background-image: linear-gradient(to bottom, var(--buttonGradientLight) 0%, var(--buttonGradientDark) 100%);
250
- border: 2px var(--buttonGradientDark) solid;
249
+ background-image: linear-gradient(to bottom, var(--semanticFormsButtonGradientLight) 0%, var(--semanticFormsButtonGradientDark) 100%);
250
+ background-origin: border-box; // prevents graphical errors in Firefox
251
+ border: 2px var(--semanticFormsButtonGradientDark) solid;
251
252
  border-radius: 20px;
252
253
  padding: 5px 25px;
253
254
  font-size: 100%;
254
255
  line-height: 1;
255
256
 
256
257
  &:active {
257
- background-image: linear-gradient(to bottom, var(--buttonGradientDark) 0%, var(--buttonGradientLight) 100%);
258
+ background-image: linear-gradient(to bottom, var(--semanticFormsButtonGradientDark) 0%, var(--semanticFormsButtonGradientLight) 100%);
258
259
  }
259
260
  }
260
261
 
@@ -273,7 +274,7 @@ form.semanticForms, form.semanticForms.light {
273
274
  // #region invalid styling
274
275
  [data-invalid-text] {
275
276
  display: none;
276
- color: var(--invalid);
277
+ color: var(--semanticFormsInvalid);
277
278
  }
278
279
 
279
280
  input:not([type='submit'], [type='reset'], [type='image']),
@@ -281,10 +282,10 @@ form.semanticForms, form.semanticForms.light {
281
282
  textarea {
282
283
  &.invalid,
283
284
  &:user-invalid {
284
- border: var(--invalidBorder) !important;
285
+ border: var(--semanticFormsInvalidBorder) !important;
285
286
 
286
287
  ~ label:nth-of-type(2) {
287
- color: var(--invalid) !important;
288
+ color: var(--semanticFormsInvalid) !important;
288
289
  }
289
290
 
290
291
  ~ [data-invalid-text] {
@@ -309,16 +310,16 @@ form.semanticForms, form.semanticForms.light {
309
310
  select:-webkit-autofill:hover,
310
311
  select:-webkit-autofill:focus,
311
312
  select:-webkit-autofill:active {
312
- -webkit-box-shadow: 0 0 0 1000px var(--formBackgroundColor) inset;
313
+ -webkit-box-shadow: 0 0 0 1000px var(--semanticFormsFormBgColor) inset;
313
314
  transition: background-color 5000s ease-in-out 0s, color 5000s ease-in-out 0s;
314
315
  transition-delay: 5000s;
315
316
  transition-property: background-color, color;
316
317
  }
317
318
 
318
319
  fieldset {
319
- border-radius: var(--borderRadius);
320
- background: var(--formSubBackgroundColor);
321
- border: 1px var(--subBorderColor) solid;
320
+ border-radius: var(--semanticFormsBorderRadius);
321
+ background: var(--semanticFormsFormSubBgColor);
322
+ border: 1px var(--semanticFormsSubBorderColor) solid;
322
323
  display: flex;
323
324
  flex-direction: column;
324
325
  gap: 5px;
@@ -326,15 +327,15 @@ form.semanticForms, form.semanticForms.light {
326
327
  margin-bottom: 15px;
327
328
 
328
329
  // nested fieldsets are darkened
329
- > fieldset {
330
- background-color: var(--nestedFieldset);
331
- border: var(--nestedFieldsetBorder);
330
+ fieldset {
331
+ background-color: var(--semanticFormsNestedFieldsetBgColor);
332
+ border: var(--semanticFormsNestedFieldsetBorder);
332
333
 
333
334
  // add opacity to styled inputs to prevent blending with background
334
335
  input:not([type='submit'], [type='reset'], [type='image'], [type=checkbox], [type=radio]),
335
336
  select,
336
337
  textarea {
337
- background-color: var(--nestedInput);
338
+ background-color: var(--semanticFormsNestedInputBgColor);
338
339
  }
339
340
  }
340
341
  }
@@ -350,11 +351,11 @@ form.semanticForms, form.semanticForms.light {
350
351
  // update for scrollbars
351
352
  @supports (scrollbar-color: auto) {
352
353
  textarea {
353
- scrollbar-color: var(--scrollbarColor) transparent;
354
+ scrollbar-color: var(--semanticFormsScrollbarColor) transparent;
354
355
 
355
356
  &::-webkit-resizer {
356
357
  border: none;
357
- background-image: var(--customResizer);
358
+ background-image: var(--semanticFormsCustomResizer);
358
359
  background-size: 14px;
359
360
  background-repeat: no-repeat;
360
361
  background-position: 100%;
@@ -367,7 +368,7 @@ form.semanticForms, form.semanticForms.light {
367
368
 
368
369
  dl:has(dt > label, dd > input, dd > select, dd > textarea) {
369
370
  display: grid;
370
- grid-template-columns: repeat(auto-fit, minmax(var(--inputMinWidth), 1fr));
371
+ grid-template-columns: repeat(auto-fit, minmax(var(--semanticFormsInputMinWidth), 1fr));
371
372
  gap: 10px;
372
373
  margin-bottom: 10px;
373
374
 
@@ -397,7 +398,7 @@ form.semanticForms, form.semanticForms.light {
397
398
  &.checkboxes ul, &.radios ul {
398
399
  display: flex;
399
400
  flex-direction: column;
400
- margin-top: var(--inputTopMargin);
401
+ margin-top: var(--semanticFormsInputTopMargin);
401
402
  padding-left: 10px;
402
403
  gap: 5px;
403
404
 
@@ -443,7 +444,7 @@ form.semanticForms, form.semanticForms.light {
443
444
  input[type=radio] + label:first-of-type {
444
445
  // shift text down to match center
445
446
  padding-top: 2px;
446
- font-size: var(--inputFontSize);
447
+ font-size: var(--semanticFormsInputFontSize);
447
448
 
448
449
  span.required {
449
450
  cursor: help;
@@ -458,10 +459,13 @@ form.semanticForms, form.semanticForms.light {
458
459
  }
459
460
 
460
461
  .floatLabelForm {
462
+ grid-template-columns: repeat(auto-fit, minmax(var(--semanticFormsInputMinWidth), 1fr));
463
+
461
464
  div {
462
465
  position: relative;
463
466
  width: 100%;
464
- min-width: 252px;
467
+ min-width: var(--semanticFormsInputMinWidth);
468
+ max-width: 100%;
465
469
  max-width: 365px;
466
470
 
467
471
  dd:not(.singleCheckbox, .checkboxes, .radios) {
@@ -470,31 +474,42 @@ form.semanticForms, form.semanticForms.light {
470
474
  textarea {
471
475
  &:focus:not([type=checkbox], [type=radio]) ~ label:first-of-type,
472
476
  &:not(:placeholder-shown, [type=checkbox], [type=radio]) ~ label:first-of-type {
473
- color: var(--formTextColor) !important;
477
+ color: var(--semanticFormsTextColor) !important;
478
+ // TODO: finish this work on making the help icon responsive
479
+ // width: 100%;
480
+ // width: calc(100% + 20px);
474
481
  transform: translateY(-150%) scale(0.7);
482
+
483
+ // span.required,
484
+ // span.help {
485
+ // position: static;
486
+ // right: auto;
487
+ // }
475
488
  }
476
489
  }
477
490
 
478
491
  select ~ label:first-of-type {
479
492
  // force label to be correct color
480
- color: var(--formTextColor) !important;
493
+ color: var(--semanticFormsTextColor) !important;
481
494
  }
482
495
 
483
496
  label:first-of-type {
484
- max-width: 230px !important; /* this prevents label text from sticking out of the input element */
485
497
  line-height: 1.2;
486
- font-size: var(--inputFontSize);
498
+ font-size: var(--semanticFormsInputFontSize);
487
499
  position: absolute;
488
500
  transform-origin: left center;
489
501
  pointer-events: none;
490
502
  // when the label is positioned within the input it needs a buffer
491
- top: calc(var(--inputTopMargin) + 10px);
503
+ top: calc(var(--semanticFormsInputTopMargin) + 10px);
492
504
  left: 20px;
493
505
  transition: transform 250ms;
494
506
  cursor: text;
507
+ flex: 1;
495
508
  white-space: nowrap;
496
509
  overflow: hidden;
497
510
  text-overflow: ellipsis;
511
+ min-width: 0;
512
+ width: calc(100% - 35px);
498
513
  }
499
514
 
500
515
  // subtext
@@ -502,13 +517,13 @@ form.semanticForms, form.semanticForms.light {
502
517
  margin-top: -5px;
503
518
  padding-left: 20px;
504
519
  font-size: small;
505
- color: var(--formTextColor);
520
+ color: var(--semanticFormsTextColor);
506
521
  }
507
522
 
508
523
  input,
509
524
  textarea,
510
525
  select {
511
- margin-top: var(--inputTopMargin);
526
+ margin-top: var(--semanticFormsInputTopMargin);
512
527
  }
513
528
 
514
529
  input,
@@ -557,19 +572,46 @@ form.semanticForms, form.semanticForms.light {
557
572
 
558
573
  label:first-of-type {
559
574
  user-select: none;
560
- color: var(--placeholderColor);
575
+ color: var(--semanticFormsPlaceholderColor);
561
576
  touch-action: manipulation;
562
577
 
578
+ // TODO: same as below
579
+ // &:has(span.help) {
580
+ // width: 80%;
581
+ // padding-right: 20px;
582
+ // }
583
+
584
+ // &:has(span.required) {
585
+ // width: 80%;
586
+ // padding-right: 10px;
587
+ // }
588
+
563
589
  span.required {
590
+ // TODO: this places the required asterisk too far to the right when the float label is shrunk
591
+ // position: absolute;
592
+ // right: 0;
564
593
  cursor: help;
565
594
  pointer-events: auto;
566
595
  color: red;
567
596
  }
568
597
 
569
598
  span.help {
599
+ // TODO: this places the help icon too far to the right when the float label is shrunk
600
+ // position: absolute;
601
+ // right: 0;
570
602
  cursor: help;
571
603
  pointer-events: auto;
572
604
  }
605
+
606
+ // // TODO: cover the case where an input is required AND has help text
607
+ // &:has(span.required, span.help) {
608
+ // width: 80%;
609
+ // padding-right: 30px;
610
+
611
+ // span.required {
612
+ // right: 18px;
613
+ // }
614
+ // }
573
615
  }
574
616
  }
575
617
 
@@ -579,14 +621,27 @@ form.semanticForms, form.semanticForms.light {
579
621
 
580
622
  label {
581
623
  user-select: auto;
582
- color: var(--formTextColor);
624
+ color: var(--semanticFormsTextColor);
625
+ font-size: var(--semanticFormsInputFontSize);
583
626
  position: absolute;
584
627
  transform-origin: left center;
585
628
  transform: translateY(-100%) scale(0.7);
586
- top: var(--inputTopMargin);
629
+ top: var(--semanticFormsInputTopMargin);
587
630
  left: 10px;
631
+ white-space: nowrap;
632
+ overflow: hidden;
633
+ text-overflow: ellipsis;
634
+ min-width: 0;
635
+ width: calc(100% + 20px);
636
+
637
+ // TODO: remove this? // &:has(span.help) {
638
+ // width: 100%;
639
+ // padding-right: 20px;
640
+ // }
588
641
 
589
642
  span.help {
643
+ // TODO: remove this? // position: absolute;
644
+ // right: 0;
590
645
  cursor: help;
591
646
  pointer-events: auto;
592
647
  }
@@ -595,7 +650,14 @@ form.semanticForms, form.semanticForms.light {
595
650
 
596
651
  &:has(dd input:required) {
597
652
  dt {
653
+ label {
654
+ width: 100%;
655
+ padding-right:10px;
656
+ }
657
+
598
658
  label > span {
659
+ // TODO: remove this? // position: absolute;
660
+ // right: 0;
599
661
  margin-left: 5px;
600
662
  cursor: help;
601
663
  pointer-events: auto;
@@ -608,7 +670,7 @@ form.semanticForms, form.semanticForms.light {
608
670
 
609
671
  input, textarea {
610
672
  &::placeholder {
611
- color: var(--placeholderColor);
673
+ color: var(--semanticFormsPlaceholderColor);
612
674
  opacity: 1;
613
675
  }
614
676
  }
@@ -656,33 +718,33 @@ form.semanticForms, form.semanticForms.light {
656
718
 
657
719
  fieldset.colspan-full dl,
658
720
  dl.colspan-full {
659
- grid-template-columns: repeat(auto-fit, minmax(var(--inputMinWidth), 1fr));
721
+ grid-template-columns: repeat(auto-fit, minmax(var(--semanticFormsInputMinWidth), 1fr));
660
722
  }
661
723
 
662
724
  fieldset.colspan-5 dl,
663
725
  dl.colspan-5 {
664
- grid-template-columns: repeat(5, minmax(var(--inputMinWidth), 1fr));
726
+ grid-template-columns: repeat(5, minmax(var(--semanticFormsInputMinWidth), 1fr));
665
727
  }
666
728
 
667
729
  fieldset.colspan-4 dl,
668
730
  dl.colspan-4 {
669
- grid-template-columns: repeat(4, minmax(var(--inputMinWidth), 1fr));
731
+ grid-template-columns: repeat(4, minmax(var(--semanticFormsInputMinWidth), 1fr));
670
732
  }
671
733
 
672
734
 
673
735
  fieldset.colspan-3 dl,
674
736
  dl.colspan-3 {
675
- grid-template-columns: repeat(3, minmax(var(--inputMinWidth), 1fr));
737
+ grid-template-columns: repeat(3, minmax(var(--semanticFormsInputMinWidth), 1fr));
676
738
  }
677
739
 
678
740
  fieldset.colspan-2 dl,
679
741
  dl.colspan-2 {
680
- grid-template-columns: repeat(2, minmax(var(--inputMinWidth), 1fr));
742
+ grid-template-columns: repeat(2, minmax(var(--semanticFormsInputMinWidth), 1fr));
681
743
  }
682
744
 
683
745
  fieldset.colspan-1 dl,
684
746
  dl.colspan-1 {
685
- grid-template-columns: repeat(1, minmax(var(--inputMinWidth), 1fr));
747
+ grid-template-columns: repeat(1, minmax(var(--semanticFormsInputMinWidth), 1fr));
686
748
  }
687
749
  // #endregion
688
750
 
@@ -691,7 +753,7 @@ form.semanticForms, form.semanticForms.light {
691
753
  @container semanticForm (width > 2250px) {
692
754
  &.lowFlow fieldset dl,
693
755
  &.lowFlow dl {
694
- grid-template-columns: repeat(6, minmax(var(--inputMinWidth), 1fr));
756
+ grid-template-columns: repeat(6, minmax(var(--semanticFormsInputMinWidth), 1fr));
695
757
 
696
758
  & dt:nth-of-type(6n + 1),
697
759
  & dd:nth-of-type(6n + 1) {
@@ -728,7 +790,7 @@ form.semanticForms, form.semanticForms.light {
728
790
  @container semanticForm (width < 2250px) {
729
791
  &.lowFlow fieldset dl,
730
792
  &.lowFlow dl {
731
- grid-template-columns: repeat(5, minmax(var(--inputMinWidth), 1fr));
793
+ grid-template-columns: repeat(5, minmax(var(--semanticFormsInputMinWidth), 1fr));
732
794
 
733
795
  & dt:nth-of-type(5n + 1),
734
796
  & dd:nth-of-type(5n + 1) {
@@ -760,7 +822,7 @@ form.semanticForms, form.semanticForms.light {
760
822
  @container semanticForm (width < 1300px) {
761
823
  fieldset.colspan-5 dl,
762
824
  dl.colspan-5 {
763
- grid-template-columns: repeat(4, minmax(var(--inputMinWidth), 1fr)) !important;
825
+ grid-template-columns: repeat(4, minmax(var(--semanticFormsInputMinWidth), 1fr)) !important;
764
826
  }
765
827
 
766
828
  div.colspan-5 {
@@ -771,7 +833,7 @@ form.semanticForms, form.semanticForms.light {
771
833
  &.lowFlow dl,
772
834
  &.lowFlow fieldset.colspan-5 dl,
773
835
  &.lowFlow dl.colspan-5 {
774
- grid-template-columns: repeat(4, minmax(var(--inputMinWidth), 1fr));
836
+ grid-template-columns: repeat(4, minmax(var(--semanticFormsInputMinWidth), 1fr));
775
837
 
776
838
  & dt:nth-of-type(4n + 1),
777
839
  & dd:nth-of-type(4n + 1) {
@@ -800,7 +862,7 @@ form.semanticForms, form.semanticForms.light {
800
862
  fieldset.colspan-5 dl,
801
863
  dl.colspan-4,
802
864
  dl.colspan-5 {
803
- grid-template-columns: repeat(3, minmax(var(--inputMinWidth), 1fr)) !important;
865
+ grid-template-columns: repeat(3, minmax(var(--semanticFormsInputMinWidth), 1fr)) !important;
804
866
  }
805
867
 
806
868
  div.colspan-4, div.colspan-5 {
@@ -813,7 +875,7 @@ form.semanticForms, form.semanticForms.light {
813
875
  &.lowFlow dl.colspan-4,
814
876
  &.lowFlow fieldset.colspan-5 dl,
815
877
  &.lowFlow dl.colspan-5 {
816
- grid-template-columns: repeat(3, minmax(var(--inputMinWidth), 1fr));
878
+ grid-template-columns: repeat(3, minmax(var(--semanticFormsInputMinWidth), 1fr));
817
879
 
818
880
  & dt:nth-of-type(3n + 1),
819
881
  & dd:nth-of-type(3n + 1) {
@@ -839,7 +901,7 @@ form.semanticForms, form.semanticForms.light {
839
901
  dl.colspan-3,
840
902
  dl.colspan-4,
841
903
  dl.colspan-5 {
842
- grid-template-columns: repeat(2, minmax(var(--inputMinWidth), 1fr)) !important;
904
+ grid-template-columns: repeat(2, minmax(var(--semanticFormsInputMinWidth), 1fr)) !important;
843
905
  }
844
906
 
845
907
  div.colspan-3,
@@ -856,7 +918,7 @@ form.semanticForms, form.semanticForms.light {
856
918
  &.lowFlow dl.colspan-4,
857
919
  &.lowFlow fieldset.colspan-5 dl,
858
920
  &.lowFlow dl.colspan-5 {
859
- grid-template-columns: repeat(2, minmax(var(--inputMinWidth), 1fr));
921
+ grid-template-columns: repeat(2, minmax(var(--semanticFormsInputMinWidth), 1fr));
860
922
 
861
923
  & dt:nth-of-type(2n + 1),
862
924
  & dd:nth-of-type(2n + 1) {
@@ -880,7 +942,7 @@ form.semanticForms, form.semanticForms.light {
880
942
  dl.colspan-4,
881
943
  dl.colspan-5,
882
944
  dl {
883
- grid-template-columns: repeat(1, minmax(var(--inputMinWidth), 1fr)) !important;
945
+ grid-template-columns: repeat(1, minmax(var(--semanticFormsInputMinWidth), 1fr)) !important;
884
946
  }
885
947
 
886
948
  div.colspan-2, div.colspan-3, div.colspan-4, div.colspan-5 {
@@ -897,7 +959,7 @@ form.semanticForms, form.semanticForms.light {
897
959
  &.lowFlow dl.colspan-4,
898
960
  &.lowFlow fieldset.colspan-5 dl,
899
961
  &.lowFlow dl.colspan-5 {
900
- grid-template-columns: repeat(1, minmax(var(--inputMinWidth), 1fr));
962
+ grid-template-columns: repeat(1, minmax(var(--semanticFormsInputMinWidth), 1fr));
901
963
 
902
964
  & dt:nth-of-type(n + 1),
903
965
  & dd:nth-of-type(n + 1) {
@@ -906,59 +968,71 @@ form.semanticForms, form.semanticForms.light {
906
968
  }
907
969
  }
908
970
  // #endregion
909
- }
910
971
 
911
- // #region low flow form
912
- &:not(.semanticFormsActive) {
913
- dl {
914
- display: flex;
915
- flex-direction: column;
916
- gap: 5px;
917
-
918
- dt {
919
- max-width: 365px !important; /* this matches the max-width of js-enabled inputs */
972
+ // #region low flow form
973
+ &.lowFlow {
974
+ gap: 5px;
920
975
 
921
- // add required asterisk
922
- &:has(+ dd input:required) {
923
- label::after {
924
- content: ' *';
925
- color: red;
926
- }
976
+ dl {
977
+ grid-auto-flow: dense;
927
978
  }
928
- }
929
-
930
-
931
- dd {
932
- margin-bottom: 10px;
933
- max-width: 365px !important; /* this matches the max-width of js-enabled inputs */
934
-
935
- // nudge single checkboxes to match checkbox groups
936
- &:not(.checkboxes) {
937
- input[type=checkbox] {
938
- margin-left: 10px;
939
- }
979
+
980
+ // 1, 4, 7, ...
981
+ & > dt:nth-of-type(2n + 1),
982
+ & > dd:nth-of-type(2n + 1) {
983
+ grid-column: 1;
940
984
  }
941
-
942
- // remove "x" padding
943
- input:not([type=submit], [type=reset], [type=image], [type=checkbox], [type=radio], [type=range]),
944
- select,
945
- textarea {
946
- padding-right: 6px;
985
+
986
+ // 2, 5, 8, ...
987
+ & > dt:nth-of-type(2n + 2),
988
+ & > dd:nth-of-type(2n + 2) {
989
+ grid-column: 2;
947
990
  }
948
-
949
- // subtext
950
- label {
951
- margin-top: -5px;
952
- font-size: small;
953
- color: var(--placeholderColor);
991
+
992
+ dt {
993
+ min-width: var(--semanticFormsInputMinWidth) !important; /* this matches the max-width of js-enabled inputs */
994
+
995
+ // add required asterisk
996
+ &:has(+ dd input:required) {
997
+ label::after {
998
+ content: ' *';
999
+ color: red;
1000
+ }
1001
+ }
1002
+ }
1003
+
1004
+
1005
+ dd {
1006
+ margin-bottom: 10px;
1007
+ min-width: var(--semanticFormsInputMinWidth) !important; /* this matches the max-width of js-enabled inputs */
1008
+
1009
+ // nudge single checkboxes to match checkbox groups
1010
+ &:not(.checkboxes) {
1011
+ input[type=checkbox] {
1012
+ margin-left: 10px;
1013
+ }
1014
+ }
1015
+
1016
+ // remove "x" padding
1017
+ input:not([type=submit], [type=reset], [type=image], [type=checkbox], [type=radio], [type=range]),
1018
+ select,
1019
+ textarea {
1020
+ padding-right: 6px;
1021
+ }
1022
+
1023
+ // subtext
1024
+ label {
1025
+ margin-top: -5px;
1026
+ font-size: small;
1027
+ color: var(--semanticFormsPlaceholderColor);
1028
+ }
954
1029
  }
955
1030
  }
1031
+
1032
+ .checkboxes ul,
1033
+ .radios ul {
1034
+ margin-top: calc(var(--semanticFormsInputTopMargin) / 2);
1035
+ }
956
1036
  }
957
-
958
- .checkboxes ul,
959
- .radios ul {
960
- margin-top: calc(var(--inputTopMargin) / 2);
961
- }
1037
+ // #endregion
962
1038
  }
963
- // #endregion
964
- }