semantic-forms 5.2.2 → 5.3.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,440 +1,17 @@
1
- // #region global styles
2
- form.semanticForms, form.semanticForms.light, table.semanticForms {
3
- --semanticFormsFontFamily: sans-serif;
4
- --semanticFormsFontSize: 16px;
5
- --semanticFormsFormBgColor: #fff;
6
- --semanticFormsFormSubBgColor: #f5f5f5;
7
- --semanticFormsTextColor: #000;
8
- --semanticFormsBorderColor: #c0c0c0;
9
- --semanticFormsSubBorderColor: #c0c0c0;
10
- --semanticFormsPlaceholderColor: rgba(0, 0, 0, 0.75);
11
- --semanticFormsScrollbarColor: #c0c0c0;
12
- --semanticFormsClearButtonColor: #000;
13
- --semanticFormsButtonGradientLight: #fff;
14
- --semanticFormsButtonGradientDark: #c0c0c0;
15
- --semanticFormsInvalid: #f00;
16
- --semanticFormsInvalidBorder: 1px solid var(--semanticFormsInvalid);
17
- --semanticFormsWarn: #ffdd00;
18
- --semanticFormsWarnBorder: 1px solid var(--semanticFormsWarn);
19
- --semanticFormsInputHeight: 38px;
20
- --semanticFormsInputFontSize: 16px;
21
- --semanticFormsInputTopMargin: 15px;
22
- --semanticFormsInputMinWidth: 250px;
23
- --semanticFormsBorderRadius: 10px;
24
- --semanticFormsNestedFieldsetBgColor: oklch(from var(--semanticFormsFormSubBgColor) 0.3 c h / 0.05);
25
- --semanticFormsNestedFieldsetBorder: 1px rgba(0, 0, 0, .2) solid;
26
- --semanticFormsNestedInputBgColor: #fff;
27
- --semanticFormsBorder: 1px var(--semanticFormsBorderColor) solid;
28
- --semanticFormsTableTitleColor: #fcfcfc;
29
- --semanticFormsTableHeaderColor: #eeeeee;
30
- --semanticFormsTableOddColor: #dddddd;
31
- --semanticFormsTableEvenColor: #cccccc;
32
- --semanticFormsTableBorder: 1px #c0c0c0 solid;
33
- --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");
34
- --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");
35
- --semanticFormsSearchIcon: url("data:image/svg+xml,%3Csvg%20width%3D%2214px%22%20height%3D%2214px%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M15.7955%2015.8111L21%2021M18%2010.5C18%2014.6421%2014.6421%2018%2010.5%2018C6.35786%2018%203%2014.6421%203%2010.5C3%206.35786%206.35786%203%2010.5%203C14.6421%203%2018%206.35786%2018%2010.5Z%22%20stroke%3D%22%23000000%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%2F%3E%3C%2Fsvg%3E");
36
- }
37
-
38
- @mixin dark-mode {
39
- --semanticFormsFormBgColor: #555;
40
- --inputBackgroudColor: rgba(85,85,85,0.1);
41
- --semanticFormsFormSubBgColor: #2f2f2f;
42
- --semanticFormsTextColor: #fff;
43
- --semanticFormsBorderColor: #656565;
44
- --semanticFormsSubBorderColor: #3f3f3f;
45
- --semanticFormsPlaceholderColor: rgba(255, 255, 255, 0.85);
46
- --semanticFormsScrollbarColor: #373737;
47
- --semanticFormsClearButtonColor: #fff;
48
- --semanticFormsButtonGradientLight: #6f6f6f;
49
- --semanticFormsButtonGradientDark: #373737;
50
- --semanticFormsNestedFieldsetBgColor: oklch(from var(--semanticFormsFormSubBgColor) 0.9 c h / 0.05);
51
- --semanticFormsNestedFieldsetBorder: 1px rgba(255, 255, 255, .1) solid;
52
- --semanticFormsNestedInputBgColor: rgba(255, 255, 255, .15);
53
- --semanticFormsBorder: none;
54
- --semanticFormsTableTitleColor: #3f3f3f;
55
- --semanticFormsTableHeaderColor: #4f4f4f;
56
- --semanticFormsTableOddColor: #3f3f3f;
57
- --semanticFormsTableEvenColor: #4f4f4f;
58
- --semanticFormsTableBorder: 1px #656565 solid;
59
- --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");
60
- --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");
61
- --semanticFormsSearchIcon: url("data:image/svg+xml,%3Csvg%20width%3D%2214px%22%20height%3D%2214px%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M15.7955%2015.8111L21%2021M18%2010.5C18%2014.6421%2014.6421%2018%2010.5%2018C6.35786%2018%203%2014.6421%203%2010.5C3%206.35786%206.35786%203%2010.5%203C14.6421%203%2018%206.35786%2018%2010.5Z%22%20stroke%3D%22%23FFFFFF%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%2F%3E%3C%2Fsvg%3E");
62
-
63
- input::-webkit-calendar-picker-indicator {
64
- filter: invert(100%);
65
- }
66
- }
67
-
68
- @media (prefers-color-scheme: dark) {
69
- html:not(.light) {
70
- body:not(.light) {
71
- form.semanticForms:not(.light), table.semanticForms:not(.light) {
72
- @include dark-mode;
73
- }
74
- }
75
- }
76
- }
77
-
78
- html:not(.light) {
79
- body:not(.light) {
80
- form.semanticForms.dark, table.semanticForms.dark {
81
- @include dark-mode;
82
- }
83
- }
84
- }
85
-
86
- form.semanticForms.dark, table.semanticForms.dark {
87
- @include dark-mode;
88
- }
89
- // #endregion
90
-
91
- form.semanticForms,
92
- form.semanticForms.light,
93
- table.semanticForms,
94
- table.semanticForms.light {
95
- font-family: var(--semanticFormsFontFamily);
96
- font-size: var(--semanticFormsFontSize);
97
- width: 100%;
98
-
99
- // https://caniuse.com/wf-interpolate-size
100
- @supports (interpolate-size: allow-keywords) {
101
- interpolate-size: allow-keywords;
102
- }
103
-
104
- // due to the specificity of some of these rules, [hidden] won't actually hide things, so we're forcing the issue
105
- [hidden] {
106
- display: none !important;
107
- }
108
-
109
- // hides semantic forms divs if the field itself is hidden
110
- div:has(dd[hidden]) {
111
- display: none !important;
112
- }
113
-
114
- &:not(table) {
115
- display: flex;
116
- flex-direction: column;
117
- gap: 10px;
118
- }
119
-
120
- // style reset
121
- fieldset,
122
- label,
123
- input,
124
- select,
125
- textarea,
126
- button,
127
- menu:has(li > input, li > label, li > button, li > select, li > textarea),
128
- dl:has(dt > label, dd > input, dd > select, dd > textarea),
129
- dt:has(> input, > select, > textarea),
130
- dd:has(> input, > select, > textarea, > ul, > menu),
131
- div:has(dt, dd),
132
- dd > p {
133
- color: var(--semanticFormsTextColor);
134
- font-family: var(--semanticFormsFontFamily);
135
- box-sizing: border-box;
136
- margin: 0;
137
- padding: 0;
138
- }
139
-
140
- // #region input styling
141
- input:not([type='submit'], [type='reset'], [type='image'], [type=checkbox], [type=radio]),
142
- select {
143
- height: var(--semanticFormsInputHeight);
144
- }
145
-
146
- input:not([type='submit'], [type='reset'], [type='image'], [type=checkbox], [type=radio]),
147
- select,
148
- textarea {
149
- font-size: var(--semanticFormsInputFontSize);
150
- background: var(--semanticFormsFormBgColor);
151
- border: var(--semanticFormsBorder);
152
- border-radius: var(--semanticFormsBorderRadius);
153
- width: 100%;
154
- touch-action: manipulation;
155
- outline: none;
156
-
157
- &:not([type="range"]) {
158
- padding: 6px 30px 6px 20px;
159
- }
160
-
161
- // custom focus highlight
162
- input:not([type='submit'], [type='reset'], [type='image']),
163
- select,
164
- textarea {
165
- &:focus {
166
- outline: none;
167
- box-shadow: 0 0 0 1px var(--semanticFormsBorderColor);
168
- }
169
- }
170
-
171
- // input type styling
172
- &[type="password"], &[type="text"]:has(~ button.show) {
173
- padding: 6px 55px 6px 20px;
174
- }
175
-
176
- &[type="search"] {
177
- padding: 6px 20px 6px 32px;
178
- background: var(--semanticFormsSearchIcon) no-repeat 10px;
179
- background-color: var(--semanticFormsFormBgColor);
180
- background-size: 18px;
181
-
182
- &:focus,
183
- &:not(:placeholder-shown) {
184
- & + label.floatLabelFormAnimatedLabel {
185
- left: 20px;
186
- }
187
- }
188
-
189
- // hide native cancel button
190
- &::-webkit-search-cancel-button {
191
- display: none;
192
- }
193
- }
194
-
195
- &[type="checkbox"],
196
- &[type="radio"] {
197
- width: 18px;
198
- height: 18px;
199
- margin: 3px 0;
200
- cursor: pointer;
201
-
202
- & ~ label:first-of-type {
203
- color: var(--semanticFormsTextColor);
204
- }
205
- }
206
-
207
- &[type="range"],
208
- &[type="color"] {
209
- cursor: pointer;
210
- }
211
-
212
- &[type="color"] {
213
- height: var(--semanticFormsInputHeight);
214
- padding: 4px 30px 4px 10px;
215
- }
216
-
217
- &[type="file"] {
218
- cursor: pointer;
219
- font-size: var(--semanticFormsInputFontSize);
220
- }
221
-
222
- &[disabled] {
223
- cursor: not-allowed;
224
- opacity: 0.5;
1
+ @use 'styles/globals.scss';
2
+ @use 'styles/inputs.scss';
3
+ @use 'styles/labels.scss';
4
+ @use 'styles/colspan.scss';
5
+ @use 'styles/lowFlow.scss';
225
6
 
226
- ~ label:first-of-type {
227
- opacity: 0.5;
228
- }
229
-
230
- ~ label + button {
231
- display: none;
232
- }
233
- }
234
- }
235
-
236
- select {
237
- cursor: pointer;
238
-
239
- // single selects
240
- &:not([multiple]) {
241
- // custom dropdown graphic on select element
242
- background-image: var(--semanticFormsSelectIcon);
243
- background-size: 14px;
244
- background-position: calc(100% - 8px) 16px;
245
- background-repeat: no-repeat;
246
- -webkit-appearance: none;
247
- -moz-appearance: none;
248
- appearance: none;
249
- }
250
-
251
- // multi-selects
252
- &[multiple] {
253
- min-height: 38px;
254
- height: 100px;
255
- padding: 0;
256
-
257
- option {
258
- padding: 6px 20px;
259
-
260
- &:first-of-type {
261
- border-top-left-radius: var(--semanticFormsBorderRadius);
262
- }
263
-
264
- &:last-of-type {
265
- border-bottom-left-radius: var(--semanticFormsBorderRadius);
266
- }
267
- }
268
- }
269
- }
270
-
271
- textarea {
272
- resize: vertical;
273
- line-height: 1.5;
274
- width: 100%;
275
- min-height: 38px;
276
-
277
- &[data-auto-grow] {
278
- field-sizing: content;
279
- }
280
- }
281
- // #endregion
282
-
283
- // #region buttons
284
- button.clear, button.show {
285
- cursor: pointer;
286
- appearance: none;
287
- -webkit-appearance: none;
288
- position: absolute;
289
- height: min-content;
290
- // account for margin above each input
291
- top: calc(var(--semanticFormsInputTopMargin) + 6px);
292
- right: 0;
293
- width: 25px;
294
- height: 25px;
295
- margin: auto 6px;
296
- padding: 5px;
297
- background: none;
298
- border: none;
299
- color: var(--semanticFormsClearButtonColor);
300
- display: flex;
301
- align-items: center;
302
- justify-content: center;
303
- }
304
-
305
- button.show {
306
- right: 25px;
307
- }
308
-
309
- // custom styling of clear button on textarea
310
- textarea ~ .clear {
311
- bottom: auto;
312
- }
313
-
314
- // hide clear/show button while placeholder text is visible
315
- input:placeholder-shown ~ .clear,
316
- input:placeholder-shown ~ .show,
317
- textarea:placeholder-shown ~ .clear,
318
- input[type=file] ~ .clear {
319
- display: none;
320
- }
321
-
322
- // button styling
323
- input[type='submit'],
324
- input[type='reset'],
325
- button:not(.clear, .show),
326
- .button-link {
327
- appearance: none;
328
- -moz-appearance: none;
329
- -webkit-appearance: none;
330
- cursor: pointer;
331
- max-width: max-content;
332
- background-image: linear-gradient(to bottom, var(--semanticFormsButtonGradientLight) 0%, var(--semanticFormsButtonGradientDark) 100%);
333
- background-origin: border-box; // prevents graphical errors in Firefox
334
- border: 1px var(--semanticFormsButtonGradientDark) solid;
335
- corner-shape: squircle;
336
- border-radius: 20px;
337
- padding: 5px 25px;
338
- font-size: 100%;
339
- line-height: 1;
340
- user-select: none;
341
- transform: scale(1);
342
- transition: transform 180ms;
343
- text-decoration: none;
344
- color: var(--semanticFormsTextColor);
345
-
346
- &:active {
347
- transform: scale(0.97);
348
- }
349
- }
350
-
351
- input[type='submit'],
352
- input[type='reset'],
353
- input[type='image'],
354
- button:not(.clear):not(.show),
355
- .button-link {
356
- transition: filter 0.1s;
357
-
358
- &:hover {
359
- filter: brightness(1.05);
360
- }
361
- }
362
-
363
- .button-link {
364
- display: block;
365
-
366
- &:visited,
367
- &:link {
368
- color: var(--semanticFormsTextColor);
369
- }
370
- }
371
- // #endregion
372
-
373
- // #region invalid styling
374
- [data-invalid-text] {
375
- display: none;
376
- color: var(--semanticFormsInvalid);
377
- }
378
-
379
- input:not([type='submit'], [type='reset'], [type='image']),
380
- select,
381
- textarea {
382
- &.invalid,
383
- &:user-invalid {
384
- border: var(--semanticFormsInvalidBorder);
385
-
386
- ~ label:nth-of-type(2) {
387
- color: var(--semanticFormsInvalid);
388
- }
389
-
390
- ~ [data-invalid-text] {
391
- font-size: small;
392
- display: flex;
393
- }
394
- }
395
-
396
- &.warn {
397
- border: var(--semanticFormsWarnBorder);
398
-
399
- ~ label:nth-of-type(2) {
400
- color: var(--semanticFormsWarn);
401
- }
402
-
403
- ~ [data-invalid-text] {
404
- font-size: small;
405
- display: flex;
406
- }
407
- }
408
- }
409
- // #endregion
410
-
411
- // disable autofill yellow
412
- input:-webkit-autofill,
413
- input:-webkit-autofill:hover,
414
- input:-webkit-autofill:focus,
415
- input:-webkit-autofill:active,
416
- textarea:-webkit-autofill,
417
- textarea:-webkit-autofill:hover,
418
- textarea:-webkit-autofill:focus,
419
- textarea:-webkit-autofill:active,
420
- select:-webkit-autofill,
421
- select:-webkit-autofill:hover,
422
- select:-webkit-autofill:focus,
423
- select:-webkit-autofill:active {
424
- -webkit-box-shadow: 0 0 0 1000px var(--semanticFormsFormBgColor) inset;
425
- transition: background-color 5000s ease-in-out 0s, color 5000s ease-in-out 0s;
426
- transition-delay: 5000s;
427
- transition-property: background-color, color;
428
- }
429
-
430
- // #region fieldset
7
+ .semanticForms {
431
8
  fieldset {
432
9
  border-radius: var(--semanticFormsBorderRadius);
433
10
  background: var(--semanticFormsFormSubBgColor);
434
11
  border: 1px var(--semanticFormsSubBorderColor) solid;
435
12
  display: flex;
436
13
  flex-direction: column;
437
- gap: 5px;
14
+ gap: 10px;
438
15
  padding: 10px 10px 20px 10px;
439
16
  margin-bottom: 15px;
440
17
 
@@ -442,18 +19,17 @@ table.semanticForms.light {
442
19
  fieldset {
443
20
  background-color: var(--semanticFormsNestedFieldsetBgColor);
444
21
  border: var(--semanticFormsNestedFieldsetBorder);
22
+ margin-top: 15px;
445
23
 
446
24
  // add opacity to styled inputs to prevent blending with background
447
- input:not([type='submit'], [type='reset'], [type='image'], [type=checkbox], [type=radio]),
25
+ input:not([type=submit], [type=reset], [type=button], [type=image], [type=checkbox], [type=radio]),
448
26
  select,
449
27
  textarea {
450
28
  background-color: var(--semanticFormsNestedInputBgColor);
451
29
  }
452
30
  }
453
31
  }
454
- // #endregion
455
32
 
456
- // #region details
457
33
  details {
458
34
  box-sizing: border-box; // ensure sizings match across browsers
459
35
  position: relative;
@@ -464,15 +40,15 @@ table.semanticForms.light {
464
40
  flex-direction: column;
465
41
  gap: 5px;
466
42
  padding: 20px 10px 10px 10px;
467
- margin-bottom: 15px;
43
+ margin-top: 10px;
468
44
  min-height: calc(var(--semanticFormsFontSize) + 20px);
469
-
45
+
470
46
  &::details-content {
471
47
  visibility: hidden;
472
48
  opacity: 0;
473
49
  transition: opacity 250ms ease-in, visibility 0ms ease-in 250ms;
474
50
  }
475
-
51
+
476
52
  @supports (interpolate-size: allow-keywords) { // https://caniuse.com/wf-interpolate-size
477
53
  transition: opacity 250ms ease-in, visibility 0ms ease-in 250ms, height 250ms;
478
54
 
@@ -487,6 +63,7 @@ table.semanticForms.light {
487
63
  summary {
488
64
  cursor: pointer;
489
65
  margin: 0;
66
+ margin-bottom: 10px;
490
67
  line-height: 1;
491
68
  position: absolute;
492
69
  top: 10px;
@@ -534,154 +111,146 @@ table.semanticForms.light {
534
111
 
535
112
  & > dl:first-of-type {
536
113
  margin-top: 15px;
114
+ margin-bottom: 15px;
537
115
  }
538
116
  }
539
117
  }
540
118
 
541
- details[open], summary {
542
- margin-bottom: 10px;
543
- }
544
- // #endregion
545
-
546
- // update for scrollbars
547
- @supports (scrollbar-color: auto) {
548
- textarea {
549
- scrollbar-color: var(--semanticFormsScrollbarColor) transparent;
550
-
551
- &::-webkit-resizer {
552
- border: none;
553
- background-image: var(--semanticFormsCustomResizer);
554
- background-size: 14px;
555
- background-repeat: no-repeat;
556
- background-position: 100%;
557
- margin: 0 2px 2px 0;
558
- }
559
- }
560
-
561
- select[multiple] {
562
- scrollbar-color: var(--semanticFormsScrollbarColor) transparent;
563
- }
564
- }
565
-
566
- // #region container layout
567
- dl:has(dt > label, dd > input, dd > select, dd > textarea) {
119
+ dl {
568
120
  display: grid;
569
121
  grid-template-columns: repeat(auto-fit, minmax(var(--semanticFormsInputMinWidth), 1fr));
570
122
  gap: 10px;
571
123
  margin-bottom: 10px;
572
124
 
573
- dd {
125
+ div {
574
126
  position: relative;
575
- display: flex;
576
- flex-direction: column;
577
- gap: 10px;
578
- max-width: 100%;
127
+ width: 100%;
128
+ max-width: var(--semanticFormsInputMaxWidth);
579
129
 
580
- // checkbox/radio
581
- &.singleCheckbox,
582
- &.singleRadio {
583
- display: grid;
584
- grid-template-columns: 15px 1fr;
585
- align-items: center;
586
- padding-left: 11px;
130
+ &:has([data-max-content]) {
131
+ min-width: 150px;
132
+ max-width: max-content;
587
133
 
588
- // anything that is not the radio/checkbox and its label
589
- & > :not(input[type='checkbox'], input[type='radio'], label) {
590
- grid-column: 1 / -1;
591
- }
134
+ dd {
135
+ width: max-content;
592
136
 
593
- // additional label takes up entire width
594
- label:nth-of-type(2) {
595
- grid-column: 1 / -1;
596
- padding: 0 10px;
597
- font-size: small;
598
- color: var(--semanticFormsTextColor);
137
+ input, select {
138
+ // this is not currently supported in FireFox or Safari, and is progressively enhanced with JS
139
+ field-sizing: content;
140
+ min-width: 150px;
141
+ max-width: max-content;
142
+ }
599
143
  }
600
144
  }
601
145
 
602
- &.singleRadio > input {
603
- margin: 0;
146
+ // hide labels for singular buttons
147
+ &:has(dd > button:only-child, dd > input[type=button]:only-child, dd > input[type=submit]:only-child, dd > input[type=reset]:only-child) {
148
+ dt label {
149
+ display: none;
150
+ }
604
151
  }
605
152
 
606
- // checkbox/radio groups
607
- &.checkboxes, &.radios {
608
- ul {
609
- display: flex;
610
- flex-direction: column;
611
- margin-top: var(--semanticFormsInputTopMargin);
612
- padding-left: 10px;
613
- gap: 5px;
153
+ dd {
154
+ position: relative;
155
+ display: flex;
156
+ flex-direction: column;
157
+ gap: 10px;
158
+ max-width: 100%;
159
+
160
+ // checkbox/radio
161
+ &.singleCheckbox,
162
+ &.singleRadio {
163
+ display: grid;
164
+ grid-template-columns: 15px 1fr;
165
+ align-items: center;
166
+ padding-left: 11px;
167
+
168
+ // anything that is not the radio/checkbox and its label
169
+ & > :not(input[type='checkbox'], input[type='radio'], label) {
170
+ grid-column: 1 / -1;
171
+ }
614
172
 
615
- li {
616
- display: flex;
617
- align-items: center;
618
- gap: 5px;
173
+ // additional label takes up entire width
174
+ label:nth-of-type(2) {
175
+ grid-column: 1 / -1;
176
+ padding: 0 10px;
177
+ font-size: small;
178
+ color: var(--semanticFormsTextColor);
619
179
  }
620
180
  }
621
181
 
622
- // checkbox subtext
623
- & > label {
624
- padding-left: 20px;
625
- font-size: small;
626
- color: var(--semanticFormsTextColor);
182
+ &.singleRadio > input {
183
+ margin: 0;
627
184
  }
628
- }
629
185
 
630
- // place buttons next to input
631
- &:has(button:not(.clear, .show), input[type="submit"]:not(.clear, .show)) {
632
- display: grid;
633
- grid-template-columns: 2fr 1fr;
186
+ // checkbox/radio groups
187
+ &.checkboxes, &.radios {
188
+ ul {
189
+ display: flex;
190
+ flex-direction: column;
191
+ margin-top: var(--semanticFormsInputTopMargin);
192
+ padding-left: 10px;
193
+ gap: 5px;
634
194
 
635
- button.clear, button.show {
636
- right: 36%; // adjust clear/show button to grid
637
- }
195
+ li {
196
+ display: flex;
197
+ align-items: center;
198
+ gap: 5px;
199
+ }
200
+ }
638
201
 
639
- input:not([type="submit"]), select, textarea {
640
- grid-row: 1 / 2;
641
- grid-column: 1 / 2;
202
+ // checkbox subtext
203
+ & > label {
204
+ padding-left: 20px;
205
+ font-size: small;
206
+ color: var(--semanticFormsTextColor);
207
+ }
642
208
  }
643
209
 
644
- button:not(.clear, .show),
645
- input[type="submit"]:not(.clear, .show),
646
- input[type="button"]:not(.clear, .show) {
647
- grid-row: 1 / 2;
648
- grid-column: 2 / 3;
649
- width: 100%;
650
- max-width: 100%;
651
- padding: 10px; // reduce default padding to allow more button text to show
652
- height: var(--semanticFormsInputHeight);
653
- text-overflow: ellipsis;
654
- white-space: nowrap;
655
- overflow: hidden;
656
- display: inline-block;
657
- }
210
+ // singular button
211
+ &:has(button:only-child, input[type=button]:only-child, input[type=submit]:only-child, input[type=reset]:only-child) {
212
+ margin-left: 0;
658
213
 
659
- label:nth-of-type(2),
660
- label:not(.floatLabelFormAnimatedLabel) {
661
- grid-row: 2 / 3;
662
- grid-column: 1 / -1;
214
+ button, input[type=button], input[type=submit], input[type=reset] {
215
+ height: var(--semanticFormsInputHeight);
216
+ }
663
217
  }
664
- }
665
218
 
666
- // focus-key styles
667
- &:has(span.focus-key) {
668
- // make room for focus key span
669
- label:first-of-type {
670
- width: calc(100% - 95px);
671
- }
219
+ // place buttons next to input
220
+ &:has(input ~ button:not(.clear, .show), input ~ input[type=submit], input ~ input[type=reset], input ~ input[type=button], select ~ button:not(.clear, .show),select ~ input[type=submit],select ~ input[type=reset],select ~ input[type=button]) {
221
+ display: grid;
222
+ grid-template-columns: 2fr 1fr;
672
223
 
673
- span.focus-key {
674
- display: block;
675
-
676
- kbd {
677
- font-family: sans-serif;
224
+ button.clear, button.show {
225
+ right: 36%; // adjust clear/show button to grid
226
+ }
227
+
228
+ // inputs take up first section of columns
229
+ input:not([type="submit"]), select, textarea {
230
+ grid-row: 1 / 2;
231
+ grid-column: 1 / 2;
678
232
  }
679
- }
680
233
 
681
- &:has(input:focus, select:focus, textarea:focus),
682
- &:not(:has(input:placeholder-shown, textarea:placeholder-shown)) {
683
- span.focus-key {
684
- display: none;
234
+ // buttons take up second section of columns
235
+ button:not(.clear, .show),
236
+ input[type="submit"]:not(.clear, .show),
237
+ input[type="button"]:not(.clear, .show) {
238
+ grid-row: 1 / 2;
239
+ grid-column: 2 / 3;
240
+ width: 100%;
241
+ max-width: 100%;
242
+ padding: 10px; // reduce default padding to allow more button text to show
243
+ height: var(--semanticFormsInputHeight);
244
+ text-overflow: ellipsis;
245
+ white-space: nowrap;
246
+ overflow: hidden;
247
+ display: inline-block;
248
+ }
249
+
250
+ label:nth-of-type(2),
251
+ label:not(.floatLabelFormAnimatedLabel) {
252
+ grid-row: 2 / 3;
253
+ grid-column: 1 / -1;
685
254
  }
686
255
  }
687
256
  }
@@ -713,1042 +282,70 @@ table.semanticForms.light {
713
282
  gap: 10px;
714
283
  list-style-type: none;
715
284
  }
716
- // #endregion
717
-
718
- // #region labels
719
285
 
720
- input[type=checkbox] + label:first-of-type,
721
- input[type=radio] + label:first-of-type {
722
- // shift text down to match center
723
- padding-top: 2px;
724
- font-size: var(--semanticFormsInputFontSize);
725
- cursor: pointer;
286
+ div:has(.align-start) {
726
287
  display: flex;
727
- align-items: center;
728
- gap: 5px;
729
-
730
- span.required {
731
- cursor: help;
732
- pointer-events: auto;
733
- color: red;
734
- }
735
-
736
- span.help {
737
- display: grid;
738
- place-items: center;
739
- cursor: help;
740
- pointer-events: auto;
741
-
742
- svg {
743
- width: 80%;
744
- }
745
- }
288
+ justify-content: start;
746
289
  }
747
290
 
748
- .floatLabelForm {
749
- grid-template-columns: repeat(auto-fit, minmax(var(--semanticFormsInputMinWidth), 1fr));
291
+ div:has(.align-center) {
292
+ display: flex;
293
+ justify-content: center;
294
+ }
750
295
 
751
- div {
752
- position: relative;
753
- width: 100%;
754
- min-width: var(--semanticFormsInputMinWidth);
755
- max-width: 100%;
756
- max-width: 365px;
296
+ div:has(.align-end) {
297
+ display: flex;
298
+ justify-content: end;
299
+ }
300
+ }
757
301
 
758
- dd:not(.singleCheckbox, .singleRadio, .checkboxes, .radios) {
759
- input:not([type='submit'], [type='reset'], [type='image']),
760
- select,
761
- textarea {
762
- &:focus:not([type=checkbox], [type=radio], .no-float-label) ~ label:first-of-type,
763
- &:not(:placeholder-shown):not(.no-float-label):not([type=checkbox]):not([type=radio]) ~ label:first-of-type {
764
- color: var(--semanticFormsTextColor);
765
- transform: translateY(-150%) scale(0.7);
766
- width: 100%;
767
- }
768
- }
302
+ .semanticForms table,
303
+ table.semanticForms {
304
+ table-layout: fixed;
305
+ width: 100%;
306
+ border-spacing: 0;
307
+ border: var(--semanticFormsBorder);
308
+ border-radius: 10px;
309
+ margin-bottom: 15px;
310
+ overflow: hidden;
769
311
 
770
- // hide float label if no-float-label class is present
771
- input:not([type='submit'], [type='reset'], [type='image']),
772
- select,
773
- textarea {
774
- &:focus.no-float-label ~ label:first-of-type,
775
- &:not(:placeholder-shown).no-float-label:not([type=checkbox]):not([type=radio]) ~ label:first-of-type {
776
- display: none;
777
- }
778
- }
312
+ tr.title th {
313
+ background-color: var(--semanticFormsTableTitleColor);
314
+ }
779
315
 
780
- select ~ label:first-of-type {
781
- // force label to be correct color
782
- color: var(--semanticFormsTextColor);
783
- }
316
+ th {
317
+ background-color: var(--semanticFormsTableHeaderColor);
318
+ font-weight: bold;
319
+ }
784
320
 
785
- button:not(.clear, .show),
786
- input[type=submit]:not(.clear, .show) {
787
- margin-top: var(--semanticFormsInputTopMargin);
788
- }
321
+ tr:nth-child(odd) td {
322
+ background-color: var(--semanticFormsTableOddColor);
323
+ }
789
324
 
790
- // input label
791
- label:first-of-type {
792
- position: absolute;
793
- top: calc(var(--semanticFormsInputTopMargin) + 10px);
794
- left: 20px;
795
- display: flex;
796
- align-items: center;
797
- gap: 5px;
798
- line-height: 1.2;
799
- font-size: var(--semanticFormsInputFontSize);
800
- transform-origin: left center;
801
- pointer-events: none;
802
- transition: transform 250ms;
803
- cursor: text;
804
- flex: 1;
805
- white-space: nowrap;
806
- overflow: hidden;
807
- text-overflow: ellipsis;
808
- min-width: 0;
809
- width: calc(100% - 35px);
810
- user-select: none;
811
- color: var(--semanticFormsPlaceholderColor);
812
- touch-action: manipulation;
325
+ tr:nth-child(even) td {
326
+ background-color: var(--semanticFormsTableEvenColor);
327
+ }
813
328
 
814
- span.required {
815
- cursor: help;
816
- pointer-events: auto;
817
- color: red;
818
- }
329
+ td, th {
330
+ border-right: var(--semanticFormsTableBorder);
331
+ border-bottom: var(--semanticFormsTableBorder);
332
+ padding: 7px 10px;
333
+ }
819
334
 
820
- span.help {
821
- display: grid;
822
- place-items: center;
823
- cursor: help;
824
- pointer-events: auto;
335
+ th:last-of-type, td:last-of-type {
336
+ border-right: none;
337
+ }
825
338
 
826
- svg {
827
- width: 80%;
828
- }
829
- }
830
- }
831
-
832
- // subtext label
833
- label:nth-of-type(2) {
834
- margin-top: -5px;
835
- padding: 0 10px;
836
- font-size: small;
837
- color: var(--semanticFormsTextColor);
838
- }
839
-
840
- input,
841
- textarea,
842
- select {
843
- margin-top: var(--semanticFormsInputTopMargin);
844
- }
845
-
846
- input,
847
- textarea {
848
- transition: opacity 250ms;
849
-
850
- // hide placeholder content until input is focused
851
- &::placeholder {
852
- opacity: 0;
853
- transition: opacity 250ms;
854
- }
855
-
856
- &::-moz-placeholder {
857
- opacity: 0;
858
- transition: opacity 250ms;
859
- }
860
-
861
- &::-webkit-input-placeholder {
862
- opacity: 0;
863
- transition: opacity 250ms;
864
- }
865
-
866
- &:-ms-input-placeholder {
867
- opacity: 0;
868
- transition: opacity 250ms;
869
- }
870
-
871
- // show placeholder content when focused
872
- &:focus {
873
- &::placeholder {
874
- opacity: 1;
875
- }
876
-
877
- &::-moz-placeholder {
878
- opacity: 1;
879
- }
880
-
881
- &::-webkit-input-placeholder {
882
- opacity: 1;
883
- }
884
-
885
- &:-ms-input-placeholder {
886
- opacity: 1;
887
- }
888
- }
889
- }
890
-
891
- // keyboard shortcut indicator
892
- span.focus-key {
893
- color: var(--semanticFormsPlaceholderColor);
894
- position: absolute;
895
- top: calc(var(--semanticFormsInputTopMargin) + 11px);
896
- right: 20px;
897
-
898
- kbd {
899
- line-height: 1;
900
- }
901
- }
902
-
903
- &:has(input[type="number"]) {
904
- .focus-key {
905
- right: 45px;
906
- }
907
- }
908
-
909
- &:has(input[type="search"]) {
910
- label:first-of-type {
911
- left: 32px;
912
- }
913
- }
914
- }
915
-
916
- // top level label for checkbox and radio groups
917
- dt {
918
- position: relative;
919
-
920
- label {
921
- display: flex;
922
- align-items: center;
923
- gap: 5px;
924
- z-index: 2; // ensure the hoverable icon is interactable
925
- user-select: auto;
926
- color: var(--semanticFormsTextColor);
927
- font-size: var(--semanticFormsInputFontSize);
928
- position: absolute;
929
- transform-origin: left center;
930
- transform: translateY(-100%) scale(0.7);
931
- top: var(--semanticFormsInputTopMargin);
932
- left: 10px;
933
- white-space: nowrap;
934
- overflow: hidden;
935
- text-overflow: ellipsis;
936
- min-width: 0;
937
- width: 100%;
938
-
939
- span.help {
940
- display: grid;
941
- place-items: center;
942
- cursor: help;
943
- pointer-events: auto;
944
- }
945
- }
946
- }
947
-
948
- &:has(dd input:required) {
949
- dt {
950
- label {
951
- width: 100%;
952
- padding-right:10px;
953
- }
954
-
955
- label > span {
956
- margin-left: 5px;
957
- cursor: help;
958
- pointer-events: auto;
959
- color: red;
960
- }
961
- }
962
- }
963
-
964
- // data-max-content CSS
965
- &:has([data-max-content]) {
966
- max-width: max-content;
967
- min-width: 150px;
968
-
969
- dd {
970
- width: max-content;
971
-
972
- input, select {
973
- // this is not currently supported in FireFox or Safari, and is progressively enhanced with JS
974
- field-sizing: content;
975
- min-width: 150px;
976
- max-width: max-content;
977
- }
978
- }
979
- }
980
- }
981
-
982
- input, textarea {
983
- &::placeholder {
984
- color: var(--semanticFormsPlaceholderColor);
985
- opacity: 1;
986
- }
987
- }
988
- // #endregion
989
- }
990
-
991
- // #region colspan classes
992
- div {
993
- &[class^='colspan-'] {
994
- max-width: 100%;
995
- }
996
-
997
- &.colspan-full {
998
- grid-column: 1 / -1;
999
- }
1000
-
1001
- &.colspan-5 {
1002
- grid-column: span 5;
1003
- }
1004
-
1005
- &.colspan-4 {
1006
- grid-column: span 4;
1007
- }
1008
-
1009
- &.colspan-3 {
1010
- grid-column: span 3;
1011
- }
1012
-
1013
- &.colspan-2 {
1014
- grid-column: span 2;
1015
- }
1016
-
1017
- &.colspan-1 {
1018
- grid-column: span 1;
1019
- }
1020
- }
1021
-
1022
- fieldset[class^='colspan-'] dl,
1023
- dl[class^='colspan-'] {
1024
- div {
1025
- max-width: 100%;
1026
- }
1027
- }
1028
-
1029
- fieldset.colspan-full dl,
1030
- dl.colspan-full {
1031
- grid-template-columns: repeat(auto-fit, minmax(var(--semanticFormsInputMinWidth), 1fr));
1032
- }
1033
-
1034
- fieldset.colspan-5 dl,
1035
- dl.colspan-5 {
1036
- grid-template-columns: repeat(5, minmax(var(--semanticFormsInputMinWidth), 1fr));
1037
- }
1038
-
1039
- fieldset.colspan-4 dl,
1040
- dl.colspan-4 {
1041
- grid-template-columns: repeat(4, minmax(var(--semanticFormsInputMinWidth), 1fr));
1042
- }
1043
-
1044
- fieldset.colspan-3 dl,
1045
- dl.colspan-3 {
1046
- grid-template-columns: repeat(3, minmax(var(--semanticFormsInputMinWidth), 1fr));
1047
- }
1048
-
1049
- fieldset.colspan-2 dl,
1050
- dl.colspan-2 {
1051
- grid-template-columns: repeat(2, minmax(var(--semanticFormsInputMinWidth), 1fr));
1052
- }
1053
-
1054
- fieldset.colspan-1 dl,
1055
- dl.colspan-1 {
1056
- grid-template-columns: repeat(1, minmax(var(--semanticFormsInputMinWidth), 1fr));
1057
- }
1058
-
1059
- fieldset.colspan-1 dl,
1060
- dl.colspan-1 {
1061
- dt:nth-of-type(n + 1),
1062
- dd:nth-of-type(n + 1) {
1063
- grid-column: 1;
1064
- }
1065
- }
1066
-
1067
- fieldset.colspan-2 dl,
1068
- dl.colspan-2 {
1069
- dt:nth-of-type(2n + 1),
1070
- dd:nth-of-type(2n + 1) {
1071
- grid-column: 1;
1072
- }
1073
-
1074
- dt:nth-of-type(2n + 2),
1075
- dd:nth-of-type(2n + 2) {
1076
- grid-column: 2;
1077
- }
1078
- }
1079
-
1080
- fieldset.colspan-3 dl,
1081
- dl.colspan-3 {
1082
- dt:nth-of-type(3n + 1),
1083
- dd:nth-of-type(3n + 1) {
1084
- grid-column: 1;
1085
- }
1086
-
1087
- dt:nth-of-type(3n + 2),
1088
- dd:nth-of-type(3n + 2) {
1089
- grid-column: 2;
1090
- }
1091
-
1092
- dt:nth-of-type(3n + 3),
1093
- dd:nth-of-type(3n + 3) {
1094
- grid-column: 3;
1095
- }
1096
- }
1097
-
1098
- fieldset.colspan-4 dl,
1099
- dl.colspan-4 {
1100
- dt:nth-of-type(4n + 1),
1101
- dd:nth-of-type(4n + 1) {
1102
- grid-column: 1;
1103
- }
1104
-
1105
- dt:nth-of-type(4n + 2),
1106
- dd:nth-of-type(4n + 2) {
1107
- grid-column: 2;
1108
- }
1109
-
1110
- dt:nth-of-type(4n + 3),
1111
- dd:nth-of-type(4n + 3) {
1112
- grid-column: 3;
1113
- }
1114
-
1115
- dt:nth-of-type(4n + 4),
1116
- dd:nth-of-type(4n + 4) {
1117
- grid-column: 4;
1118
- }
1119
- }
1120
-
1121
- fieldset.colspan-5 dl,
1122
- dl.colspan-5 {
1123
- dt:nth-of-type(5n + 1),
1124
- dd:nth-of-type(5n + 1) {
1125
- grid-column: 1;
1126
- }
1127
-
1128
- dt:nth-of-type(5n + 2),
1129
- dd:nth-of-type(5n + 2) {
1130
- grid-column: 2;
1131
- }
1132
-
1133
- dt:nth-of-type(5n + 3),
1134
- dd:nth-of-type(5n + 3) {
1135
- grid-column: 3;
1136
- }
1137
-
1138
- dt:nth-of-type(5n + 4),
1139
- dd:nth-of-type(5n + 4) {
1140
- grid-column: 4;
1141
- }
1142
-
1143
- dt:nth-of-type(5n + 5),
1144
- dd:nth-of-type(5n + 5) {
1145
- grid-column: 5;
1146
- }
1147
- }
1148
- // #endregion
1149
-
1150
- // #region low flow form
1151
- &.lowFlow,
1152
- &:not(.semanticFormsActive) {
1153
- gap: 10px;
1154
-
1155
- dl {
1156
- grid-auto-flow: dense;
1157
- gap: 0 10px;
1158
- margin-bottom: 0px;
1159
- }
1160
-
1161
- // 1, 4, 7, ...
1162
- & > dt:nth-of-type(2n + 1),
1163
- & > dd:nth-of-type(2n + 1) {
1164
- grid-column: 1;
1165
- }
1166
-
1167
- // 2, 5, 8, ...
1168
- & > dt:nth-of-type(2n + 2),
1169
- & > dd:nth-of-type(2n + 2) {
1170
- grid-column: 2;
1171
- }
1172
-
1173
- dt {
1174
- min-width: var(--semanticFormsInputMinWidth); /* this matches the max-width of js-enabled inputs */
1175
-
1176
- label {
1177
- position: absolute;
1178
- display: block;
1179
- height: 11px;
1180
- transform: scale(0.7);
1181
- transform-origin: left center;
1182
- padding-left: 22px;
1183
- margin-top: -1px;
1184
- }
1185
-
1186
- // add required asterisk
1187
- &:has(+ dd input:required) {
1188
- label::after {
1189
- content: ' *';
1190
- color: red;
1191
- }
1192
- }
1193
- }
1194
-
1195
- // checkbox/radio groups
1196
- dt {
1197
- &:has(+ dd.checkboxes),
1198
- &:has(+ dd.radios) {
1199
- label {
1200
- padding-left: 15px;
1201
- }
1202
- }
1203
- }
1204
-
1205
- // single checkbox label
1206
- dt {
1207
- &:not(:has(+ dd ul)){
1208
- &:has(+ dd input[type=checkbox]) {
1209
- label {
1210
- transform: scale(1);
1211
- margin-top: 0;
1212
- margin-left: 8px;
1213
- }
1214
- }
1215
-
1216
- &:has(+ dd input[type=radio]) {
1217
- label {
1218
- transform: scale(1);
1219
- margin-top: 0;
1220
- margin-left: 8px;
1221
- }
1222
- }
1223
- }
1224
- }
1225
-
1226
-
1227
- dd {
1228
- // margin-bottom: 10px;
1229
- margin-top: var(--semanticFormsInputTopMargin);
1230
- margin-bottom: 10px;
1231
- min-width: var(--semanticFormsInputMinWidth); /* this matches the max-width of js-enabled inputs */
1232
-
1233
- // checkbox/radio groups
1234
- &.checkboxes,
1235
- &.radios {
1236
- margin-top: 0;
1237
-
1238
- ul {
1239
- input[type=radio] {
1240
- margin-top: 3px;
1241
- }
1242
-
1243
- label {
1244
- padding-top: 7px;
1245
- padding-left: 0;
1246
- font-size: var(--semanticFormsFontSize);
1247
- }
1248
- }
1249
-
1250
- // additional text
1251
- ul + label {
1252
- margin-top: 0;
1253
- font-size: small;
1254
- }
1255
- }
1256
-
1257
- // single checkbox/radio
1258
- &:not(:has(ul)){
1259
- &:has(input[type=checkbox], input[type=radio]) {
1260
- margin-top: 0;
1261
- padding-left: 10px;
1262
-
1263
- input[type=checkbox],
1264
- input[type=radio] {
1265
- margin-left: 1px;
1266
- margin-top: 1px;
1267
- margin-right: auto;
1268
- }
1269
-
1270
- // additional info text
1271
- label {
1272
- font-size: small;
1273
- margin-top: -1px;
1274
- padding-left: 11px;
1275
- }
1276
-
1277
- input[type=radio] + label {
1278
- margin-top: -4px;
1279
- }
1280
- }
1281
- }
1282
-
1283
- // remove "x" padding
1284
- input:not([type=submit], [type=reset], [type=image], [type=checkbox], [type=radio], [type=range]),
1285
- select,
1286
- textarea {
1287
- padding-right: 6px;
1288
- }
1289
-
1290
- // subtext
1291
- label {
1292
- padding-left: 10px;
1293
- margin-top: -5px;
1294
- font-size: small;
1295
- color: var(--semanticFormsPlaceholderColor);
1296
- }
1297
-
1298
- // inline buttons
1299
- button:not(.clear, .show),
1300
- input[type="submit"]:not(.clear, .show),
1301
- input[type="button"]:not(.clear, .show) {
1302
- margin-top: 0;
1303
- }
1304
- }
1305
- }
1306
-
1307
- .checkboxes ul,
1308
- .radios ul {
1309
- margin-top: var(--semanticFormsInputTopMargin);
1310
- }
1311
- // #endregion
1312
- }
1313
-
1314
- // #region tables
1315
-
1316
- .semanticForms table,
1317
- table.semanticForms {
1318
- table-layout: fixed;
1319
- width: 100%;
1320
- border-spacing: 0;
1321
- border: var(--semanticFormsBorder);
1322
- border-radius: 10px;
1323
- margin-bottom: 15px;
1324
- overflow: hidden;
1325
-
1326
- tr.title th {
1327
- background-color: var(--semanticFormsTableTitleColor);
1328
- }
1329
-
1330
- th {
1331
- background-color: var(--semanticFormsTableHeaderColor);
1332
- font-weight: bold;
1333
- }
1334
-
1335
- tr:nth-child(odd) td {
1336
- background-color: var(--semanticFormsTableOddColor);
1337
- }
1338
-
1339
- tr:nth-child(even) td {
1340
- background-color: var(--semanticFormsTableEvenColor);
1341
- }
1342
-
1343
- td, th {
1344
- border-right: var(--semanticFormsTableBorder);
1345
- border-bottom: var(--semanticFormsTableBorder);
1346
- padding: 7px 10px;
1347
- }
1348
-
1349
- th:last-of-type, td:last-of-type {
1350
- border-right: none;
1351
- }
1352
-
1353
- tbody {
1354
- tr:last-of-type {
1355
- th, td {
1356
- border-bottom: none;
1357
- }
1358
- }
1359
- }
339
+ tbody {
340
+ tr:last-of-type {
341
+ th, td {
342
+ border-bottom: none;
343
+ }
344
+ }
345
+ }
1360
346
 
1361
347
  // adjust styling of button menus in tables
1362
348
  menu:has(li > input, li > label, li > button, li > select, li > textarea, li > a) {
1363
349
  width: max-content;
1364
350
  }
1365
351
  }
1366
- // #endregion
1367
-
1368
- // #region container queries
1369
- form.semanticForms,
1370
- fieldset {
1371
- container: semanticForm / inline-size;
1372
-
1373
- // max 7 columns
1374
- @container semanticForm (width >= 1810px) {
1375
- & fieldset dl,
1376
- & dl {
1377
- grid-template-columns: repeat(7, minmax(var(--semanticFormsInputMinWidth), 1fr));
1378
-
1379
- &:has(:not(div)) {
1380
- & dt:nth-of-type(7n + 1),
1381
- & dd:nth-of-type(7n + 1) {
1382
- grid-column: 1;
1383
- }
1384
-
1385
- & dt:nth-of-type(7n + 2),
1386
- & dd:nth-of-type(7n + 2) {
1387
- grid-column: 2;
1388
- }
1389
-
1390
- & dt:nth-of-type(7n + 3),
1391
- & dd:nth-of-type(7n + 3) {
1392
- grid-column: 3;
1393
- }
1394
-
1395
- & dt:nth-of-type(7n + 4),
1396
- & dd:nth-of-type(7n + 4) {
1397
- grid-column: 4;
1398
- }
1399
-
1400
- & dt:nth-of-type(7n + 5),
1401
- & dd:nth-of-type(7n + 5) {
1402
- grid-column: 5;
1403
- }
1404
-
1405
- & dt:nth-of-type(7n + 6),
1406
- & dd:nth-of-type(7n + 6) {
1407
- grid-column: 6;
1408
- }
1409
-
1410
- & dt:nth-of-type(7n + 7),
1411
- & dd:nth-of-type(7n + 7) {
1412
- grid-column: 7;
1413
- }
1414
-
1415
- & dt:has(+ dd.colspan-5),
1416
- & dt:has(+ dd.colspan-full),
1417
- & dd.colspan-5,
1418
- & dd.colspan-full {
1419
- grid-column: span 5;
1420
- }
1421
-
1422
- & dt:has(+ dd.colspan-4),
1423
- & dd.colspan-4 {
1424
- grid-column: span 4;
1425
- }
1426
-
1427
- & dt:has(+ dd.colspan-3),
1428
- & dd.colspan-3 {
1429
- grid-column: span 3;
1430
- }
1431
-
1432
- & dt:has(+ dd.colspan-2),
1433
- & dd.colspan-2 {
1434
- grid-column: span 2;
1435
- }
1436
- }
1437
- }
1438
- }
1439
-
1440
- // max 6 columns
1441
- @container semanticForm (width >= 1550px) and (width < 1810px) {
1442
- & fieldset dl,
1443
- & dl {
1444
- grid-template-columns: repeat(6, minmax(var(--semanticFormsInputMinWidth), 1fr));
1445
-
1446
- &:has(:not(div)) {
1447
- & dt:nth-of-type(6n + 1),
1448
- & dd:nth-of-type(6n + 1) {
1449
- grid-column: 1;
1450
- }
1451
-
1452
- & dt:nth-of-type(6n + 2),
1453
- & dd:nth-of-type(6n + 2) {
1454
- grid-column: 2;
1455
- }
1456
-
1457
- & dt:nth-of-type(6n + 3),
1458
- & dd:nth-of-type(6n + 3) {
1459
- grid-column: 3;
1460
- }
1461
-
1462
- & dt:nth-of-type(6n + 4),
1463
- & dd:nth-of-type(6n + 4) {
1464
- grid-column: 4;
1465
- }
1466
-
1467
- & dt:nth-of-type(6n + 5),
1468
- & dd:nth-of-type(6n + 5) {
1469
- grid-column: 5;
1470
- }
1471
-
1472
- & dt:nth-of-type(6n + 6),
1473
- & dd:nth-of-type(6n + 6) {
1474
- grid-column: 6;
1475
- }
1476
-
1477
- & dt:has(+ dd.colspan-5),
1478
- & dt:has(+ dd.colspan-full),
1479
- & dd.colspan-5,
1480
- & dd.colspan-full {
1481
- grid-column: span 5;
1482
- }
1483
-
1484
- & dt:has(+ dd.colspan-4),
1485
- & dd.colspan-4 {
1486
- grid-column: span 4;
1487
- }
1488
-
1489
- & dt:has(+ dd.colspan-3),
1490
- & dd.colspan-3 {
1491
- grid-column: span 3;
1492
- }
1493
-
1494
- & dt:has(+ dd.colspan-2),
1495
- & dd.colspan-2 {
1496
- grid-column: span 2;
1497
- }
1498
- }
1499
- }
1500
- }
1501
-
1502
- // max 5 columns
1503
- @container semanticForm (width >= 1290px) and (width < 1550px) {
1504
- & fieldset dl,
1505
- & dl {
1506
- grid-template-columns: repeat(5, minmax(var(--semanticFormsInputMinWidth), 1fr));
1507
-
1508
- &:has(:not(div)) {
1509
- & dt:nth-of-type(5n + 1),
1510
- & dd:nth-of-type(5n + 1) {
1511
- grid-column: 1;
1512
- }
1513
-
1514
- & dt:nth-of-type(5n + 2),
1515
- & dd:nth-of-type(5n + 2) {
1516
- grid-column: 2;
1517
- }
1518
-
1519
- & dt:nth-of-type(5n + 3),
1520
- & dd:nth-of-type(5n + 3) {
1521
- grid-column: 3;
1522
- }
1523
-
1524
- & dt:nth-of-type(5n + 4),
1525
- & dd:nth-of-type(5n + 4) {
1526
- grid-column: 4;
1527
- }
1528
-
1529
- & dt:nth-of-type(5n + 5),
1530
- & dd:nth-of-type(5n + 5) {
1531
- grid-column: 5;
1532
- }
1533
-
1534
- & dt:has(+ dd.colspan-5),
1535
- & dt:has(+ dd.colspan-full),
1536
- & dd.colspan-5,
1537
- & dd.colspan-full {
1538
- grid-column: span 5;
1539
- }
1540
-
1541
- & dt:has(+ dd.colspan-4),
1542
- & dd.colspan-4 {
1543
- grid-column: span 4;
1544
- }
1545
-
1546
- & dt:has(+ dd.colspan-3),
1547
- & dd.colspan-3 {
1548
- grid-column: span 3;
1549
- }
1550
-
1551
- & dt:has(+ dd.colspan-2),
1552
- & dd.colspan-2 {
1553
- grid-column: span 2;
1554
- }
1555
- }
1556
- }
1557
- }
1558
-
1559
- // max 4 columns
1560
- @container semanticForm (width >= 1030px) and (width < 1290px) {
1561
- & fieldset dl,
1562
- & fieldset.colspan-5 dl,
1563
- & dl,
1564
- & dl.colspan-5 {
1565
- grid-template-columns: repeat(4, minmax(var(--semanticFormsInputMinWidth), 1fr));
1566
-
1567
- div.colspan-5 {
1568
- grid-column: span 4;
1569
- }
1570
-
1571
- &:has(:not(div)) {
1572
- & dt:nth-of-type(4n + 1),
1573
- & dd:nth-of-type(4n + 1) {
1574
- grid-column: 1;
1575
- }
1576
-
1577
- & dt:nth-of-type(4n + 2),
1578
- & dd:nth-of-type(4n + 2) {
1579
- grid-column: 2;
1580
- }
1581
-
1582
- & dt:nth-of-type(4n + 3),
1583
- & dd:nth-of-type(4n + 3) {
1584
- grid-column: 3;
1585
- }
1586
-
1587
- & dt:nth-of-type(4n + 4),
1588
- & dd:nth-of-type(4n + 4) {
1589
- grid-column: 4;
1590
- }
1591
-
1592
- & dt:has(+ dd.colspan-4),
1593
- & dt:has(+ dd.colspan-5),
1594
- & dt:has(+ dd.colspan-full),
1595
- & dd.colspan-4,
1596
- & dd.colspan-5,
1597
- & dd.colspan-full {
1598
- grid-column: span 4;
1599
- }
1600
-
1601
- & dt:has(+ dd.colspan-3),
1602
- & dd.colspan-3 {
1603
- grid-column: span 3;
1604
- }
1605
-
1606
- & dt:has(+ dd.colspan-2),
1607
- & dd.colspan-2 {
1608
- grid-column: span 2;
1609
- }
1610
- }
1611
- }
1612
- }
1613
-
1614
- // max 3 columns
1615
- @container semanticForm (width >= 850px) and (width < 1030px) {
1616
- & fieldset dl,
1617
- & fieldset.colspan-4 dl,
1618
- & fieldset.colspan-5 dl,
1619
- & dl,
1620
- & dl.colspan-4,
1621
- & dl.colspan-5 {
1622
- grid-template-columns: repeat(3, minmax(var(--semanticFormsInputMinWidth), 1fr));
1623
-
1624
- div.colspan-4,
1625
- div.colspan-5 {
1626
- grid-column: span 3;
1627
- }
1628
-
1629
- &:has(:not(div)) {
1630
- & dt:nth-of-type(3n + 1),
1631
- & dd:nth-of-type(3n + 1) {
1632
- grid-column: 1;
1633
- }
1634
-
1635
- & dt:nth-of-type(3n + 2),
1636
- & dd:nth-of-type(3n + 2) {
1637
- grid-column: 2;
1638
- }
1639
-
1640
- & dt:nth-of-type(3n + 3),
1641
- & dd:nth-of-type(3n + 3) {
1642
- grid-column: 3;
1643
- }
1644
-
1645
- & dt:has(+ dd.colspan-3),
1646
- & dt:has(+ dd.colspan-4),
1647
- & dt:has(+ dd.colspan-5),
1648
- & dt:has(+ dd.colspan-full),
1649
- & dd.colspan-3,
1650
- & dd.colspan-4,
1651
- & dd.colspan-5,
1652
- & dd.colspan-full {
1653
- grid-column: span 3;
1654
- }
1655
-
1656
- & dt:has(+ dd.colspan-2),
1657
- & dd.colspan-2 {
1658
- grid-column: span 2;
1659
- }
1660
- }
1661
- }
1662
- }
1663
-
1664
- // max 2 columns
1665
- @container semanticForm (width >= 510px) and (width < 850px) {
1666
- & fieldset dl,
1667
- & fieldset.colspan-3 dl,
1668
- & fieldset.colspan-4 dl,
1669
- & fieldset.colspan-5 dl,
1670
- & dl,
1671
- & dl.colspan-3,
1672
- & dl.colspan-4,
1673
- & dl.colspan-5 {
1674
- grid-template-columns: repeat(2, minmax(var(--semanticFormsInputMinWidth), 1fr));
1675
-
1676
- div.colspan-3,
1677
- div.colspan-4,
1678
- div.colspan-5 {
1679
- grid-column: span 2;
1680
- }
1681
-
1682
- &:has(:not(div)) {
1683
- & dt:nth-of-type(2n + 1),
1684
- & dd:nth-of-type(2n + 1) {
1685
- grid-column: 1;
1686
- }
1687
-
1688
- & dt:nth-of-type(2n + 2),
1689
- & dd:nth-of-type(2n + 2) {
1690
- grid-column: 2;
1691
- }
1692
-
1693
- & dt:has(+ dd.colspan-2),
1694
- & dt:has(+ dd.colspan-3),
1695
- & dt:has(+ dd.colspan-4),
1696
- & dt:has(+ dd.colspan-5),
1697
- & dt:has(+ dd.colspan-full),
1698
- & dd.colspan-2,
1699
- & dd.colspan-3,
1700
- & dd.colspan-4,
1701
- & dd.colspan-5,
1702
- & dd.colspan-full {
1703
- grid-column: span 2;
1704
- }
1705
- }
1706
- }
1707
- }
1708
-
1709
- // max 1 column
1710
- @container semanticForm (width < 510px) {
1711
- & fieldset dl,
1712
- & fieldset.colspan-2 dl,
1713
- & fieldset.colspan-3 dl,
1714
- & fieldset.colspan-4 dl,
1715
- & fieldset.colspan-5 dl,
1716
- & dl,
1717
- & dl.colspan-2,
1718
- & dl.colspan-3,
1719
- & dl.colspan-4,
1720
- & dl.colspan-5 {
1721
- grid-template-columns: repeat(1, minmax(var(--semanticFormsInputMinWidth), 1fr));
1722
-
1723
- div.colspan-2,
1724
- div.colspan-3,
1725
- div.colspan-4,
1726
- div.colspan-5 {
1727
- grid-column: span 1;
1728
- }
1729
-
1730
- &:has(:not(div)) {
1731
- & dt:nth-of-type(n + 1),
1732
- & dd:nth-of-type(n + 1) {
1733
- grid-column: 1;
1734
- }
1735
-
1736
- & dt:has(+ dd.colspan-1),
1737
- & dt:has(+ dd.colspan-2),
1738
- & dt:has(+ dd.colspan-3),
1739
- & dt:has(+ dd.colspan-4),
1740
- & dt:has(+ dd.colspan-5),
1741
- & dt:has(+ dd.colspan-full),
1742
- & dd.colspan-1,
1743
- & dd.colspan-2,
1744
- & dd.colspan-3,
1745
- & dd.colspan-4,
1746
- & dd.colspan-5,
1747
- & dd.colspan-full {
1748
- grid-column: span 1;
1749
- }
1750
- }
1751
- }
1752
- }
1753
- }
1754
- // #endregion