-
Notifications
You must be signed in to change notification settings - Fork 0
/
formalize.css
301 lines (240 loc) · 5 KB
/
formalize.css
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
/*! formalize.css v1.8.1 | MIT License | github.com/visicode/formalize.css */
/* To be included right after normalize.css (https://github.com/necolas/normalize.css)
========================================================================== */
/**
* Change the border and margin in all browsers (opinionated).
*/
fieldset {
border: 1px solid #c0c0c0;
margin: 0 2px;
}
/**
* Set line height to 'inherit'.
*/
button,
input,
optgroup,
select,
textarea {
line-height: inherit;
}
/**
* Consistent style, width and color between all fields (opinionated).
*/
button,
input,
select,
textarea {
border: 1px solid #c0c0c0;
}
/**
* 1. Consistent paddings.
* 2. Allow setting the same size for all form fields.
*/
input,
textarea {
padding: 1px; /* 1 */
box-sizing: border-box; /* 2 */
}
/**
* Revert to initial values for some fields.
*/
[type="range"],
[type="file"],
[type="image"] {
border: 0;
padding: 0;
}
/**
* Consistent vertical alignments.
*/
[type="range"],
[type="color"],
[type="image"],
[type="checkbox"],
[type="radio"] {
vertical-align: middle;
}
/**
* Allow correct vertical alignment with field label.
*/
textarea {
vertical-align: top;
}
/**
* Consistent background color on Chrome.
*/
[type="color"] {
background-color: #fff;
}
/**
* Consistent background color on Edge and IE.
*/
[type="file"] {
background-color: transparent;
}
/**
* 1. Consistent buttons background color for all browsers (opinionated).
* 2. Consistent paddings.
*/
button,
[type="button"],
[type="reset"],
[type="submit"] {
background-color: #e1e1e1; /* 1 */
padding: 1px 6px; /* 2 */
}
/**
* Remove the inside button border in Chrome.
*/
::-webkit-color-swatch {
border: 0;
}
/**
* Remove the inside button border in Firefox.
*/
::-moz-color-swatch {
border: 0;
}
/**
* Remove the inside button padding in Chrome.
*/
::-webkit-color-swatch-wrapper {
padding: 0;
}
/**
* Remove the inside button padding in Firefox.
*/
::-moz-color-swatch-wrapper {
padding: 0;
}
/**
* 1. Consistent style, width and color between all fields (opinionated, same than above).
* 2. Consistent background color for all browsers (opinionated, same than above).
*/
::-webkit-file-upload-button {
border: 1px solid #c0c0c0; /* 1 */
background-color: #e1e1e1; /* 2 */
}
/**
* Consistent style, width and color between all fields (opinionated, same than above).
*/
::-ms-browse {
border: 1px solid #c0c0c0;
}
/* Placeholders
========================================================================== */
/**
* 1. Consistent placeholder color (opinionated).
* 2. Correct Firefox opacity.
*/
::-webkit-input-placeholder {
color: #a9a9a9; /* 1 */
}
::-moz-placeholder {
color: #a9a9a9; /* 1 */
opacity: 1; /* 2 */
}
:-ms-input-placeholder {
color: #a9a9a9; /* 1 */
}
/* Focus effect
========================================================================== */
/**
* Remove all focus outlines.
*/
input:focus,
textarea:focus {
outline-width: 0;
}
/**
* 1. Add a focus outline for some fields only (opinionated).
* 2. Set the focus outline to be just around the field border.
*/
button:focus,
[type="range"]:focus,
[type="image"]:focus,
[type="checkbox"]:focus,
[type="radio"]:focus,
[type="button"]:focus,
[type="reset"]:focus,
[type="submit"]:focus,
select:focus {
outline: 1px dotted #000; /* 1 */
outline-offset: 0; /* 2 */
}
/**
* Remove the focus border in Firefox.
*/
[type="range"]::-moz-focus-outer {
border: 0;
}
/**
* Revert the webkit blur effect on focus in Safari for better visual effect.
*/
[type="checkbox"]:focus,
[type="radio"]:focus {
outline-style: auto;
}
/**
* Remove the focus outline in Firefox to only keep the original effect.
*/
[type="range"]:-moz-focusring,
[type="checkbox"]:-moz-focusring,
[type="radio"]:-moz-focusring {
outline-width: 0;
}
/**
* Add a focus outline for color field (Chrome) and file selector field (Chrome & Safari) (same than above).
*/
:focus::-webkit-color-swatch,
:focus::-webkit-file-upload-button {
outline: 1px dotted #000;
}
/**
* Add a focus outline for file selector field in Edge and IE (same than above).
*/
:focus::-ms-browse {
outline: 1px dotted #000;
}
/* Hover effect
========================================================================== */
/**
* Consistent background color for all browsers (opinionated).
*/
button:hover,
[type="button"]:hover,
[type="reset"]:hover,
[type="submit"]:hover {
background-color: #e5f1fb;
}
::-webkit-file-upload-button:hover {
background-color: #e5f1fb;
}
::-ms-browse:hover {
background-color: #e5f1fb;
}
/* Normalize.css fixes
========================================================================== */
/**
* Consistent links effects (#577).
*/
a:active,
a:hover {
outline-width: 0;
}
a:focus {
outline: 1px dotted #000;
}
/**
* Consistent display mode in Firefox when image field is empty (#546).
*/
[type="image"] {
display: inline-block;
}
/**
* iPhone bug displaying search input with rounded angles before entering into the field (#582).
*/
[type="search"] {
-webkit-appearance: none;
}