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.
- package/CHANGELOG.md +14 -0
- package/dist/semantic-forms.cjs +8 -8
- package/dist/semantic-forms.cjs.map +1 -1
- package/dist/semantic-forms.css +167 -144
- package/dist/semantic-forms.css.map +1 -1
- package/dist/semantic-forms.js +8 -8
- package/dist/semantic-forms.js.map +1 -1
- package/dist/semantic-forms.min.js +1 -1
- package/dist/semantic-forms.min.js.map +1 -1
- package/dist/semantic-forms.min.mjs +1 -1
- package/dist/semantic-forms.min.mjs.map +1 -1
- package/dist/semantic-forms.mjs +6 -6
- package/dist/semantic-forms.mjs.map +1 -1
- package/docs/statics/pages/usage.html +29 -12
- package/package.json +6 -5
- package/semanticForms.scss +223 -149
package/semanticForms.scss
CHANGED
|
@@ -1,50 +1,49 @@
|
|
|
1
1
|
// #region global styles
|
|
2
2
|
form.semanticForms, form.semanticForms.light {
|
|
3
|
-
--
|
|
4
|
-
--
|
|
5
|
-
--
|
|
6
|
-
--
|
|
7
|
-
--
|
|
8
|
-
--
|
|
9
|
-
--
|
|
10
|
-
--
|
|
11
|
-
--
|
|
12
|
-
--
|
|
13
|
-
--
|
|
14
|
-
--
|
|
15
|
-
--
|
|
16
|
-
--
|
|
17
|
-
--
|
|
18
|
-
--
|
|
19
|
-
--
|
|
20
|
-
--
|
|
21
|
-
--
|
|
22
|
-
--
|
|
23
|
-
--
|
|
24
|
-
--
|
|
25
|
-
--
|
|
26
|
-
--
|
|
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
|
-
--
|
|
30
|
+
--semanticFormsFormBgColor: #555;
|
|
31
31
|
--inputBackgroudColor: rgba(85,85,85,0.1);
|
|
32
|
-
--
|
|
33
|
-
--
|
|
34
|
-
--
|
|
35
|
-
--
|
|
36
|
-
--
|
|
37
|
-
--
|
|
38
|
-
--
|
|
39
|
-
--
|
|
40
|
-
--
|
|
41
|
-
--
|
|
42
|
-
--
|
|
43
|
-
--
|
|
44
|
-
--
|
|
45
|
-
--
|
|
46
|
-
--
|
|
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(--
|
|
95
|
-
font-family:
|
|
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(--
|
|
106
|
-
background: var(--
|
|
107
|
-
border: var(--
|
|
108
|
-
border-radius: var(--
|
|
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(--
|
|
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(--
|
|
148
|
+
height: var(--semanticFormsInputHeight);
|
|
149
149
|
}
|
|
150
150
|
|
|
151
151
|
// specific styling for color input
|
|
152
152
|
input[type=color] {
|
|
153
|
-
height: var(--
|
|
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(--
|
|
167
|
+
color: var(--semanticFormsTextColor) !important;
|
|
168
168
|
}
|
|
169
169
|
}
|
|
170
170
|
|
|
171
171
|
input[type=file] {
|
|
172
172
|
cursor: pointer;
|
|
173
|
-
font-size: var(--
|
|
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(--
|
|
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(--
|
|
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(--
|
|
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(--
|
|
250
|
-
|
|
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(--
|
|
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(--
|
|
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(--
|
|
285
|
+
border: var(--semanticFormsInvalidBorder) !important;
|
|
285
286
|
|
|
286
287
|
~ label:nth-of-type(2) {
|
|
287
|
-
color: var(--
|
|
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(--
|
|
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(--
|
|
320
|
-
background: var(--
|
|
321
|
-
border: 1px var(--
|
|
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
|
-
|
|
330
|
-
background-color: var(--
|
|
331
|
-
border: var(--
|
|
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(--
|
|
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(--
|
|
354
|
+
scrollbar-color: var(--semanticFormsScrollbarColor) transparent;
|
|
354
355
|
|
|
355
356
|
&::-webkit-resizer {
|
|
356
357
|
border: none;
|
|
357
|
-
background-image: var(--
|
|
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(--
|
|
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(--
|
|
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(--
|
|
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:
|
|
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(--
|
|
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(--
|
|
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(--
|
|
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(--
|
|
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(--
|
|
520
|
+
color: var(--semanticFormsTextColor);
|
|
506
521
|
}
|
|
507
522
|
|
|
508
523
|
input,
|
|
509
524
|
textarea,
|
|
510
525
|
select {
|
|
511
|
-
margin-top: var(--
|
|
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(--
|
|
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(--
|
|
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(--
|
|
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(--
|
|
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(--
|
|
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(--
|
|
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(--
|
|
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(--
|
|
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(--
|
|
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(--
|
|
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(--
|
|
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(--
|
|
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(--
|
|
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(--
|
|
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(--
|
|
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(--
|
|
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(--
|
|
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(--
|
|
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(--
|
|
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(--
|
|
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
|
-
|
|
912
|
-
|
|
913
|
-
|
|
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
|
-
|
|
922
|
-
|
|
923
|
-
label::after {
|
|
924
|
-
content: ' *';
|
|
925
|
-
color: red;
|
|
926
|
-
}
|
|
976
|
+
dl {
|
|
977
|
+
grid-auto-flow: dense;
|
|
927
978
|
}
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
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
|
-
//
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
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
|
-
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
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
|
-
}
|