semantic-forms 3.2.0 → 4.0.0

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,638 +0,0 @@
1
- // #region variables
2
-
3
- @lightFormBackgroundColor: #fff;
4
- @lightFormSubBackgroundColor: #f5f5f5;
5
- @lightFormTextColor: #000;
6
- @lightBorderColor: #c0c0c0;
7
- @lightPlaceholderColor: #aaa;
8
- @darkFormBackgroundColor: #555;
9
- @darkFormSubBackgroundColor: #2f2f2f;
10
- @darkFormSubBorderColor: #3f3f3f;
11
- @darkFormTextColor: #fff;
12
- @darkBorderColor: #555;
13
- @darkPlaceholderColor: #aaa;
14
- @darkButtonGradientLight: #6f6f6f;
15
- @darkButtonGradientDark: #373737;
16
-
17
- // #endregion
18
-
19
- // #region default (light mode) styles
20
-
21
- form.semanticForms {
22
-
23
- // #region globals
24
-
25
- font-family: sans-serif;
26
-
27
- input:not([type='submit']):not([type='reset']):not([type='image']):not([type=checkbox]):not([type=radio]):not([type=color]),
28
- select,
29
- textarea {
30
- box-sizing: content-box;
31
- background-color: @lightFormBackgroundColor;
32
- outline: 0;
33
- border: 1px @lightBorderColor solid;
34
- border-radius: 10px;
35
- width: 250px;
36
- height: 25px;
37
- font-size: 100%;
38
- font-family: sans-serif;
39
- padding: 5px 20px;
40
- }
41
-
42
- input[type=color] {
43
- background-color: @lightFormBackgroundColor;
44
- border: 1px @lightBorderColor solid;
45
- border-radius: 10px;
46
- width: 292px;
47
- height: 37px;
48
- padding: 5px 20px;
49
- }
50
-
51
- select {
52
- box-sizing: border-box;
53
- }
54
-
55
- input[type=range] {
56
- border: 0 !important;
57
- width: 248px !important;
58
- }
59
-
60
- fieldset {
61
- background-color: @lightFormSubBackgroundColor;
62
- border: 1px @lightBorderColor solid;
63
- border-radius: 10px;
64
- text-align: center;
65
- margin-bottom: 25px;
66
-
67
- p {
68
- text-align: left;
69
- width: 100%;
70
- clear: both;
71
- }
72
- }
73
-
74
- legend {
75
- text-align: left;
76
- }
77
-
78
- dl {
79
- text-align: left;
80
- }
81
-
82
- .checkboxes ul,
83
- .radios ul {
84
- list-style: none;
85
- padding: 0;
86
- }
87
-
88
- dd.checkboxes,
89
- dd.radios {
90
- margin: 0;
91
- }
92
-
93
- menu {
94
- width: 100%;
95
- clear: both;
96
- display: flex;
97
- justify-content: space-between;
98
- padding: 0;
99
-
100
- li {
101
- list-style-type: none;
102
- }
103
-
104
- input[type='submit'],
105
- input[type='reset'],
106
- input[type='image'],
107
- button {
108
- float: none;
109
- clear: none;
110
- margin: 0;
111
- }
112
- }
113
-
114
- // #endregion
115
-
116
- // #region clear fields and custom select box design
117
-
118
- input:not([type='submit']):not([type='reset']):not([type=checkbox]):not([type=radio]),
119
- textarea {
120
- background-image: url("data:image/svg+xml;utf8,%3Csvg version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' x='0px' y='0px' viewBox='0 0 1000 1000' enable-background='new 0 0 1000 1000' xml:space='preserve'%3E%3Cg%3E%3Cpath fill='%23000' d='M964.7,157.6L622.3,500l342.4,342.4l0,0c15.7,15.7,25.3,37.3,25.3,61.1c0,47.7-38.7,86.5-86.5,86.5c-23.9,0-45.5-9.7-61.1-25.3l0,0L500,622.3L157.6,964.7l0,0C142,980.3,120.3,990,96.5,990C48.7,990,10,951.3,10,903.5c0-23.9,9.7-45.5,25.3-61.1l0,0L377.7,500L35.3,157.6l0,0C19.7,142,10,120.3,10,96.5C10,48.7,48.7,10,96.5,10c23.9,0,45.5,9.7,61.1,25.3l0,0L500,377.7L842.4,35.3l0,0C858,19.7,879.7,10,903.5,10c47.8,0,86.5,38.7,86.5,86.5C990,120.3,980.3,142,964.7,157.6L964.7,157.6z'/%3E%3C/g%3E%3C/svg%3E");
121
- background-size: 12px;
122
- background-repeat: no-repeat;
123
- }
124
-
125
- input:not([type=checkbox]):not([type=radio]) {
126
- background-position: right -12px center;
127
- }
128
-
129
- textarea {
130
- background-position: right -12px top 10px;
131
- height: 100px;
132
- }
133
-
134
- select {
135
- background-image: 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");
136
- background-size: 14px;
137
- background-position: calc(99%) 16px;
138
- background-repeat: no-repeat;
139
- width: 292px;
140
- height: 37px;
141
- -webkit-appearance: none;
142
- -moz-appearance: none;
143
- appearance: none;
144
- }
145
-
146
- // #endregion
147
-
148
- // #region style placeholders
149
-
150
- input::placeholder {
151
- color: @lightPlaceholderColor;
152
- opacity: 1;
153
- }
154
-
155
- textarea::placeholder {
156
- color: @lightPlaceholderColor;
157
- opacity: 1;
158
- }
159
-
160
- input:focus::placeholder {
161
- color: @lightPlaceholderColor;
162
- opacity: 1;
163
- }
164
-
165
- input:focus::-moz-placeholder {
166
- color: @lightPlaceholderColor;
167
- opacity: 1;
168
- }
169
-
170
- input:focus::-webkit-input-placeholder {
171
- color: @lightPlaceholderColor;
172
- opacity: 1;
173
- }
174
-
175
- input:focus:-ms-input-placeholder {
176
- color: @lightPlaceholderColor;
177
- opacity: 1;
178
- }
179
-
180
- textarea:focus::placeholder {
181
- color: @lightPlaceholderColor;
182
- opacity: 1;
183
- }
184
-
185
- textarea:focus::-moz-placeholder {
186
- color: @lightPlaceholderColor;
187
- opacity: 1;
188
- }
189
-
190
- textarea:focus::-webkit-input-placeholder {
191
- color: @lightPlaceholderColor;
192
- opacity: 1;
193
- }
194
-
195
- textarea:focus:-ms-input-placeholder {
196
- color: @lightPlaceholderColor;
197
- opacity: 1;
198
- }
199
-
200
- // #endregion
201
-
202
- // #region buttons
203
-
204
- input[type='submit'],
205
- input[type='reset'],
206
- input[type='image'],
207
- button {
208
- width: auto;
209
- box-sizing: content-box;
210
- float: none;
211
- clear: both;
212
- outline: 0;
213
- -webkit-appearance: none;
214
- -moz-appearance: none;
215
- appearance: none;
216
- border-radius: 20px;
217
- font-size: 100%;
218
- margin: 25px 10px;
219
- padding: 5px 25px;
220
- border: 2px @lightBorderColor solid;
221
- background-image: linear-gradient(to bottom, @lightFormBackgroundColor 0%, @lightBorderColor 100%);
222
- }
223
-
224
- input[type='submit']:first-of-type,
225
- input[type='reset']:first-of-type,
226
- input[type='image']:first-of-type,
227
- button:first-of-type {
228
- margin-left: 0;
229
- }
230
-
231
- input[type='submit']:active,
232
- input[type='reset']:active,
233
- input[type='image']:active,
234
- button:active {
235
- background-image: linear-gradient(to bottom, @lightBorderColor 0%, @lightFormBackgroundColor 100%);
236
- }
237
-
238
- // #endregion
239
-
240
- // #region float label forms
241
-
242
- label.floatLabelFormAnimatedLabel, input:not([type=checkbox]):not([type=radio]), select, textarea, section {
243
- transition: color 0.2s, text-indent 0.2s, transform 0.2s, background-position 0.2s;
244
- touch-action: manipulation;
245
- }
246
-
247
- .floatLabelForm {
248
- margin: 0 auto;
249
-
250
- input[disabled] {
251
- opacity: 0.5;
252
- }
253
-
254
- // remove native clear button, we made a custom one
255
- input:not([type=date])::-webkit-clear-button {
256
- -webkit-appearance: none;
257
- margin: 0;
258
- }
259
-
260
- dd {
261
- float: left;
262
- margin: 0 10px 0 10px;
263
- }
264
-
265
- dt:not(.checkboxes):not(.radios) {
266
- font-size: 1px;
267
- text-indent: 100%;
268
- white-space: nowrap;
269
- overflow: hidden;
270
- position: absolute;
271
- right: 9999px;
272
- }
273
-
274
- dd:not(.checkboxes):not(.radios) {
275
- display: flex;
276
- flex-flow: column-reverse;
277
- }
278
-
279
- .checkboxes ul,
280
- .radios ul {
281
- margin: 3px 20px 0 0;
282
- width: 262px;
283
- padding-left: 10px;
284
- }
285
-
286
- label.floatLabelFormAnimatedLabel {
287
- width: 170px;
288
- padding: 6px 15px;
289
- font-size: 75%;
290
- color: @lightPlaceholderColor;
291
- cursor: text;
292
- white-space: nowrap;
293
- overflow: hidden;
294
- text-overflow: ellipsis;
295
- transform-origin: left bottom;
296
- transform: translate(0, 38px) scale(1.5);
297
- }
298
-
299
- dd:not(.checkboxes):not(.radios).singleCheckbox {
300
- width: 292px;
301
- display: flex;
302
- flex-direction: row-reverse;
303
- align-items: flex-start;
304
- justify-content: left;
305
-
306
- label {
307
- margin-top: 10px;
308
- }
309
-
310
- input {
311
- margin: 10px 10px 0 0;
312
- }
313
- }
314
-
315
- // hide placeholder content until the input is focused
316
- ::placeholder {
317
- opacity: 0;
318
- transition: inherit;
319
- }
320
-
321
- ::-moz-placeholder {
322
- opacity: 0;
323
- transition: inherit;
324
- }
325
-
326
- ::-webkit-input-placeholder {
327
- opacity: 0;
328
- transition: inherit;
329
- }
330
-
331
- :-ms-input-placeholder {
332
- opacity: 0;
333
- transition: inherit;
334
- }
335
-
336
- // show the placeholder when the input is focused
337
- input:focus::placeholder {
338
- opacity: 1;
339
- }
340
-
341
- input:focus::-moz-placeholder {
342
- opacity: 1;
343
- }
344
-
345
- input:focus::-webkit-input-placeholder {
346
- opacity: 1;
347
- }
348
-
349
- input:focus:-ms-input-placeholder {
350
- opacity: 1;
351
- }
352
-
353
- textarea:focus::placeholder {
354
- opacity: 1;
355
- }
356
-
357
- textarea:focus::-moz-placeholder {
358
- opacity: 1;
359
- }
360
-
361
- textarea:focus::-webkit-input-placeholder {
362
- opacity: 1;
363
- }
364
-
365
- textarea:focus:-ms-input-placeholder {
366
- opacity: 1;
367
- }
368
-
369
- // move the label off of input to make room for input content
370
- input:not(:placeholder-shown) + label,
371
- input:focus + label,
372
- textarea:not(:placeholder-shown) + label,
373
- textarea:focus + label,
374
- select + label.floatLabelFormAnimatedLabel,
375
- .checkboxes label.floatLabelFormAnimatedLabel,
376
- .radios label.floatLabelFormAnimatedLabel {
377
- transform: translate(0, 0) scale(1);
378
- text-indent: 6px;
379
- cursor: default;
380
- color: @lightFormTextColor;
381
- }
382
-
383
- input.x {
384
- background-position: right 6px center;
385
- }
386
-
387
- textarea.x {
388
- background-position: right 6px top 10px;
389
- }
390
-
391
- .onX {
392
- cursor: pointer;
393
- }
394
-
395
- // disable autofill yellow
396
- input:-webkit-autofill,
397
- input:-webkit-autofill:hover,
398
- input:-webkit-autofill:focus,
399
- input:-webkit-autofill:active,
400
- textarea:-webkit-autofill,
401
- textarea:-webkit-autofill:hover,
402
- textarea:-webkit-autofill:focus,
403
- textarea:-webkit-autofill:active,
404
- select:-webkit-autofill,
405
- select:-webkit-autofill:hover,
406
- select:-webkit-autofill:focus,
407
- select:-webkit-autofill:active {
408
- -webkit-box-shadow: 0 0 0 1000px @lightFormBackgroundColor inset;
409
- transition: background-color 5000s ease-in-out 0s, color 5000s ease-in-out 0s;
410
- transition-delay: 5000s;
411
- transition-property: background-color, color;
412
- }
413
- }
414
-
415
- .floatLabelForm::after {
416
- content: " ";
417
- visibility: hidden;
418
- display: block;
419
- height: 0;
420
- clear: both;
421
- }
422
-
423
- // #endregion
424
-
425
- // #region side-by-side pattern on large screens
426
-
427
- @media (min-width: 700px) {
428
- .floatLabelForm {
429
- margin: 0 -10px;
430
- width: auto;
431
- text-align: left;
432
- }
433
-
434
- fieldset {
435
- text-align: left;
436
-
437
- input[type='submit'],
438
- input[type='reset'],
439
- input[type='image'],
440
- button {
441
- float: left;
442
- clear: none;
443
- }
444
-
445
- :last-child {
446
- margin-right: 0;
447
- }
448
- }
449
-
450
- .x2 {
451
- input:not([type='submit']):not([type='reset']):not([type='image']):not([type=checkbox]):not([type=radio]):not([type=color]),
452
- select,
453
- textarea {
454
- width: 562px;
455
- }
456
- }
457
-
458
- .x2 {
459
- input[type=color] {
460
- width: 604px;
461
- }
462
- }
463
-
464
- .x2 {
465
- input[type=range] {
466
- width: 560px !important;
467
- }
468
- }
469
-
470
- .x2 {
471
- select {
472
- width: 604px;
473
- }
474
- }
475
-
476
- .x2.checkboxes ul,
477
- .x2.radios ul {
478
- width: 574px;
479
- }
480
-
481
- .x2 {
482
- label.floatLabelFormAnimatedLabel {
483
- width: 375px;
484
- }
485
- }
486
- }
487
-
488
- // #endregion
489
- }
490
-
491
- // #endregion
492
-
493
- // #region non-js exclusive styles
494
-
495
- form.semanticForms.lowFlow {
496
- dl {
497
- margin: 10px 0 0 0;
498
- }
499
-
500
- dd {
501
- margin: 0 0 25px 0;
502
- }
503
-
504
- dd:last-child {
505
- margin: 0;
506
- }
507
- }
508
-
509
- // #endregion
510
-
511
- // #region dark mode styles
512
-
513
- form.semanticForms.dark {
514
- input:not([type='submit']):not([type='reset']):not([type='image']):not([type=checkbox]):not([type=radio]):not([type=color]),
515
- select,
516
- textarea {
517
- background-color: @darkFormBackgroundColor;
518
- border: 1px @darkBorderColor solid;
519
- color: @darkFormTextColor;
520
- }
521
-
522
- input[type=color] {
523
- background-color: @darkFormBackgroundColor;
524
- border: 1px @darkBorderColor solid;
525
- color: @darkFormTextColor;
526
- }
527
-
528
- fieldset {
529
- background-color: @darkFormSubBackgroundColor;
530
- border: 1px @darkFormSubBorderColor solid;
531
- }
532
-
533
- // clear fields
534
- input:not([type='submit']):not([type='reset']):not([type=checkbox]):not([type=radio]),
535
- textarea {
536
- background-image: url("data:image/svg+xml;utf8,%3Csvg version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' x='0px' y='0px' stroke='%23fff' viewBox='0 0 1000 1000' enable-background='new 0 0 1000 1000' xml:space='preserve'%3E%3Cg%3E%3Cpath fill='%23fff' d='M964.7,157.6L622.3,500l342.4,342.4l0,0c15.7,15.7,25.3,37.3,25.3,61.1c0,47.7-38.7,86.5-86.5,86.5c-23.9,0-45.5-9.7-61.1-25.3l0,0L500,622.3L157.6,964.7l0,0C142,980.3,120.3,990,96.5,990C48.7,990,10,951.3,10,903.5c0-23.9,9.7-45.5,25.3-61.1l0,0L377.7,500L35.3,157.6l0,0C19.7,142,10,120.3,10,96.5C10,48.7,48.7,10,96.5,10c23.9,0,45.5,9.7,61.1,25.3l0,0L500,377.7L842.4,35.3l0,0C858,19.7,879.7,10,903.5,10c47.8,0,86.5,38.7,86.5,86.5C990,120.3,980.3,142,964.7,157.6L964.7,157.6z'/%3E%3C/g%3E%3C/svg%3E");
537
- }
538
-
539
- // custom select box design
540
- select {
541
- background-image: 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");
542
- color: @darkFormTextColor;
543
- }
544
-
545
- // style placeholders
546
- input::placeholder {
547
- color: @darkPlaceholderColor;
548
- }
549
-
550
- textarea::placeholder {
551
- color: @darkPlaceholderColor;
552
- }
553
-
554
- input:focus::placeholder {
555
- color: @darkPlaceholderColor;
556
- }
557
-
558
- input:focus::-moz-placeholder {
559
- color: @darkPlaceholderColor;
560
- }
561
-
562
- input:focus::-webkit-input-placeholder {
563
- color: @darkPlaceholderColor;
564
- }
565
-
566
- input:focus:-ms-input-placeholder {
567
- color: @darkPlaceholderColor;
568
- }
569
-
570
- textarea:focus::placeholder {
571
- color: @darkPlaceholderColor;
572
- }
573
-
574
- textarea:focus::-moz-placeholder {
575
- color: @darkPlaceholderColor;
576
- }
577
-
578
- textarea:focus::-webkit-input-placeholder {
579
- color: @darkPlaceholderColor;
580
- }
581
-
582
- textarea:focus:-ms-input-placeholder {
583
- color: @darkPlaceholderColor;
584
- }
585
-
586
- // buttons
587
- input[type='submit'],
588
- input[type='reset'],
589
- input[type='image'],
590
- button {
591
- border: 2px @darkButtonGradientDark solid;
592
- background-image: linear-gradient(to bottom, @darkButtonGradientLight 0%, @darkButtonGradientDark 100%);
593
- color: @darkFormTextColor;
594
- }
595
-
596
- input[type='submit']:active,
597
- input[type='reset']:active,
598
- input[type='image']:active,
599
- button:active {
600
- background-image: linear-gradient(to bottom, @darkButtonGradientDark 0%, @darkButtonGradientLight 100%);
601
- color: @darkFormTextColor;
602
- }
603
-
604
- .floatLabelForm {
605
- label.floatLabelFormAnimatedLabel {
606
- color: @darkPlaceholderColor;
607
- }
608
-
609
- // move the label off of input to make room for input content
610
- input:not(:placeholder-shown) + label,
611
- input:focus + label,
612
- textarea:not(:placeholder-shown) + label,
613
- textarea:focus + label,
614
- select + label.floatLabelFormAnimatedLabel,
615
- .checkboxes label.floatLabelFormAnimatedLabel,
616
- .radios label.floatLabelFormAnimatedLabel {
617
- color: @darkFormTextColor;
618
- }
619
-
620
- // disable autofill yellow
621
- input:-webkit-autofill,
622
- input:-webkit-autofill:hover,
623
- input:-webkit-autofill:focus,
624
- input:-webkit-autofill:active,
625
- textarea:-webkit-autofill,
626
- textarea:-webkit-autofill:hover,
627
- textarea:-webkit-autofill:focus,
628
- textarea:-webkit-autofill:active,
629
- select:-webkit-autofill,
630
- select:-webkit-autofill:hover,
631
- select:-webkit-autofill:focus,
632
- select:-webkit-autofill:active {
633
- -webkit-box-shadow: 0 0 0 1000px @darkFormBackgroundColor inset;
634
- }
635
- }
636
- }
637
-
638
- // #endregion