semantic-forms 4.0.1 → 4.0.3
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/package.json +6 -6
- package/semanticForms.css +38 -21
- package/semanticForms.js +1 -0
- package/semanticForms.scss +41 -26
package/package.json
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
"url": "https://github.com/rooseveltframework/semantic-forms/graphs/contributors"
|
|
9
9
|
}
|
|
10
10
|
],
|
|
11
|
-
"version": "4.0.
|
|
11
|
+
"version": "4.0.3",
|
|
12
12
|
"files": [
|
|
13
13
|
"semanticForms.css",
|
|
14
14
|
"semanticForms.js",
|
|
@@ -19,11 +19,11 @@
|
|
|
19
19
|
"main": "semanticForms.js",
|
|
20
20
|
"readmeFilename": "README.md",
|
|
21
21
|
"devDependencies": {
|
|
22
|
-
"eslint": "9.
|
|
23
|
-
"eslint-plugin-html": "8.1.
|
|
24
|
-
"nodemon": "3.1.
|
|
25
|
-
"sass": "1.
|
|
26
|
-
"serve": "14.2.
|
|
22
|
+
"eslint": "9.17.0",
|
|
23
|
+
"eslint-plugin-html": "8.1.2",
|
|
24
|
+
"nodemon": "3.1.9",
|
|
25
|
+
"sass": "1.83.1",
|
|
26
|
+
"serve": "14.2.4",
|
|
27
27
|
"standard": "17.1.2"
|
|
28
28
|
},
|
|
29
29
|
"scripts": {
|
package/semanticForms.css
CHANGED
|
@@ -57,10 +57,21 @@ form.semanticForms {
|
|
|
57
57
|
flex-direction: column;
|
|
58
58
|
gap: 10px;
|
|
59
59
|
}
|
|
60
|
-
form.semanticForms
|
|
60
|
+
form.semanticForms fieldset,
|
|
61
|
+
form.semanticForms label,
|
|
62
|
+
form.semanticForms input,
|
|
63
|
+
form.semanticForms select,
|
|
64
|
+
form.semanticForms textarea,
|
|
65
|
+
form.semanticForms button,
|
|
66
|
+
form.semanticForms menu:has(li > input, li > label, li > button, li > select, li > textarea),
|
|
67
|
+
form.semanticForms dl:has(dt > label, dd > input, dd > select, dd > textarea),
|
|
68
|
+
form.semanticForms dt:has(> input, > select, > textarea),
|
|
69
|
+
form.semanticForms dd:has(> input, > select, > textarea, > ul, > menu),
|
|
70
|
+
form.semanticForms div:has(dt, dd),
|
|
71
|
+
form.semanticForms dd > p {
|
|
61
72
|
color: var(--formTextColor);
|
|
62
|
-
box-sizing: border-box;
|
|
63
73
|
font-family: sans-serif;
|
|
74
|
+
box-sizing: border-box;
|
|
64
75
|
margin: 0;
|
|
65
76
|
padding: 0;
|
|
66
77
|
}
|
|
@@ -83,54 +94,55 @@ form.semanticForms fieldset > fieldset select,
|
|
|
83
94
|
form.semanticForms fieldset > fieldset textarea {
|
|
84
95
|
background: var(--nestedInput);
|
|
85
96
|
}
|
|
86
|
-
form.semanticForms dl {
|
|
97
|
+
form.semanticForms dl:has(dt > label, dd > input, dd > select, dd > textarea) {
|
|
87
98
|
display: grid;
|
|
88
99
|
grid-template-columns: repeat(2, minmax(var(--inputMinWidth), 1fr));
|
|
89
100
|
gap: 10px;
|
|
90
101
|
margin-bottom: 10px;
|
|
91
102
|
}
|
|
92
|
-
form.semanticForms dl dd {
|
|
103
|
+
form.semanticForms dl:has(dt > label, dd > input, dd > select, dd > textarea) dd {
|
|
93
104
|
position: relative;
|
|
94
105
|
}
|
|
95
|
-
form.semanticForms dl dd:not(.checkboxes, .radios) {
|
|
96
|
-
display: flex;
|
|
106
|
+
form.semanticForms dl:has(dt > label, dd > input, dd > select, dd > textarea) dd:not(.checkboxes, .radios) {
|
|
97
107
|
gap: 10px;
|
|
98
108
|
max-width: 100%;
|
|
99
109
|
}
|
|
100
|
-
form.semanticForms dl dd:not(.checkboxes, .radios):not(.singleCheckbox) {
|
|
110
|
+
form.semanticForms dl:has(dt > label, dd > input, dd > select, dd > textarea) dd:not(.checkboxes, .radios):not(.singleCheckbox) {
|
|
111
|
+
display: flex;
|
|
101
112
|
flex-direction: column;
|
|
102
113
|
}
|
|
103
|
-
form.semanticForms dl dd
|
|
114
|
+
form.semanticForms dl:has(dt > label, dd > input, dd > select, dd > textarea) dd:not(.checkboxes, .radios).singleCheckbox {
|
|
115
|
+
display: flex;
|
|
116
|
+
align-items: center;
|
|
117
|
+
}
|
|
118
|
+
form.semanticForms dl:has(dt > label, dd > input, dd > select, dd > textarea) dd:not(.checkboxes, .radios).singleCheckbox > :not(input[type=checkbox], label) {
|
|
119
|
+
grid-column: 1/-1;
|
|
120
|
+
}
|
|
121
|
+
form.semanticForms dl:has(dt > label, dd > input, dd > select, dd > textarea) dd.checkboxes ul, form.semanticForms dl:has(dt > label, dd > input, dd > select, dd > textarea) dd.radios ul {
|
|
104
122
|
display: flex;
|
|
105
123
|
flex-direction: column;
|
|
106
124
|
margin-top: var(--inputTopMargin);
|
|
107
125
|
padding-left: 10px;
|
|
108
126
|
gap: 5px;
|
|
109
127
|
}
|
|
110
|
-
form.semanticForms dl dd.checkboxes ul li, form.semanticForms dl dd.radios ul li {
|
|
128
|
+
form.semanticForms dl:has(dt > label, dd > input, dd > select, dd > textarea) dd.checkboxes ul li, form.semanticForms dl:has(dt > label, dd > input, dd > select, dd > textarea) dd.radios ul li {
|
|
111
129
|
display: flex;
|
|
112
130
|
align-items: center;
|
|
113
131
|
gap: 5px;
|
|
114
132
|
}
|
|
115
|
-
form.semanticForms dl dd.checkboxes ul li label, form.semanticForms dl dd.radios ul li label {
|
|
116
|
-
font-size: var(--inputFontSize);
|
|
117
|
-
margin-top: 2px;
|
|
118
|
-
}
|
|
119
|
-
form.semanticForms p input, form.semanticForms p select, form.semanticForms p textarea {
|
|
120
|
-
max-width: 350px;
|
|
121
|
-
}
|
|
122
133
|
form.semanticForms p:has(input:not([type=checkbox], [type=radio]), textarea, label) {
|
|
123
134
|
display: flex;
|
|
124
135
|
flex-direction: column;
|
|
125
136
|
gap: 5px;
|
|
126
137
|
}
|
|
127
|
-
form.semanticForms p:has(input[type=checkbox], input[type=radio]
|
|
138
|
+
form.semanticForms p:has(input[type=checkbox], input[type=radio]) {
|
|
128
139
|
display: flex;
|
|
129
140
|
flex-direction: row;
|
|
130
141
|
align-items: center;
|
|
131
142
|
gap: 5px;
|
|
132
143
|
}
|
|
133
|
-
form.semanticForms menu
|
|
144
|
+
form.semanticForms menu:has(li > input),
|
|
145
|
+
form.semanticForms ul:has(li > input) {
|
|
134
146
|
display: flex;
|
|
135
147
|
justify-content: space-between;
|
|
136
148
|
flex-wrap: wrap;
|
|
@@ -194,6 +206,7 @@ form.semanticForms input[type=checkbox],
|
|
|
194
206
|
form.semanticForms input[type=radio] {
|
|
195
207
|
width: 1.4em;
|
|
196
208
|
height: 1.4em;
|
|
209
|
+
margin: auto 0;
|
|
197
210
|
cursor: pointer;
|
|
198
211
|
}
|
|
199
212
|
form.semanticForms input[type=checkbox] ~ label:first-of-type,
|
|
@@ -281,8 +294,10 @@ form.semanticForms input[type=image]:hover,
|
|
|
281
294
|
form.semanticForms button:not(.clear):hover {
|
|
282
295
|
filter: brightness(1.05);
|
|
283
296
|
}
|
|
284
|
-
form.semanticForms
|
|
285
|
-
|
|
297
|
+
form.semanticForms input[type=checkbox] + label:first-of-type,
|
|
298
|
+
form.semanticForms input[type=radio] + label:first-of-type {
|
|
299
|
+
padding-top: 2px;
|
|
300
|
+
font-size: var(--inputFontSize);
|
|
286
301
|
}
|
|
287
302
|
form.semanticForms .floatLabelForm div {
|
|
288
303
|
position: relative;
|
|
@@ -381,8 +396,10 @@ form.semanticForms .floatLabelForm div dt label {
|
|
|
381
396
|
user-select: auto;
|
|
382
397
|
color: var(--formTextColor);
|
|
383
398
|
position: absolute;
|
|
384
|
-
transform:
|
|
399
|
+
transform-origin: left center;
|
|
400
|
+
transform: translateY(-100%) scale(0.7);
|
|
385
401
|
top: var(--inputTopMargin);
|
|
402
|
+
left: 10px;
|
|
386
403
|
}
|
|
387
404
|
form.semanticForms .floatLabelForm div:has(dd input:required) dt label > span {
|
|
388
405
|
margin-left: 5px;
|
package/semanticForms.js
CHANGED
package/semanticForms.scss
CHANGED
|
@@ -61,10 +61,21 @@ form.semanticForms {
|
|
|
61
61
|
gap: 10px;
|
|
62
62
|
|
|
63
63
|
// style reset
|
|
64
|
-
|
|
64
|
+
fieldset,
|
|
65
|
+
label,
|
|
66
|
+
input,
|
|
67
|
+
select,
|
|
68
|
+
textarea,
|
|
69
|
+
button,
|
|
70
|
+
menu:has(li > input, li > label, li > button, li > select, li > textarea),
|
|
71
|
+
dl:has(dt > label, dd > input, dd > select, dd > textarea),
|
|
72
|
+
dt:has(> input, > select, > textarea),
|
|
73
|
+
dd:has(> input, > select, > textarea, > ul, > menu),
|
|
74
|
+
div:has(dt, dd),
|
|
75
|
+
dd > p {
|
|
65
76
|
color: var(--formTextColor);
|
|
66
|
-
box-sizing: border-box;
|
|
67
77
|
font-family: sans-serif;
|
|
78
|
+
box-sizing: border-box;
|
|
68
79
|
margin: 0;
|
|
69
80
|
padding: 0;
|
|
70
81
|
}
|
|
@@ -92,10 +103,9 @@ form.semanticForms {
|
|
|
92
103
|
background: var(--nestedInput);
|
|
93
104
|
}
|
|
94
105
|
}
|
|
95
|
-
|
|
96
106
|
}
|
|
97
107
|
|
|
98
|
-
dl {
|
|
108
|
+
dl:has(dt > label, dd > input, dd > select, dd > textarea) {
|
|
99
109
|
display: grid;
|
|
100
110
|
grid-template-columns: repeat(2, minmax(var(--inputMinWidth), 1fr));
|
|
101
111
|
gap: 10px;
|
|
@@ -105,14 +115,23 @@ form.semanticForms {
|
|
|
105
115
|
position: relative;
|
|
106
116
|
|
|
107
117
|
&:not(.checkboxes, .radios) {
|
|
108
|
-
display: flex;
|
|
109
118
|
gap: 10px;
|
|
110
119
|
max-width: 100%;
|
|
111
120
|
|
|
112
121
|
// places all items within the <dd> horizontally
|
|
113
122
|
&:not(.singleCheckbox) {
|
|
123
|
+
display: flex;
|
|
114
124
|
flex-direction: column;
|
|
115
125
|
}
|
|
126
|
+
|
|
127
|
+
&.singleCheckbox {
|
|
128
|
+
display: flex;
|
|
129
|
+
align-items: center;
|
|
130
|
+
|
|
131
|
+
& > :not(input[type='checkbox'], label) {
|
|
132
|
+
grid-column: 1 / -1;
|
|
133
|
+
}
|
|
134
|
+
}
|
|
116
135
|
}
|
|
117
136
|
|
|
118
137
|
&.checkboxes ul, &.radios ul {
|
|
@@ -126,22 +145,12 @@ form.semanticForms {
|
|
|
126
145
|
display: flex;
|
|
127
146
|
align-items: center;
|
|
128
147
|
gap: 5px;
|
|
129
|
-
|
|
130
|
-
label {
|
|
131
|
-
// shift text down to match center
|
|
132
|
-
font-size: var(--inputFontSize);
|
|
133
|
-
margin-top: 2px;
|
|
134
|
-
}
|
|
135
148
|
}
|
|
136
149
|
}
|
|
137
150
|
}
|
|
138
151
|
}
|
|
139
152
|
|
|
140
153
|
p {
|
|
141
|
-
input, select, textarea {
|
|
142
|
-
max-width: 350px;
|
|
143
|
-
}
|
|
144
|
-
|
|
145
154
|
// input/label combo
|
|
146
155
|
&:has(input:not([type='checkbox'], [type='radio']), textarea, label) {
|
|
147
156
|
display: flex;
|
|
@@ -150,7 +159,7 @@ form.semanticForms {
|
|
|
150
159
|
}
|
|
151
160
|
|
|
152
161
|
// checkbox or radio/label combo
|
|
153
|
-
&:has(input[type='checkbox'], input[type='radio']
|
|
162
|
+
&:has(input[type='checkbox'], input[type='radio']) {
|
|
154
163
|
display: flex;
|
|
155
164
|
flex-direction: row;
|
|
156
165
|
align-items: center;
|
|
@@ -158,7 +167,8 @@ form.semanticForms {
|
|
|
158
167
|
}
|
|
159
168
|
}
|
|
160
169
|
|
|
161
|
-
menu
|
|
170
|
+
menu:has(li > input),
|
|
171
|
+
ul:has(li > input) {
|
|
162
172
|
display: flex;
|
|
163
173
|
justify-content: space-between;
|
|
164
174
|
flex-wrap: wrap;
|
|
@@ -233,6 +243,7 @@ form.semanticForms {
|
|
|
233
243
|
// 30% larger based on parent font size
|
|
234
244
|
width: 1.4em;
|
|
235
245
|
height: 1.4em;
|
|
246
|
+
margin: auto 0;
|
|
236
247
|
cursor: pointer;
|
|
237
248
|
|
|
238
249
|
& ~ label:first-of-type {
|
|
@@ -334,13 +345,15 @@ form.semanticForms {
|
|
|
334
345
|
// #endregion
|
|
335
346
|
|
|
336
347
|
// #region labels
|
|
337
|
-
.floatLabelForm {
|
|
338
|
-
&:not(:has(div:nth-of-type(2))) {
|
|
339
|
-
dd:not(.checkboxes, .radios):not(:has(textarea)) {
|
|
340
|
-
max-width: 350px;
|
|
341
|
-
}
|
|
342
|
-
}
|
|
343
348
|
|
|
349
|
+
input[type=checkbox] + label:first-of-type,
|
|
350
|
+
input[type=radio] + label:first-of-type {
|
|
351
|
+
// shift text down to match center
|
|
352
|
+
padding-top: 2px;
|
|
353
|
+
font-size: var(--inputFontSize);
|
|
354
|
+
}
|
|
355
|
+
|
|
356
|
+
.floatLabelForm {
|
|
344
357
|
div {
|
|
345
358
|
position: relative;
|
|
346
359
|
width: 100%;
|
|
@@ -456,8 +469,10 @@ form.semanticForms {
|
|
|
456
469
|
user-select: auto;
|
|
457
470
|
color: var(--formTextColor);
|
|
458
471
|
position: absolute;
|
|
459
|
-
transform:
|
|
472
|
+
transform-origin: left center;
|
|
473
|
+
transform: translateY(-100%) scale(0.7);
|
|
460
474
|
top: var(--inputTopMargin);
|
|
475
|
+
left: 10px;
|
|
461
476
|
}
|
|
462
477
|
}
|
|
463
478
|
|
|
@@ -746,13 +761,13 @@ form.semanticForms {
|
|
|
746
761
|
|
|
747
762
|
// nudge single checkboxes to match checkbox groups
|
|
748
763
|
&:not(.checkboxes) {
|
|
749
|
-
input[type=
|
|
764
|
+
input[type=checkbox] {
|
|
750
765
|
margin-left: 10px;
|
|
751
766
|
}
|
|
752
767
|
}
|
|
753
768
|
|
|
754
769
|
// remove "x" padding
|
|
755
|
-
input:not([type=
|
|
770
|
+
input:not([type=submit], [type=reset], [type=image], [type=checkbox], [type=radio], [type=range]),
|
|
756
771
|
select,
|
|
757
772
|
textarea {
|
|
758
773
|
padding-right: 6px;
|