semantic-forms 2.1.2 → 3.0.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/README.md CHANGED
@@ -58,6 +58,8 @@ The float label input pattern is notoriously difficult to implement in a fashion
58
58
 
59
59
  If you would like to manipulate the size of the area on the input field reserved for the click event of the clear field, apply one or both of the following `data-` attributes to your form.
60
60
 
61
+ If you want to double the width of the input field (on screens with the extra space), add a `x2` class to the `dd` element.
62
+
61
63
  Adjust the horizontal offset of the clear field's click event click area (the default is 21):
62
64
 
63
65
  ```html
@@ -66,7 +68,7 @@ Adjust the horizontal offset of the clear field's click event click area (the de
66
68
  </form>
67
69
  ```
68
70
 
69
- Adjust the vertical offset of the clear field"s click event click area (the default is 5):
71
+ Adjust the vertical offset of the clear field's click event click area (the default is 5):
70
72
 
71
73
  ```html
72
74
  <form class="semanticForms" data-clearfield-vertical-offset="5">
@@ -146,7 +148,7 @@ Checkboxes and radio buttons need to follow the following markup structure:
146
148
 
147
149
  - Custom-styled select boxes with a custom drawn arrow graphic driven by SVG embedded in the CSS.
148
150
  - Custom-styled submit buttons to match the aesthetic of the custom-styled forms.
149
- - Responsive: on wide screens, the forms split into two columns. On smaller screens, they collapse to a single column.
151
+ - Responsive: on wide screens, the forms split into multiple columns. On smaller screens, they collapse to a single column.
150
152
  - Low-flow mode that displays on old browsers, JS-disabled browsers, or can be activated manually by adding the `lowFlow` class to your `<form>` element. The low-flow mode reverts the float label pattern to traditional labels and collapses the forms to single column mode, but preserves the other visual design enhancements driven purely by CSS.
151
153
 
152
154
  See `semanticForms.html` or the [live demo](https://kethinov.github.io/semanticforms/semanticForms.html) for more examples.
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "semantic-forms",
3
3
  "description": "Semantic Forms",
4
4
  "author": "Eric Newport <kethinov@gmail.com>",
5
- "version": "2.1.2",
5
+ "version": "3.0.1",
6
6
  "files": [
7
7
  "semanticForms.css",
8
8
  "semanticForms.js",
package/semanticForms.css CHANGED
@@ -1,12 +1,5 @@
1
1
  .semanticForms {
2
2
  font-family: sans-serif;
3
- /*
4
- TODO: still needed?
5
- input:not([type='submit']):not([type='reset']):not([type='image']):not([type=checkbox]):not([type=radio]) {
6
- width: 270px;
7
- padding-right: 0;
8
- }
9
- */
10
3
  }
11
4
  .semanticForms input:not([type='submit']):not([type='reset']):not([type='image']):not([type=checkbox]):not([type=radio]):not([type=color]),
12
5
  .semanticForms select,
@@ -167,7 +160,6 @@
167
160
  }
168
161
  .semanticForms .floatLabelForm {
169
162
  margin: 0 auto;
170
- width: 292px;
171
163
  }
172
164
  .semanticForms .floatLabelForm input[disabled] {
173
165
  opacity: 0.5;
@@ -180,9 +172,6 @@
180
172
  float: left;
181
173
  margin: 0 10px 0 10px;
182
174
  }
183
- .semanticForms .floatLabelForm dd:nth-child(4n+2) {
184
- clear: both;
185
- }
186
175
  .semanticForms .floatLabelForm dt:not(.checkboxes):not(.radios) {
187
176
  font-size: 1px;
188
177
  text-indent: 100%;
@@ -198,7 +187,7 @@
198
187
  .semanticForms .floatLabelForm .checkboxes ul,
199
188
  .semanticForms .floatLabelForm .radios ul {
200
189
  margin: 3px 20px 0 0;
201
- width: 267px;
190
+ width: 262px;
202
191
  padding-left: 10px;
203
192
  }
204
193
  .semanticForms .floatLabelForm label.floatLabelFormAnimatedLabel {
@@ -314,15 +303,13 @@
314
303
  .semanticForms menu button {
315
304
  float: none;
316
305
  clear: none;
317
- margin: 0 0 25px 0;
306
+ margin: 0;
318
307
  }
319
308
  @media (min-width: 700px) {
320
309
  .semanticForms .floatLabelForm {
321
- margin: 0;
310
+ margin: 0 -10px;
322
311
  width: auto;
323
312
  text-align: left;
324
- position: relative;
325
- left: -10px;
326
313
  }
327
314
  .semanticForms fieldset {
328
315
  text-align: left;
@@ -337,6 +324,27 @@
337
324
  .semanticForms fieldset :last-child {
338
325
  margin-right: 0;
339
326
  }
327
+ .semanticForms .x2 input:not([type='submit']):not([type='reset']):not([type='image']):not([type=checkbox]):not([type=radio]):not([type=color]),
328
+ .semanticForms .x2 select,
329
+ .semanticForms .x2 textarea {
330
+ width: 562px;
331
+ }
332
+ .semanticForms .x2 input[type=color] {
333
+ width: 604px;
334
+ }
335
+ .semanticForms .x2 input[type=range] {
336
+ width: 560px !important;
337
+ }
338
+ .semanticForms .x2 select {
339
+ width: 604px;
340
+ }
341
+ .semanticForms .x2.checkboxes ul,
342
+ .semanticForms .x2.radios ul {
343
+ width: 574px;
344
+ }
345
+ .semanticForms .x2 label.floatLabelFormAnimatedLabel {
346
+ width: 375px;
347
+ }
340
348
  }
341
349
  .semanticForms.lowFlow dl {
342
350
  margin: 10px 0 0 0;
package/semanticForms.js CHANGED
@@ -155,7 +155,7 @@ window.semanticForms = function () {
155
155
 
156
156
  function isPatternElement (e) {
157
157
  const thisEl = e.target || e
158
- if (!thisEl.classList.contains('semanticform')) {
158
+ if (!thisEl || !thisEl.classList || !thisEl.classList.contains('semanticform')) {
159
159
  return false
160
160
  }
161
161
  return true
@@ -1,12 +1,5 @@
1
1
  .semanticForms {
2
2
  font-family: sans-serif;
3
- /*
4
- TODO: still needed?
5
- input:not([type='submit']):not([type='reset']):not([type='image']):not([type=checkbox]):not([type=radio]) {
6
- width: 270px;
7
- padding-right: 0;
8
- }
9
- */
10
3
  }
11
4
  .semanticForms input:not([type='submit']):not([type='reset']):not([type='image']):not([type=checkbox]):not([type=radio]):not([type=color]),
12
5
  .semanticForms select,
@@ -167,7 +160,6 @@
167
160
  }
168
161
  .semanticForms .floatLabelForm {
169
162
  margin: 0 auto;
170
- width: 292px;
171
163
  }
172
164
  .semanticForms .floatLabelForm input[disabled] {
173
165
  opacity: 0.5;
@@ -180,9 +172,6 @@
180
172
  float: left;
181
173
  margin: 0 10px 0 10px;
182
174
  }
183
- .semanticForms .floatLabelForm dd:nth-child(4n+2) {
184
- clear: both;
185
- }
186
175
  .semanticForms .floatLabelForm dt:not(.checkboxes):not(.radios) {
187
176
  font-size: 1px;
188
177
  text-indent: 100%;
@@ -198,7 +187,7 @@
198
187
  .semanticForms .floatLabelForm .checkboxes ul,
199
188
  .semanticForms .floatLabelForm .radios ul {
200
189
  margin: 3px 20px 0 0;
201
- width: 267px;
190
+ width: 262px;
202
191
  padding-left: 10px;
203
192
  }
204
193
  .semanticForms .floatLabelForm label.floatLabelFormAnimatedLabel {
@@ -314,15 +303,13 @@
314
303
  .semanticForms menu button {
315
304
  float: none;
316
305
  clear: none;
317
- margin: 0 0 25px 0;
306
+ margin: 0;
318
307
  }
319
308
  @media (min-width: 700px) {
320
309
  .semanticForms .floatLabelForm {
321
- margin: 0;
310
+ margin: 0 -10px;
322
311
  width: auto;
323
312
  text-align: left;
324
- position: relative;
325
- left: -10px;
326
313
  }
327
314
  .semanticForms fieldset {
328
315
  text-align: left;
@@ -337,6 +324,27 @@
337
324
  .semanticForms fieldset :last-child {
338
325
  margin-right: 0;
339
326
  }
327
+ .semanticForms .x2 input:not([type='submit']):not([type='reset']):not([type='image']):not([type=checkbox]):not([type=radio]):not([type=color]),
328
+ .semanticForms .x2 select,
329
+ .semanticForms .x2 textarea {
330
+ width: 562px;
331
+ }
332
+ .semanticForms .x2 input[type=color] {
333
+ width: 604px;
334
+ }
335
+ .semanticForms .x2 input[type=range] {
336
+ width: 560px !important;
337
+ }
338
+ .semanticForms .x2 select {
339
+ width: 604px;
340
+ }
341
+ .semanticForms .x2.checkboxes ul,
342
+ .semanticForms .x2.radios ul {
343
+ width: 574px;
344
+ }
345
+ .semanticForms .x2 label.floatLabelFormAnimatedLabel {
346
+ width: 375px;
347
+ }
340
348
  }
341
349
  .semanticForms.lowFlow dl {
342
350
  margin: 10px 0 0 0;
@@ -69,7 +69,6 @@
69
69
  margin: 0;
70
70
  }
71
71
 
72
-
73
72
  // clear fields
74
73
  input:not([type='submit']):not([type='reset']):not([type=checkbox]):not([type=radio]),
75
74
  textarea {
@@ -83,14 +82,6 @@
83
82
  background-position: right -12px center;
84
83
  }
85
84
 
86
- /*
87
- TODO: still needed?
88
- input:not([type='submit']):not([type='reset']):not([type='image']):not([type=checkbox]):not([type=radio]) {
89
- width: 270px;
90
- padding-right: 0;
91
- }
92
- */
93
-
94
85
  textarea {
95
86
  background-position: right -12px top 10px;
96
87
  height: 100px;
@@ -184,7 +175,6 @@
184
175
  background-image: linear-gradient(to bottom, @borderColor 0%, @formBackgroundColor 100%);
185
176
  }
186
177
 
187
-
188
178
  // custom select box design
189
179
  select {
190
180
  background-image: none;
@@ -199,7 +189,6 @@
199
189
  appearance: none;
200
190
  }
201
191
 
202
-
203
192
  // float label forms
204
193
  label.floatLabelFormAnimatedLabel, input:not([type=checkbox]):not([type=radio]), select, textarea, section {
205
194
  transition: all 0.2s;
@@ -208,7 +197,6 @@
208
197
 
209
198
  .floatLabelForm {
210
199
  margin: 0 auto;
211
- width: 292px;
212
200
 
213
201
  input[disabled] {
214
202
  opacity: 0.5;
@@ -225,10 +213,6 @@
225
213
  margin: 0 10px 0 10px;
226
214
  }
227
215
 
228
- dd:nth-child(4n+2) {
229
- clear: both;
230
- }
231
-
232
216
  dt:not(.checkboxes):not(.radios) {
233
217
  font-size: 1px;
234
218
  text-indent: 100%;
@@ -246,7 +230,7 @@
246
230
  .checkboxes ul,
247
231
  .radios ul {
248
232
  margin: 3px 20px 0 0;
249
- width: 267px;
233
+ width: 262px;
250
234
  padding-left: 10px;
251
235
  }
252
236
 
@@ -388,19 +372,16 @@
388
372
  button {
389
373
  float: none;
390
374
  clear: none;
391
- margin: 0 0 25px 0;
375
+ margin: 0;
392
376
  }
393
377
  }
394
378
 
395
-
396
379
  // side-by-side pattern on large screens
397
380
  @media (min-width: 700px) {
398
381
  .floatLabelForm {
399
- margin: 0;
382
+ margin: 0 -10px;
400
383
  width: auto;
401
384
  text-align: left;
402
- position: relative;
403
- left: -10px;
404
385
  }
405
386
 
406
387
  fieldset {
@@ -418,6 +399,43 @@
418
399
  margin-right: 0;
419
400
  }
420
401
  }
402
+
403
+ .x2 {
404
+ input:not([type='submit']):not([type='reset']):not([type='image']):not([type=checkbox]):not([type=radio]):not([type=color]),
405
+ select,
406
+ textarea {
407
+ width: 562px;
408
+ }
409
+ }
410
+
411
+ .x2 {
412
+ input[type=color] {
413
+ width: 604px;
414
+ }
415
+ }
416
+
417
+ .x2 {
418
+ input[type=range] {
419
+ width: 560px !important;
420
+ }
421
+ }
422
+
423
+ .x2 {
424
+ select {
425
+ width: 604px;
426
+ }
427
+ }
428
+
429
+ .x2.checkboxes ul,
430
+ .x2.radios ul {
431
+ width: 574px;
432
+ }
433
+
434
+ .x2 {
435
+ label.floatLabelFormAnimatedLabel {
436
+ width: 375px;
437
+ }
438
+ }
421
439
  }
422
440
  }
423
441