Commit 25140b8f15154e0c83abe06e79d191f58cc89ae8
Committed by
GitHub
Merge pull request #99 from jingsam/upgrade-normalize
upgrade normalize.css to 5.0
Showing
1 changed file
with
135 additions
and
95 deletions
Show diff stats
src/styles/common/normalize.less
1 | -/* normalize.css v4.2.0 | MIT License | github.com/necolas/normalize.css */ | |
1 | +/*! normalize.css v5.0.0 | MIT License | github.com/necolas/normalize.css */ | |
2 | 2 | |
3 | 3 | /** |
4 | 4 | * 1. Change the default font family in all browsers (opinionated). |
5 | 5 | * 2. Correct the line height in all browsers. |
6 | - * 3. Prevent adjustments of font size after orientation changes in IE and iOS. | |
6 | + * 3. Prevent adjustments of font size after orientation changes in | |
7 | + * IE on Windows Phone and in iOS. | |
7 | 8 | */ |
8 | 9 | |
10 | +/* Document | |
11 | + ========================================================================== */ | |
12 | + | |
9 | 13 | html { |
10 | 14 | font-family: sans-serif; /* 1 */ |
15 | + line-height: 1.15; /* 2 */ | |
11 | 16 | -ms-text-size-adjust: 100%; /* 3 */ |
12 | 17 | -webkit-text-size-adjust: 100%; /* 3 */ |
13 | 18 | } |
14 | 19 | |
20 | +/* Sections | |
21 | + ========================================================================== */ | |
22 | + | |
15 | 23 | /** |
16 | 24 | * Remove the margin in all browsers (opinionated). |
17 | 25 | */ |
... | ... | @@ -20,69 +28,73 @@ body { |
20 | 28 | margin: 0; |
21 | 29 | } |
22 | 30 | |
23 | -/* HTML5 display definitions | |
24 | - ========================================================================== */ | |
25 | - | |
26 | 31 | /** |
27 | 32 | * Add the correct display in IE 9-. |
28 | - * 1. Add the correct display in Edge, IE, and Firefox. | |
29 | - * 2. Add the correct display in IE. | |
30 | 33 | */ |
31 | 34 | |
32 | 35 | article, |
33 | 36 | aside, |
34 | -details, /* 1 */ | |
35 | -figcaption, | |
36 | -figure, | |
37 | 37 | footer, |
38 | 38 | header, |
39 | -main, /* 2 */ | |
40 | -menu, | |
41 | 39 | nav, |
42 | -section, | |
43 | -summary { /* 1 */ | |
40 | +section { | |
44 | 41 | display: block; |
45 | 42 | } |
46 | 43 | |
47 | 44 | /** |
45 | + * Correct the font size and margin on `h1` elements within `section` and | |
46 | + * `article` contexts in Chrome, Firefox, and Safari. | |
47 | + */ | |
48 | + | |
49 | +h1 { | |
50 | + font-size: 2em; | |
51 | + margin: 0.67em 0; | |
52 | +} | |
53 | + | |
54 | +/* Grouping content | |
55 | + ========================================================================== */ | |
56 | + | |
57 | +/** | |
48 | 58 | * Add the correct display in IE 9-. |
59 | + * 1. Add the correct display in IE. | |
49 | 60 | */ |
50 | 61 | |
51 | -audio, | |
52 | -canvas, | |
53 | -progress, | |
54 | -video { | |
55 | - display: inline-block; | |
62 | +figcaption, | |
63 | +figure, | |
64 | +main { /* 1 */ | |
65 | + display: block; | |
56 | 66 | } |
57 | 67 | |
58 | 68 | /** |
59 | - * Add the correct display in iOS 4-7. | |
69 | + * Add the correct margin in IE 8. | |
60 | 70 | */ |
61 | 71 | |
62 | -audio:not([controls]) { | |
63 | - display: none; | |
64 | - height: 0; | |
72 | +figure { | |
73 | + margin: 1em 40px; | |
65 | 74 | } |
66 | 75 | |
67 | 76 | /** |
68 | - * Add the correct vertical alignment in Chrome, Firefox, and Opera. | |
77 | + * 1. Add the correct box sizing in Firefox. | |
78 | + * 2. Show the overflow in Edge and IE. | |
69 | 79 | */ |
70 | 80 | |
71 | -progress { | |
72 | - vertical-align: baseline; | |
81 | +hr { | |
82 | + box-sizing: content-box; /* 1 */ | |
83 | + height: 0; /* 1 */ | |
84 | + overflow: visible; /* 2 */ | |
73 | 85 | } |
74 | 86 | |
75 | 87 | /** |
76 | - * Add the correct display in IE 10-. | |
77 | - * 1. Add the correct display in IE. | |
88 | + * 1. Correct the inheritance and scaling of font size in all browsers. | |
89 | + * 2. Correct the odd `em` font sizing in all browsers. | |
78 | 90 | */ |
79 | 91 | |
80 | -template, /* 1 */ | |
81 | -[hidden] { | |
82 | - display: none; | |
92 | +pre { | |
93 | + font-family: monospace, monospace; /* 1 */ | |
94 | + font-size: 1em; /* 2 */ | |
83 | 95 | } |
84 | 96 | |
85 | -/* Links | |
97 | +/* Text-level semantics | |
86 | 98 | ========================================================================== */ |
87 | 99 | |
88 | 100 | /** |
... | ... | @@ -105,9 +117,6 @@ a:hover { |
105 | 117 | outline-width: 0; |
106 | 118 | } |
107 | 119 | |
108 | -/* Text-level semantics | |
109 | - ========================================================================== */ | |
110 | - | |
111 | 120 | /** |
112 | 121 | * 1. Remove the bottom border in Firefox 39-. |
113 | 122 | * 2. Add the correct text decoration in Chrome, Edge, IE, Opera, and Safari. |
... | ... | @@ -138,21 +147,23 @@ strong { |
138 | 147 | } |
139 | 148 | |
140 | 149 | /** |
141 | - * Add the correct font style in Android 4.3-. | |
150 | + * 1. Correct the inheritance and scaling of font size in all browsers. | |
151 | + * 2. Correct the odd `em` font sizing in all browsers. | |
142 | 152 | */ |
143 | 153 | |
144 | -dfn { | |
145 | - font-style: italic; | |
154 | +code, | |
155 | +kbd, | |
156 | +samp { | |
157 | + font-family: monospace, monospace; /* 1 */ | |
158 | + font-size: 1em; /* 2 */ | |
146 | 159 | } |
147 | 160 | |
148 | 161 | /** |
149 | - * Correct the font size and margin on `h1` elements within `section` and | |
150 | - * `article` contexts in Chrome, Firefox, and Safari. | |
162 | + * Add the correct font style in Android 4.3-. | |
151 | 163 | */ |
152 | 164 | |
153 | -h1 { | |
154 | - font-size: 2em; | |
155 | - margin: 0.67em 0; | |
165 | +dfn { | |
166 | + font-style: italic; | |
156 | 167 | } |
157 | 168 | |
158 | 169 | /** |
... | ... | @@ -197,61 +208,44 @@ sup { |
197 | 208 | ========================================================================== */ |
198 | 209 | |
199 | 210 | /** |
200 | - * Remove the border on images inside links in IE 10-. | |
201 | - */ | |
202 | - | |
203 | -img { | |
204 | - border-style: none; | |
205 | -} | |
206 | - | |
207 | -/** | |
208 | - * Hide the overflow in IE. | |
211 | + * Add the correct display in IE 9-. | |
209 | 212 | */ |
210 | 213 | |
211 | -svg:not(:root) { | |
212 | - overflow: hidden; | |
214 | +audio, | |
215 | +video { | |
216 | + display: inline-block; | |
213 | 217 | } |
214 | 218 | |
215 | -/* Grouping content | |
216 | - ========================================================================== */ | |
217 | - | |
218 | 219 | /** |
219 | - * 1. Correct the inheritance and scaling of font size in all browsers. | |
220 | - * 2. Correct the odd `em` font sizing in all browsers. | |
220 | + * Add the correct display in iOS 4-7. | |
221 | 221 | */ |
222 | 222 | |
223 | -code, | |
224 | -kbd, | |
225 | -pre, | |
226 | -samp { | |
227 | - font-family: monospace, monospace; /* 1 */ | |
228 | - font-size: 1em; /* 2 */ | |
223 | +audio:not([controls]) { | |
224 | + display: none; | |
225 | + height: 0; | |
229 | 226 | } |
230 | 227 | |
231 | 228 | /** |
232 | - * Add the correct margin in IE 8. | |
229 | + * Remove the border on images inside links in IE 10-. | |
233 | 230 | */ |
234 | 231 | |
235 | -figure { | |
236 | - margin: 1em 40px; | |
232 | +img { | |
233 | + border-style: none; | |
237 | 234 | } |
238 | 235 | |
239 | 236 | /** |
240 | - * 1. Add the correct box sizing in Firefox. | |
241 | - * 2. Show the overflow in Edge and IE. | |
237 | + * Hide the overflow in IE. | |
242 | 238 | */ |
243 | 239 | |
244 | -hr { | |
245 | - box-sizing: content-box; /* 1 */ | |
246 | - height: 0; /* 1 */ | |
247 | - overflow: visible; /* 2 */ | |
240 | +svg:not(:root) { | |
241 | + overflow: hidden; | |
248 | 242 | } |
249 | 243 | |
250 | 244 | /* Forms |
251 | 245 | ========================================================================== */ |
252 | 246 | |
253 | 247 | /** |
254 | - * 1. Change font properties to `inherit` in all browsers (opinionated). | |
248 | + * 1. Change the font styles in all browsers (opinionated). | |
255 | 249 | * 2. Remove the margin in Firefox and Safari. |
256 | 250 | */ |
257 | 251 | |
... | ... | @@ -260,19 +254,13 @@ input, |
260 | 254 | optgroup, |
261 | 255 | select, |
262 | 256 | textarea { |
263 | - font: inherit; /* 1 */ | |
257 | + font-family: sans-serif; /* 1 */ | |
258 | + font-size: 100%; /* 1 */ | |
259 | + line-height: 1.15; /* 1 */ | |
264 | 260 | margin: 0; /* 2 */ |
265 | 261 | } |
266 | 262 | |
267 | 263 | /** |
268 | - * Restore the font weight unset by the previous rule. | |
269 | - */ | |
270 | - | |
271 | -optgroup { | |
272 | - font-weight: bold; | |
273 | -} | |
274 | - | |
275 | -/** | |
276 | 264 | * Show the overflow in IE. |
277 | 265 | * 1. Show the overflow in Edge. |
278 | 266 | */ |
... | ... | @@ -355,6 +343,16 @@ legend { |
355 | 343 | } |
356 | 344 | |
357 | 345 | /** |
346 | + * 1. Add the correct display in IE 9-. | |
347 | + * 2. Add the correct vertical alignment in Chrome, Firefox, and Opera. | |
348 | + */ | |
349 | + | |
350 | +progress { | |
351 | + display: inline-block; /* 1 */ | |
352 | + vertical-align: baseline; /* 2 */ | |
353 | +} | |
354 | + | |
355 | +/** | |
358 | 356 | * Remove the default vertical scrollbar in IE. |
359 | 357 | */ |
360 | 358 | |
... | ... | @@ -393,7 +391,7 @@ textarea { |
393 | 391 | } |
394 | 392 | |
395 | 393 | /** |
396 | - * Remove the inner padding and cancel buttons in Chrome and Safari on OS X. | |
394 | + * Remove the inner padding and cancel buttons in Chrome and Safari on macOS. | |
397 | 395 | */ |
398 | 396 | |
399 | 397 | [type="search"]::-webkit-search-cancel-button, |
... | ... | @@ -402,15 +400,6 @@ textarea { |
402 | 400 | } |
403 | 401 | |
404 | 402 | /** |
405 | - * Correct the text style of placeholders in Chrome, Edge, and Safari. | |
406 | - */ | |
407 | - | |
408 | -::-webkit-input-placeholder { | |
409 | - color: inherit; | |
410 | - opacity: 0.54; | |
411 | -} | |
412 | - | |
413 | -/** | |
414 | 403 | * 1. Correct the inability to style clickable types in iOS and Safari. |
415 | 404 | * 2. Change font properties to `inherit` in Safari. |
416 | 405 | */ |
... | ... | @@ -418,4 +407,55 @@ textarea { |
418 | 407 | ::-webkit-file-upload-button { |
419 | 408 | -webkit-appearance: button; /* 1 */ |
420 | 409 | font: inherit; /* 2 */ |
421 | -} | |
422 | 410 | \ No newline at end of file |
411 | +} | |
412 | + | |
413 | +/* Interactive | |
414 | + ========================================================================== */ | |
415 | + | |
416 | +/* | |
417 | + * Add the correct display in IE 9-. | |
418 | + * 1. Add the correct display in Edge, IE, and Firefox. | |
419 | + */ | |
420 | + | |
421 | +details, /* 1 */ | |
422 | +menu { | |
423 | + display: block; | |
424 | +} | |
425 | + | |
426 | +/* | |
427 | + * Add the correct display in all browsers. | |
428 | + */ | |
429 | + | |
430 | +summary { | |
431 | + display: list-item; | |
432 | +} | |
433 | + | |
434 | +/* Scripting | |
435 | + ========================================================================== */ | |
436 | + | |
437 | +/** | |
438 | + * Add the correct display in IE 9-. | |
439 | + */ | |
440 | + | |
441 | +canvas { | |
442 | + display: inline-block; | |
443 | +} | |
444 | + | |
445 | +/** | |
446 | + * Add the correct display in IE. | |
447 | + */ | |
448 | + | |
449 | +template { | |
450 | + display: none; | |
451 | +} | |
452 | + | |
453 | +/* Hidden | |
454 | + ========================================================================== */ | |
455 | + | |
456 | +/** | |
457 | + * Add the correct display in IE 10-. | |
458 | + */ | |
459 | + | |
460 | +[hidden] { | |
461 | + display: none; | |
462 | +} | ... | ... |