semantic-forms 2.0.0 → 2.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/README.md +42 -6
- package/package.json +1 -1
- package/semanticForms.css +60 -19
- package/semanticForms.js +34 -33
- package/semanticFormsImages.less +3 -3
- package/semanticFormsNoImages.css +57 -16
- package/semanticFormsNoImages.less +59 -13
package/README.md
CHANGED
|
@@ -92,18 +92,54 @@ Driven by flexbox to intelligently align the buttons based on how many are in th
|
|
|
92
92
|
```html
|
|
93
93
|
<!-- aligns left/right -->
|
|
94
94
|
<menu>
|
|
95
|
-
<button type="submit" name="submit">Button 1</button>
|
|
96
|
-
<button type="submit" name="submit">Button 2</button>
|
|
95
|
+
<li><button type="submit" name="submit">Button 1</button></li>
|
|
96
|
+
<button type="submit" name="submit">Button 2</button></li>
|
|
97
97
|
</menu>
|
|
98
98
|
|
|
99
99
|
<!-- aligns left/center/right -->
|
|
100
100
|
<menu>
|
|
101
|
-
<button type="submit" name="submit">Button 1</button>
|
|
102
|
-
<button type="submit" name="submit">Button 2</button>
|
|
103
|
-
<button type="submit" name="submit">Button 3</button>
|
|
101
|
+
<li><button type="submit" name="submit">Button 1</button></li>
|
|
102
|
+
<li><button type="submit" name="submit">Button 2</button></li>
|
|
103
|
+
<li><button type="submit" name="submit">Button 3</button></li>
|
|
104
104
|
</menu>
|
|
105
105
|
```
|
|
106
106
|
|
|
107
|
+
## Checkboxes and radio buttons
|
|
108
|
+
|
|
109
|
+
Checkboxes and radio buttons need to follow the following markup structure:
|
|
110
|
+
### Checkboxes
|
|
111
|
+
|
|
112
|
+
```html
|
|
113
|
+
<form class="semanticForms">
|
|
114
|
+
<dl>
|
|
115
|
+
<dt><label data-for="some_field_name">Checkboxes:</label></dt>
|
|
116
|
+
<dd class="checkboxes">
|
|
117
|
+
<ul id="some_field_name">
|
|
118
|
+
<li><input type="checkbox" name="some_field_name" id="c_one"> <label for="c_one">One</label></li>
|
|
119
|
+
<li><input type="checkbox" name="some_field_name" id="c_two"> <label for="c_two">Two</label></li>
|
|
120
|
+
<li><input type="checkbox" name="some_field_name" id="c_three"> <label for="c_three">Three</label></li>
|
|
121
|
+
</ul>
|
|
122
|
+
</dd>
|
|
123
|
+
</dl>
|
|
124
|
+
</form>
|
|
125
|
+
```
|
|
126
|
+
### Radio buttons
|
|
127
|
+
|
|
128
|
+
```html
|
|
129
|
+
<form class="semanticForms">
|
|
130
|
+
<dl>
|
|
131
|
+
<dt><label data-for="some_field_name">Radios:</label></dt>
|
|
132
|
+
<dd class="radios">
|
|
133
|
+
<ul id="some_field_name">
|
|
134
|
+
<li><input type="radio" name="some_field_name" id="r_one"> <label for="r_one">One</label></li>
|
|
135
|
+
<li><input type="radio" name="some_field_name" id="r_two"> <label for="r_two">Two</label></li>
|
|
136
|
+
<li><input type="radio" name="some_field_name" id="r_three"> <label for="r_three">Three</label></li>
|
|
137
|
+
</ul>
|
|
138
|
+
</dd>
|
|
139
|
+
</dl>
|
|
140
|
+
</form>
|
|
141
|
+
```
|
|
142
|
+
|
|
107
143
|
## Other features
|
|
108
144
|
|
|
109
145
|
- Custom-styled select boxes with a custom drawn arrow graphic driven by SVG embedded in the CSS.
|
|
@@ -119,5 +155,5 @@ See `semanticForms.html` or the [live demo](https://kethinov.github.io/semanticf
|
|
|
119
155
|
- `npm i`
|
|
120
156
|
- Make your changes. If you want to alter the CSS, do the changes in `semanticForms.less`.
|
|
121
157
|
- `npm run build`. The build step compiles the LESS file into CSS.
|
|
158
|
+
- Test your changes by opening `semanticForms.html` in your browser.
|
|
122
159
|
- Commit, push, open pull request.
|
|
123
|
-
|
package/package.json
CHANGED
package/semanticForms.css
CHANGED
|
@@ -1,9 +1,17 @@
|
|
|
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
|
+
*/
|
|
3
10
|
}
|
|
4
|
-
.semanticForms input:not([type='submit']):not([type=checkbox]):not([type=radio]),
|
|
11
|
+
.semanticForms input:not([type='submit']):not([type='reset']):not([type='image']):not([type=checkbox]):not([type=radio]):not([type=color]),
|
|
5
12
|
.semanticForms select,
|
|
6
13
|
.semanticForms textarea {
|
|
14
|
+
box-sizing: content-box;
|
|
7
15
|
background-color: #fff;
|
|
8
16
|
outline: 0;
|
|
9
17
|
border: 1px #c0c0c0 solid;
|
|
@@ -14,6 +22,20 @@
|
|
|
14
22
|
font-family: sans-serif;
|
|
15
23
|
padding: 5px 20px;
|
|
16
24
|
}
|
|
25
|
+
.semanticForms input[type=color] {
|
|
26
|
+
background-color: #fff;
|
|
27
|
+
border: 0;
|
|
28
|
+
width: 292px;
|
|
29
|
+
height: 37px;
|
|
30
|
+
padding: 5px 20px;
|
|
31
|
+
}
|
|
32
|
+
.semanticForms select {
|
|
33
|
+
box-sizing: border-box;
|
|
34
|
+
}
|
|
35
|
+
.semanticForms input[type=range] {
|
|
36
|
+
border: 0 !important;
|
|
37
|
+
width: 248px !important;
|
|
38
|
+
}
|
|
17
39
|
.semanticForms fieldset {
|
|
18
40
|
text-align: center;
|
|
19
41
|
margin-bottom: 25px;
|
|
@@ -29,14 +51,16 @@
|
|
|
29
51
|
.semanticForms dl {
|
|
30
52
|
text-align: left;
|
|
31
53
|
}
|
|
32
|
-
.semanticForms .checkboxes ul
|
|
54
|
+
.semanticForms .checkboxes ul,
|
|
55
|
+
.semanticForms .radios ul {
|
|
33
56
|
list-style: none;
|
|
34
57
|
padding: 0;
|
|
35
58
|
}
|
|
36
|
-
.semanticForms dd.checkboxes
|
|
59
|
+
.semanticForms dd.checkboxes,
|
|
60
|
+
.semanticForms dd.radios {
|
|
37
61
|
margin: 0;
|
|
38
62
|
}
|
|
39
|
-
.semanticForms input:not([type='submit']):not([type=checkbox]):not([type=radio]),
|
|
63
|
+
.semanticForms input:not([type='submit']):not([type='reset']):not([type=checkbox]):not([type=radio]),
|
|
40
64
|
.semanticForms textarea {
|
|
41
65
|
background-image: none;
|
|
42
66
|
background-size: 12px;
|
|
@@ -46,10 +70,6 @@
|
|
|
46
70
|
.semanticForms input:not([type=checkbox]):not([type=radio]) {
|
|
47
71
|
background-position: right -12px center;
|
|
48
72
|
}
|
|
49
|
-
.semanticForms input[type=date]:not([type='submit']):not([type=checkbox]):not([type=radio]) {
|
|
50
|
-
width: 270px;
|
|
51
|
-
padding-right: 0;
|
|
52
|
-
}
|
|
53
73
|
.semanticForms textarea {
|
|
54
74
|
background-position: right -12px top 10px;
|
|
55
75
|
height: 100px;
|
|
@@ -85,6 +105,8 @@
|
|
|
85
105
|
color: #aaa;
|
|
86
106
|
}
|
|
87
107
|
.semanticForms input[type='submit'],
|
|
108
|
+
.semanticForms input[type='reset'],
|
|
109
|
+
.semanticForms input[type='image'],
|
|
88
110
|
.semanticForms button {
|
|
89
111
|
width: auto;
|
|
90
112
|
box-sizing: content-box;
|
|
@@ -106,7 +128,15 @@
|
|
|
106
128
|
background-image: -ms-linear-gradient(bottom, #fff 0%, #c0c0c0 100%);
|
|
107
129
|
background-image: linear-gradient(to bottom, #fff 0%, #c0c0c0 100%);
|
|
108
130
|
}
|
|
131
|
+
.semanticForms input[type='submit']:first-of-type,
|
|
132
|
+
.semanticForms input[type='reset']:first-of-type,
|
|
133
|
+
.semanticForms input[type='image']:first-of-type,
|
|
134
|
+
.semanticForms button:first-of-type {
|
|
135
|
+
margin-left: 0;
|
|
136
|
+
}
|
|
109
137
|
.semanticForms input[type='submit']:active,
|
|
138
|
+
.semanticForms input[type='reset']:active,
|
|
139
|
+
.semanticForms input[type='image']:active,
|
|
110
140
|
.semanticForms button:active {
|
|
111
141
|
background-image: -webkit-gradient(linear, left top, left bottom, color-stop(#fff, 0), color-stop(#c0c0c0, 1));
|
|
112
142
|
background-image: -o-linear-gradient(bottom, #c0c0c0 0%, #fff 100%);
|
|
@@ -148,12 +178,12 @@
|
|
|
148
178
|
}
|
|
149
179
|
.semanticForms .floatLabelForm dd {
|
|
150
180
|
float: left;
|
|
151
|
-
margin: 0
|
|
181
|
+
margin: 0 10px 0 10px;
|
|
152
182
|
}
|
|
153
183
|
.semanticForms .floatLabelForm dd:nth-child(4n+2) {
|
|
154
184
|
clear: both;
|
|
155
185
|
}
|
|
156
|
-
.semanticForms .floatLabelForm dt:not(.checkboxes) {
|
|
186
|
+
.semanticForms .floatLabelForm dt:not(.checkboxes):not(.radios) {
|
|
157
187
|
font-size: 1px;
|
|
158
188
|
text-indent: 100%;
|
|
159
189
|
white-space: nowrap;
|
|
@@ -161,13 +191,15 @@
|
|
|
161
191
|
position: absolute;
|
|
162
192
|
right: 9999px;
|
|
163
193
|
}
|
|
164
|
-
.semanticForms .floatLabelForm dd:not(.checkboxes) {
|
|
194
|
+
.semanticForms .floatLabelForm dd:not(.checkboxes):not(.radios) {
|
|
165
195
|
display: flex;
|
|
166
196
|
flex-flow: column-reverse;
|
|
167
197
|
}
|
|
168
|
-
.semanticForms .floatLabelForm .checkboxes ul
|
|
169
|
-
|
|
170
|
-
|
|
198
|
+
.semanticForms .floatLabelForm .checkboxes ul,
|
|
199
|
+
.semanticForms .floatLabelForm .radios ul {
|
|
200
|
+
margin: 3px 20px 0 0;
|
|
201
|
+
width: 267px;
|
|
202
|
+
padding-left: 10px;
|
|
171
203
|
}
|
|
172
204
|
.semanticForms .floatLabelForm label.floatLabelFormAnimatedLabel {
|
|
173
205
|
width: 170px;
|
|
@@ -226,7 +258,8 @@
|
|
|
226
258
|
.semanticForms .floatLabelForm textarea:not(:placeholder-shown) + label,
|
|
227
259
|
.semanticForms .floatLabelForm textarea:focus + label,
|
|
228
260
|
.semanticForms .floatLabelForm select + label.floatLabelFormAnimatedLabel,
|
|
229
|
-
.semanticForms .floatLabelForm .checkboxes label.floatLabelFormAnimatedLabel
|
|
261
|
+
.semanticForms .floatLabelForm .checkboxes label.floatLabelFormAnimatedLabel,
|
|
262
|
+
.semanticForms .floatLabelForm .radios label.floatLabelFormAnimatedLabel {
|
|
230
263
|
transform: translate(0, 0) scale(1);
|
|
231
264
|
text-indent: 6px;
|
|
232
265
|
cursor: default;
|
|
@@ -272,7 +305,12 @@
|
|
|
272
305
|
justify-content: space-between;
|
|
273
306
|
padding: 0;
|
|
274
307
|
}
|
|
308
|
+
.semanticForms menu li {
|
|
309
|
+
list-style-type: none;
|
|
310
|
+
}
|
|
275
311
|
.semanticForms menu input[type='submit'],
|
|
312
|
+
.semanticForms menu input[type='reset'],
|
|
313
|
+
.semanticForms menu input[type='image'],
|
|
276
314
|
.semanticForms menu button {
|
|
277
315
|
float: none;
|
|
278
316
|
clear: none;
|
|
@@ -283,15 +321,18 @@
|
|
|
283
321
|
margin: 0;
|
|
284
322
|
width: auto;
|
|
285
323
|
text-align: left;
|
|
324
|
+
position: relative;
|
|
325
|
+
left: -10px;
|
|
286
326
|
}
|
|
287
327
|
.semanticForms fieldset {
|
|
288
328
|
text-align: left;
|
|
289
329
|
}
|
|
290
330
|
.semanticForms fieldset input[type='submit'],
|
|
331
|
+
.semanticForms fieldset input[type='reset'],
|
|
332
|
+
.semanticForms fieldset input[type='image'],
|
|
291
333
|
.semanticForms fieldset button {
|
|
292
334
|
float: left;
|
|
293
335
|
clear: none;
|
|
294
|
-
margin: 25px 50px 25px 0;
|
|
295
336
|
}
|
|
296
337
|
.semanticForms fieldset :last-child {
|
|
297
338
|
margin-right: 0;
|
|
@@ -306,10 +347,10 @@
|
|
|
306
347
|
.semanticForms.lowFlow dd:last-child {
|
|
307
348
|
margin: 0;
|
|
308
349
|
}
|
|
309
|
-
.semanticForms input:not([type='submit']):not([type=checkbox]):not([type=radio]),
|
|
350
|
+
.semanticForms input:not([type='submit']):not([type='reset']):not([type=checkbox]):not([type=radio]),
|
|
310
351
|
.semanticForms textarea {
|
|
311
|
-
background-image: url("data:image/svg+xml;utf8
|
|
352
|
+
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");
|
|
312
353
|
}
|
|
313
354
|
.semanticForms select {
|
|
314
|
-
background-image: url("data:image/svg+xml;utf8
|
|
355
|
+
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");
|
|
315
356
|
}
|
package/semanticForms.js
CHANGED
|
@@ -1,25 +1,25 @@
|
|
|
1
|
-
(function (
|
|
1
|
+
(function () {
|
|
2
2
|
// do some feature detection so none of the JS executes if the browser is too old
|
|
3
3
|
if (typeof document.getElementsByClassName !== 'function' || typeof document.querySelector !== 'function' || !document.body.classList) {
|
|
4
4
|
return
|
|
5
5
|
}
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
7
|
+
const forms = document.querySelectorAll('form.semanticForms')
|
|
8
|
+
const fl = forms.length
|
|
9
|
+
let f
|
|
10
|
+
let form
|
|
11
|
+
let inputs
|
|
12
|
+
let input
|
|
13
|
+
let nodeName
|
|
14
|
+
let type
|
|
15
|
+
let label
|
|
16
|
+
let labelHTML
|
|
17
|
+
let newLabel
|
|
18
|
+
let dl
|
|
19
|
+
let l
|
|
20
|
+
let clearfieldHorizontalOffset
|
|
21
|
+
let clearfieldVerticalOffset
|
|
22
|
+
let i
|
|
23
23
|
|
|
24
24
|
// don't execute any of the JS if no forms class semanticForms exist
|
|
25
25
|
if (fl <= 0) {
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
if (input && input.id) {
|
|
40
40
|
nodeName = input.nodeName
|
|
41
41
|
type = input.getAttribute('type')
|
|
42
|
-
if (nodeName === 'TEXTAREA' || nodeName === 'SELECT' || type === '
|
|
42
|
+
if (nodeName === 'TEXTAREA' || nodeName === 'SELECT' || type === 'checkbox' || type === 'color' || type === 'date' || type === 'datetime-local' || type === 'email' || type === 'file' || type === 'image' || type === 'month' || type === 'number' || type === 'password' || type === 'radio' || type === 'range' || type === 'search' || type === 'tel' || type === 'text' || type === 'time' || type === 'url' || type === 'week') {
|
|
43
43
|
dl = input.parentNode
|
|
44
44
|
while (dl && dl.nodeName !== 'DL') {
|
|
45
45
|
dl = dl.parentNode
|
|
@@ -74,11 +74,12 @@
|
|
|
74
74
|
label.setAttribute('hidden', 'hidden')
|
|
75
75
|
}
|
|
76
76
|
|
|
77
|
-
if (nodeName !== 'SELECT' && type !== 'checkbox' && type !== 'radio'
|
|
77
|
+
if (nodeName !== 'SELECT' && type !== 'checkbox' && type !== 'radio') {
|
|
78
78
|
// if it doesn't have a placeholder, add a blank one
|
|
79
79
|
if (!input.getAttribute('placeholder')) {
|
|
80
80
|
input.setAttribute('placeholder', '')
|
|
81
81
|
}
|
|
82
|
+
input.classList.add('semanticform')
|
|
82
83
|
inputHandler(input) // force x to appear on inputs with prefilled value
|
|
83
84
|
}
|
|
84
85
|
}
|
|
@@ -92,10 +93,10 @@
|
|
|
92
93
|
|
|
93
94
|
document.addEventListener('mousemove', function (e) {
|
|
94
95
|
if (isPatternElement(e)) {
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
if (nodeName === 'TEXTAREA' || type === '
|
|
96
|
+
const el = e.target
|
|
97
|
+
const nodeName = el.nodeName
|
|
98
|
+
const type = el.getAttribute('type')
|
|
99
|
+
if (nodeName === 'TEXTAREA' || type === 'checkbox' || type === 'color' || type === 'date' || type === 'datetime-local' || type === 'email' || type === 'file' || type === 'month' || type === 'number' || type === 'password' || type === 'radio' || type === 'range' || type === 'search' || type === 'tel' || type === 'text' || type === 'time' || type === 'url' || type === 'week') {
|
|
99
100
|
inputHandler(e)
|
|
100
101
|
if (el.offsetWidth - clearfieldHorizontalOffset < e.clientX - el.getBoundingClientRect().left && clearfieldHorizontalOffset + clearfieldVerticalOffset > e.clientY - el.getBoundingClientRect().top
|
|
101
102
|
) {
|
|
@@ -111,10 +112,10 @@
|
|
|
111
112
|
|
|
112
113
|
document.addEventListener('click', function (e) {
|
|
113
114
|
if (isPatternElement(e)) {
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
if (nodeName === 'TEXTAREA' || type === '
|
|
115
|
+
const el = e.target
|
|
116
|
+
const nodeName = el.nodeName
|
|
117
|
+
const type = el.getAttribute('type')
|
|
118
|
+
if (nodeName === 'TEXTAREA' || type === 'checkbox' || type === 'color' || type === 'date' || type === 'datetime-local' || type === 'email' || type === 'file' || type === 'month' || type === 'number' || type === 'password' || type === 'radio' || type === 'range' || type === 'search' || type === 'tel' || type === 'text' || type === 'time' || type === 'url' || type === 'week') {
|
|
118
119
|
if (el.offsetWidth - clearfieldHorizontalOffset < e.clientX - el.getBoundingClientRect().left &&
|
|
119
120
|
clearfieldHorizontalOffset + clearfieldVerticalOffset > e.clientY - el.getBoundingClientRect().top
|
|
120
121
|
) {
|
|
@@ -128,10 +129,10 @@
|
|
|
128
129
|
|
|
129
130
|
function inputHandler (e) {
|
|
130
131
|
if (isPatternElement(e)) {
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
if ((nodeName && type) && (nodeName === 'TEXTAREA' || type === '
|
|
132
|
+
const el = e.target || e
|
|
133
|
+
const nodeName = el.nodeName
|
|
134
|
+
const type = el.getAttribute('type') || nodeName === 'TEXTAREA'
|
|
135
|
+
if ((nodeName && type) && (nodeName === 'TEXTAREA' || type === 'checkbox' || type === 'color' || type === 'date' || type === 'datetime-local' || type === 'email' || type === 'file' || type === 'month' || type === 'number' || type === 'password' || type === 'radio' || type === 'range' || type === 'search' || type === 'tel' || type === 'text' || type === 'time' || type === 'url' || type === 'week')) {
|
|
135
136
|
if (el.value) {
|
|
136
137
|
if (!el.classList.contains('x')) {
|
|
137
138
|
el.classList.add('x')
|
|
@@ -152,8 +153,8 @@
|
|
|
152
153
|
}
|
|
153
154
|
|
|
154
155
|
function isPatternElement (e) {
|
|
155
|
-
|
|
156
|
-
if (!thisEl.classList.contains('
|
|
156
|
+
const thisEl = e.target || e
|
|
157
|
+
if (!thisEl.classList.contains('semanticform')) {
|
|
157
158
|
return false
|
|
158
159
|
}
|
|
159
160
|
return true
|
package/semanticFormsImages.less
CHANGED
|
@@ -3,13 +3,13 @@
|
|
|
3
3
|
.semanticForms {
|
|
4
4
|
|
|
5
5
|
// clear fields
|
|
6
|
-
input:not([type='submit']):not([type=checkbox]):not([type=radio]),
|
|
6
|
+
input:not([type='submit']):not([type='reset']):not([type=checkbox]):not([type=radio]),
|
|
7
7
|
textarea {
|
|
8
|
-
background-image: url("data:image/svg+xml;utf8
|
|
8
|
+
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");
|
|
9
9
|
}
|
|
10
10
|
|
|
11
11
|
// custom select box design
|
|
12
12
|
select {
|
|
13
|
-
background-image: url("data:image/svg+xml;utf8
|
|
13
|
+
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");
|
|
14
14
|
}
|
|
15
15
|
}
|
|
@@ -1,9 +1,17 @@
|
|
|
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
|
+
*/
|
|
3
10
|
}
|
|
4
|
-
.semanticForms input:not([type='submit']):not([type=checkbox]):not([type=radio]),
|
|
11
|
+
.semanticForms input:not([type='submit']):not([type='reset']):not([type='image']):not([type=checkbox]):not([type=radio]):not([type=color]),
|
|
5
12
|
.semanticForms select,
|
|
6
13
|
.semanticForms textarea {
|
|
14
|
+
box-sizing: content-box;
|
|
7
15
|
background-color: #fff;
|
|
8
16
|
outline: 0;
|
|
9
17
|
border: 1px #c0c0c0 solid;
|
|
@@ -14,6 +22,20 @@
|
|
|
14
22
|
font-family: sans-serif;
|
|
15
23
|
padding: 5px 20px;
|
|
16
24
|
}
|
|
25
|
+
.semanticForms input[type=color] {
|
|
26
|
+
background-color: #fff;
|
|
27
|
+
border: 0;
|
|
28
|
+
width: 292px;
|
|
29
|
+
height: 37px;
|
|
30
|
+
padding: 5px 20px;
|
|
31
|
+
}
|
|
32
|
+
.semanticForms select {
|
|
33
|
+
box-sizing: border-box;
|
|
34
|
+
}
|
|
35
|
+
.semanticForms input[type=range] {
|
|
36
|
+
border: 0 !important;
|
|
37
|
+
width: 248px !important;
|
|
38
|
+
}
|
|
17
39
|
.semanticForms fieldset {
|
|
18
40
|
text-align: center;
|
|
19
41
|
margin-bottom: 25px;
|
|
@@ -29,14 +51,16 @@
|
|
|
29
51
|
.semanticForms dl {
|
|
30
52
|
text-align: left;
|
|
31
53
|
}
|
|
32
|
-
.semanticForms .checkboxes ul
|
|
54
|
+
.semanticForms .checkboxes ul,
|
|
55
|
+
.semanticForms .radios ul {
|
|
33
56
|
list-style: none;
|
|
34
57
|
padding: 0;
|
|
35
58
|
}
|
|
36
|
-
.semanticForms dd.checkboxes
|
|
59
|
+
.semanticForms dd.checkboxes,
|
|
60
|
+
.semanticForms dd.radios {
|
|
37
61
|
margin: 0;
|
|
38
62
|
}
|
|
39
|
-
.semanticForms input:not([type='submit']):not([type=checkbox]):not([type=radio]),
|
|
63
|
+
.semanticForms input:not([type='submit']):not([type='reset']):not([type=checkbox]):not([type=radio]),
|
|
40
64
|
.semanticForms textarea {
|
|
41
65
|
background-image: none;
|
|
42
66
|
background-size: 12px;
|
|
@@ -46,10 +70,6 @@
|
|
|
46
70
|
.semanticForms input:not([type=checkbox]):not([type=radio]) {
|
|
47
71
|
background-position: right -12px center;
|
|
48
72
|
}
|
|
49
|
-
.semanticForms input[type=date]:not([type='submit']):not([type=checkbox]):not([type=radio]) {
|
|
50
|
-
width: 270px;
|
|
51
|
-
padding-right: 0;
|
|
52
|
-
}
|
|
53
73
|
.semanticForms textarea {
|
|
54
74
|
background-position: right -12px top 10px;
|
|
55
75
|
height: 100px;
|
|
@@ -85,6 +105,8 @@
|
|
|
85
105
|
color: #aaa;
|
|
86
106
|
}
|
|
87
107
|
.semanticForms input[type='submit'],
|
|
108
|
+
.semanticForms input[type='reset'],
|
|
109
|
+
.semanticForms input[type='image'],
|
|
88
110
|
.semanticForms button {
|
|
89
111
|
width: auto;
|
|
90
112
|
box-sizing: content-box;
|
|
@@ -106,7 +128,15 @@
|
|
|
106
128
|
background-image: -ms-linear-gradient(bottom, #fff 0%, #c0c0c0 100%);
|
|
107
129
|
background-image: linear-gradient(to bottom, #fff 0%, #c0c0c0 100%);
|
|
108
130
|
}
|
|
131
|
+
.semanticForms input[type='submit']:first-of-type,
|
|
132
|
+
.semanticForms input[type='reset']:first-of-type,
|
|
133
|
+
.semanticForms input[type='image']:first-of-type,
|
|
134
|
+
.semanticForms button:first-of-type {
|
|
135
|
+
margin-left: 0;
|
|
136
|
+
}
|
|
109
137
|
.semanticForms input[type='submit']:active,
|
|
138
|
+
.semanticForms input[type='reset']:active,
|
|
139
|
+
.semanticForms input[type='image']:active,
|
|
110
140
|
.semanticForms button:active {
|
|
111
141
|
background-image: -webkit-gradient(linear, left top, left bottom, color-stop(#fff, 0), color-stop(#c0c0c0, 1));
|
|
112
142
|
background-image: -o-linear-gradient(bottom, #c0c0c0 0%, #fff 100%);
|
|
@@ -148,12 +178,12 @@
|
|
|
148
178
|
}
|
|
149
179
|
.semanticForms .floatLabelForm dd {
|
|
150
180
|
float: left;
|
|
151
|
-
margin: 0
|
|
181
|
+
margin: 0 10px 0 10px;
|
|
152
182
|
}
|
|
153
183
|
.semanticForms .floatLabelForm dd:nth-child(4n+2) {
|
|
154
184
|
clear: both;
|
|
155
185
|
}
|
|
156
|
-
.semanticForms .floatLabelForm dt:not(.checkboxes) {
|
|
186
|
+
.semanticForms .floatLabelForm dt:not(.checkboxes):not(.radios) {
|
|
157
187
|
font-size: 1px;
|
|
158
188
|
text-indent: 100%;
|
|
159
189
|
white-space: nowrap;
|
|
@@ -161,13 +191,15 @@
|
|
|
161
191
|
position: absolute;
|
|
162
192
|
right: 9999px;
|
|
163
193
|
}
|
|
164
|
-
.semanticForms .floatLabelForm dd:not(.checkboxes) {
|
|
194
|
+
.semanticForms .floatLabelForm dd:not(.checkboxes):not(.radios) {
|
|
165
195
|
display: flex;
|
|
166
196
|
flex-flow: column-reverse;
|
|
167
197
|
}
|
|
168
|
-
.semanticForms .floatLabelForm .checkboxes ul
|
|
169
|
-
|
|
170
|
-
|
|
198
|
+
.semanticForms .floatLabelForm .checkboxes ul,
|
|
199
|
+
.semanticForms .floatLabelForm .radios ul {
|
|
200
|
+
margin: 3px 20px 0 0;
|
|
201
|
+
width: 267px;
|
|
202
|
+
padding-left: 10px;
|
|
171
203
|
}
|
|
172
204
|
.semanticForms .floatLabelForm label.floatLabelFormAnimatedLabel {
|
|
173
205
|
width: 170px;
|
|
@@ -226,7 +258,8 @@
|
|
|
226
258
|
.semanticForms .floatLabelForm textarea:not(:placeholder-shown) + label,
|
|
227
259
|
.semanticForms .floatLabelForm textarea:focus + label,
|
|
228
260
|
.semanticForms .floatLabelForm select + label.floatLabelFormAnimatedLabel,
|
|
229
|
-
.semanticForms .floatLabelForm .checkboxes label.floatLabelFormAnimatedLabel
|
|
261
|
+
.semanticForms .floatLabelForm .checkboxes label.floatLabelFormAnimatedLabel,
|
|
262
|
+
.semanticForms .floatLabelForm .radios label.floatLabelFormAnimatedLabel {
|
|
230
263
|
transform: translate(0, 0) scale(1);
|
|
231
264
|
text-indent: 6px;
|
|
232
265
|
cursor: default;
|
|
@@ -272,7 +305,12 @@
|
|
|
272
305
|
justify-content: space-between;
|
|
273
306
|
padding: 0;
|
|
274
307
|
}
|
|
308
|
+
.semanticForms menu li {
|
|
309
|
+
list-style-type: none;
|
|
310
|
+
}
|
|
275
311
|
.semanticForms menu input[type='submit'],
|
|
312
|
+
.semanticForms menu input[type='reset'],
|
|
313
|
+
.semanticForms menu input[type='image'],
|
|
276
314
|
.semanticForms menu button {
|
|
277
315
|
float: none;
|
|
278
316
|
clear: none;
|
|
@@ -283,15 +321,18 @@
|
|
|
283
321
|
margin: 0;
|
|
284
322
|
width: auto;
|
|
285
323
|
text-align: left;
|
|
324
|
+
position: relative;
|
|
325
|
+
left: -10px;
|
|
286
326
|
}
|
|
287
327
|
.semanticForms fieldset {
|
|
288
328
|
text-align: left;
|
|
289
329
|
}
|
|
290
330
|
.semanticForms fieldset input[type='submit'],
|
|
331
|
+
.semanticForms fieldset input[type='reset'],
|
|
332
|
+
.semanticForms fieldset input[type='image'],
|
|
291
333
|
.semanticForms fieldset button {
|
|
292
334
|
float: left;
|
|
293
335
|
clear: none;
|
|
294
|
-
margin: 25px 50px 25px 0;
|
|
295
336
|
}
|
|
296
337
|
.semanticForms fieldset :last-child {
|
|
297
338
|
margin-right: 0;
|
|
@@ -7,9 +7,10 @@
|
|
|
7
7
|
// globals
|
|
8
8
|
font-family: sans-serif;
|
|
9
9
|
|
|
10
|
-
input:not([type='submit']):not([type=checkbox]):not([type=radio]),
|
|
10
|
+
input:not([type='submit']):not([type='reset']):not([type='image']):not([type=checkbox]):not([type=radio]):not([type=color]),
|
|
11
11
|
select,
|
|
12
12
|
textarea {
|
|
13
|
+
box-sizing: content-box;
|
|
13
14
|
background-color: @formBackgroundColor;
|
|
14
15
|
outline: 0;
|
|
15
16
|
border: 1px @borderColor solid;
|
|
@@ -21,6 +22,23 @@
|
|
|
21
22
|
padding: 5px 20px;
|
|
22
23
|
}
|
|
23
24
|
|
|
25
|
+
input[type=color] {
|
|
26
|
+
background-color: @formBackgroundColor;
|
|
27
|
+
border: 0;
|
|
28
|
+
width: 292px;
|
|
29
|
+
height: 37px;
|
|
30
|
+
padding: 5px 20px;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
select {
|
|
34
|
+
box-sizing: border-box;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
input[type=range] {
|
|
38
|
+
border: 0 !important;
|
|
39
|
+
width: 248px !important;
|
|
40
|
+
}
|
|
41
|
+
|
|
24
42
|
fieldset {
|
|
25
43
|
text-align: center;
|
|
26
44
|
margin-bottom: 25px;
|
|
@@ -40,18 +58,20 @@
|
|
|
40
58
|
text-align: left;
|
|
41
59
|
}
|
|
42
60
|
|
|
43
|
-
.checkboxes ul
|
|
61
|
+
.checkboxes ul,
|
|
62
|
+
.radios ul {
|
|
44
63
|
list-style: none;
|
|
45
64
|
padding: 0;
|
|
46
65
|
}
|
|
47
66
|
|
|
48
|
-
dd.checkboxes
|
|
67
|
+
dd.checkboxes,
|
|
68
|
+
dd.radios {
|
|
49
69
|
margin: 0;
|
|
50
70
|
}
|
|
51
71
|
|
|
52
72
|
|
|
53
73
|
// clear fields
|
|
54
|
-
input:not([type='submit']):not([type=checkbox]):not([type=radio]),
|
|
74
|
+
input:not([type='submit']):not([type='reset']):not([type=checkbox]):not([type=radio]),
|
|
55
75
|
textarea {
|
|
56
76
|
background-image: none;
|
|
57
77
|
background-size: 12px;
|
|
@@ -63,10 +83,13 @@
|
|
|
63
83
|
background-position: right -12px center;
|
|
64
84
|
}
|
|
65
85
|
|
|
66
|
-
|
|
86
|
+
/*
|
|
87
|
+
TODO: still needed?
|
|
88
|
+
input:not([type='submit']):not([type='reset']):not([type='image']):not([type=checkbox]):not([type=radio]) {
|
|
67
89
|
width: 270px;
|
|
68
90
|
padding-right: 0;
|
|
69
91
|
}
|
|
92
|
+
*/
|
|
70
93
|
|
|
71
94
|
textarea {
|
|
72
95
|
background-position: right -12px top 10px;
|
|
@@ -118,6 +141,8 @@
|
|
|
118
141
|
|
|
119
142
|
// buttons
|
|
120
143
|
input[type='submit'],
|
|
144
|
+
input[type='reset'],
|
|
145
|
+
input[type='image'],
|
|
121
146
|
button {
|
|
122
147
|
width: auto;
|
|
123
148
|
box-sizing: content-box;
|
|
@@ -140,7 +165,16 @@
|
|
|
140
165
|
background-image: linear-gradient(to bottom, @formBackgroundColor 0%, @borderColor 100%);
|
|
141
166
|
}
|
|
142
167
|
|
|
168
|
+
input[type='submit']:first-of-type,
|
|
169
|
+
input[type='reset']:first-of-type,
|
|
170
|
+
input[type='image']:first-of-type,
|
|
171
|
+
button:first-of-type {
|
|
172
|
+
margin-left: 0;
|
|
173
|
+
}
|
|
174
|
+
|
|
143
175
|
input[type='submit']:active,
|
|
176
|
+
input[type='reset']:active,
|
|
177
|
+
input[type='image']:active,
|
|
144
178
|
button:active {
|
|
145
179
|
background-image: -webkit-gradient(linear, left top, left bottom, color-stop(@formBackgroundColor, 0), color-stop(@borderColor, 1));
|
|
146
180
|
background-image: -o-linear-gradient(bottom, @borderColor 0%, @formBackgroundColor 100%);
|
|
@@ -188,14 +222,14 @@
|
|
|
188
222
|
|
|
189
223
|
dd {
|
|
190
224
|
float: left;
|
|
191
|
-
margin: 0
|
|
225
|
+
margin: 0 10px 0 10px;
|
|
192
226
|
}
|
|
193
227
|
|
|
194
228
|
dd:nth-child(4n+2) {
|
|
195
229
|
clear: both;
|
|
196
230
|
}
|
|
197
231
|
|
|
198
|
-
dt:not(.checkboxes) {
|
|
232
|
+
dt:not(.checkboxes):not(.radios) {
|
|
199
233
|
font-size: 1px;
|
|
200
234
|
text-indent: 100%;
|
|
201
235
|
white-space: nowrap;
|
|
@@ -204,14 +238,16 @@
|
|
|
204
238
|
right: 9999px;
|
|
205
239
|
}
|
|
206
240
|
|
|
207
|
-
dd:not(.checkboxes) {
|
|
241
|
+
dd:not(.checkboxes):not(.radios) {
|
|
208
242
|
display: flex;
|
|
209
243
|
flex-flow: column-reverse;
|
|
210
244
|
}
|
|
211
245
|
|
|
212
|
-
.checkboxes ul
|
|
213
|
-
|
|
214
|
-
|
|
246
|
+
.checkboxes ul,
|
|
247
|
+
.radios ul {
|
|
248
|
+
margin: 3px 20px 0 0;
|
|
249
|
+
width: 267px;
|
|
250
|
+
padding-left: 10px;
|
|
215
251
|
}
|
|
216
252
|
|
|
217
253
|
label.floatLabelFormAnimatedLabel {
|
|
@@ -287,7 +323,8 @@
|
|
|
287
323
|
textarea:not(:placeholder-shown) + label,
|
|
288
324
|
textarea:focus + label,
|
|
289
325
|
select + label.floatLabelFormAnimatedLabel,
|
|
290
|
-
.checkboxes label.floatLabelFormAnimatedLabel
|
|
326
|
+
.checkboxes label.floatLabelFormAnimatedLabel,
|
|
327
|
+
.radios label.floatLabelFormAnimatedLabel {
|
|
291
328
|
transform: translate(0, 0) scale(1);
|
|
292
329
|
text-indent: 6px;
|
|
293
330
|
cursor: default;
|
|
@@ -341,7 +378,13 @@
|
|
|
341
378
|
justify-content: space-between;
|
|
342
379
|
padding: 0;
|
|
343
380
|
|
|
381
|
+
li {
|
|
382
|
+
list-style-type: none;
|
|
383
|
+
}
|
|
384
|
+
|
|
344
385
|
input[type='submit'],
|
|
386
|
+
input[type='reset'],
|
|
387
|
+
input[type='image'],
|
|
345
388
|
button {
|
|
346
389
|
float: none;
|
|
347
390
|
clear: none;
|
|
@@ -356,16 +399,19 @@
|
|
|
356
399
|
margin: 0;
|
|
357
400
|
width: auto;
|
|
358
401
|
text-align: left;
|
|
402
|
+
position: relative;
|
|
403
|
+
left: -10px;
|
|
359
404
|
}
|
|
360
405
|
|
|
361
406
|
fieldset {
|
|
362
407
|
text-align: left;
|
|
363
408
|
|
|
364
409
|
input[type='submit'],
|
|
410
|
+
input[type='reset'],
|
|
411
|
+
input[type='image'],
|
|
365
412
|
button {
|
|
366
413
|
float: left;
|
|
367
414
|
clear: none;
|
|
368
|
-
margin: 25px 50px 25px 0;
|
|
369
415
|
}
|
|
370
416
|
|
|
371
417
|
:last-child {
|