Skip to content

Commit 54f1277

Browse files
committed
Add improvements from normalize.css; reduce number and detail of CSS comments
1 parent faf5536 commit 54f1277

File tree

1 file changed

+49
-116
lines changed

1 file changed

+49
-116
lines changed

css/default.css

+49-116
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,9 @@ PRINT
2424

2525

2626

27-
/* ============================================================================================================================ **
28-
** A L L M E D I A
29-
** ============================================================================================================================ */
27+
/* ============================================================================================================= **
28+
** A L L M E D I A
29+
** ============================================================================================================= */
3030

3131
/*
3232
* Styles affecting all viewport widths and print (keep linear and fluid)
@@ -35,11 +35,6 @@ PRINT
3535

3636
/* ============================================================================================================= 1. HTML5 ELEMENT DISPLAY */
3737

38-
/*
39-
* Add display for block-level HTML5 elements
40-
* Display not properly defined in IE6/7/8/9 & FF3
41-
*/
42-
4338
header,
4439
section,
4540
article,
@@ -55,12 +50,7 @@ summary {
5550
display: block;
5651
}
5752

58-
/*
59-
* Add display for embedded HTML5 elements
60-
* Display not properly defined in IE6/7/8/9 & FF3
61-
*/
62-
63-
audio,
53+
audio[controls],
6454
canvas,
6555
video {
6656
display: inline-block;
@@ -74,23 +64,21 @@ video {
7464
/* ============================================================================================================= 2. BASE */
7565

7666
/*
77-
* 1. Add vertical scrollbar to <html> element
78-
* Keeps page centred in all browsers regardless of content height
79-
* 2. Remove iOS tap highlight color to prevent entire container's being highlighted
80-
* www.yuiblog.com/blog/2010/10/01/quick-tip-customizing-the-mobile-safari-tap-highlight-color/
81-
* 3. Remove iOS text size adjust without disabling user zoom
82-
* www.456bereastreet.com/archive/201012/controlling_text_size_in_safari_for_ios_without_disabling_user_zoom/
67+
* 1. Add font size to prevent text resizing oddly in IE6/7 when body font-size is set using em units
68+
* 2. Add vertical scrollbar to keep page centred in all browsers regardless of content height
69+
* 3. Remove Android and iOS tap highlight color to prevent entire container being highlighted
70+
* 4. Remove iOS text size adjust without disabling user zoom
8371
*/
8472

8573
html {
86-
overflow-y: scroll; /* 1 */
87-
-webkit-tap-highlight-color: transparent; /* 2 */
88-
-webkit-text-size-adjust: 100%; /* 3 */
89-
-ms-text-size-adjust: 100%;
74+
font-size: 100%; /* 1 */
75+
overflow-y: scroll; /* 2 */
76+
-webkit-tap-highlight-color: rgba(0,0,0,0); /* 3 */
77+
-webkit-text-size-adjust: 100%; /* 4 */
78+
-ms-text-size-adjust: 100%; /* 4 */
9079
}
9180

9281
/*
93-
* Set the base font-size for the document without prevent text resizing in IE6/7
9482
* N.B. Remember to add a max-width to <body> or container elements as a fallback in certain desktop environments
9583
*/
9684

@@ -107,30 +95,27 @@ body {
10795
*/
10896

10997
body,
110-
input,
11198
button,
112-
textarea,
113-
select {
99+
input,
100+
select,
101+
textarea {
114102
font-family: sans-serif;
115103
color: #333;
116104
}
117105

118106
/*
119-
* 1. Prevent border in IE6/7 when <img> is within <a>
120-
* 2. Allow high quality bicubic image resampling for <img> element
121-
* Improves readability when scaled in IE
122-
* - (Read before using) http://code.flickr.com/blog/2008/11/12/on-ui-quality-the-little-things-client-side-image-resizing/
107+
* Allow high quality bicubic image resampling for <img> element
108+
* Improves readability when scaled in IE
123109
*/
124110

125111
img {
126-
border: 0; /* 1 */
127-
/* -ms-interpolation-mode: bicubic; */ /* 2 */
112+
border: 0;
113+
/* -ms-interpolation-mode: bicubic; */
128114
}
129115

130116
/*
131117
* Selection highlight
132-
* 1. Remove text-shadow to ensure readability is not compromised
133-
* - http://camendesign.com/design/
118+
* Remove text-shadow to ensure readability is not compromised
134119
*/
135120

136121
::-moz-selection {
@@ -162,7 +147,6 @@ a:active {
162147
/*
163148
* Remove outline on <a> element when active or hovered
164149
* Improves readability when focused and then also mouse activated
165-
* - http://people.opera.com/patrickl/experiments/keyboard/test
166150
*/
167151

168152
a:hover,
@@ -203,10 +187,6 @@ dd {
203187
margin: 0 0 0 40px;
204188
}
205189

206-
/*
207-
* Remove margin and bullets from lists in <nav> elements
208-
*/
209-
210190
nav ul,
211191
nav li {
212192
list-style: none;
@@ -216,66 +196,33 @@ nav li {
216196

217197
/* ............................................................................................................. General typography */
218198

219-
/*
220-
* Add a visual indication that an abbreviation's expansion is available
221-
* Styling not present in IE6/7/8/9, S4/5, Chrome
222-
*/
223-
224199
abbr[title] {
225200
border-bottom: 1px dotted;
226201
}
227202

228-
/*
229-
* Remove default italic font-size from <address>
230-
*/
231-
232203
address {
233204
font-style: normal;
234205
}
235206

236-
/*
237-
* Add bold font weight to <b> and <strong> elements
238-
* Fixes style set to 'bolder' in FF3/4, S4/5, Chrome
239-
*/
240-
241207
b,
242208
strong {
243209
font-weight: bold;
244210
}
245211

246-
247-
/*
248-
* Consistent blockquote indentation
249-
*/
250-
251212
blockquote {
252-
margin: 1.4em 0 1.4em 30px;
213+
margin: 1.4em 40px;
253214
}
254215

255-
/*
256-
* Add italic font style to <dfn> element
257-
* Styling not present in S5, Chrome
258-
*/
259-
260216
dfn {
261217
font-style: italic;
262218
}
263-
264-
/*
265-
* Remove underline from <ins> so it is not confused with links
266-
*/
267219

268220
ins {
269221
text-decoration: none;
270222
color: #000;
271223
background-color: #ff9;
272224
}
273225

274-
/*
275-
* Add yellow background and black text to <mark> element
276-
* Styling not present in IE6/7/8/9
277-
*/
278-
279226
mark {
280227
font-weight: bold;
281228
color: #000;
@@ -296,16 +243,14 @@ pre {
296243
/*
297244
* Redeclare monospace font family and include a san-serif fallback
298245
* Fix so that these elements can then be given normal font size
299-
* - http://en.wikipedia.org/wiki/User:Davidgothberg/Test59
300-
* 1. Fixes monospace font family set oddly in IE6
301246
*/
302247

303248
pre,
304249
code,
305250
kbd,
306251
samp {
307252
font-family: monospace, monospace;
308-
_font-family: 'Courier New', monospace, monospace; /* 1 */
253+
_font-family: 'Courier New', monospace;
309254
font-size: 1em;
310255
}
311256

@@ -326,18 +271,13 @@ q:after {
326271
content: "";
327272
}
328273

329-
/*
330-
* Define font-size and alignment for <small> element
331-
*/
332-
333274
small {
334275
font-size: 75%;
335276
}
336277

337278
/*
338279
* Position subscript and superscript content without affecting line-height
339280
* Fixes alignment within multi-line text displayed oddly in all browsers
340-
* - http://gist.github.com/413930
341281
*/
342282

343283
sup,
@@ -368,31 +308,21 @@ fieldset {
368308
margin: 0;
369309
}
370310

371-
/*
372-
* Correct left alignment of <legend> element in IE6/7
373-
*/
374-
375311
legend {
376312
*margin-left: -7px;
377313
}
378314

379315
/*
380316
* Normalise form elements
381317
* 1. Remove extra inner space from <input> and <button> in IE6/7
382-
* - http://jehiah.cz/a/button-width-in-ie
383318
* 2. Remove margins from form elements
384-
* All elements have a 2px margin in Chrome10 & Safari5.
385-
* All <textarea> have 1px vertical margins in Firefox.
386-
* 3. Make font-size equal to body default
319+
* 3. Make font-size equal to ancestor's
387320
* 4. Have all browsers use the same line-height.
388-
* Firefox doesn't allow control of line-height for <input> and <button>.
389-
* Corrects button line-height in IE6.
390321
* 5. Standardised vertical-align
391-
* IE defaults to 'auto'. Firefox defaults to 'text-bottom' for <textarea>
392322
*/
393323

394-
input,
395324
button,
325+
input,
396326
select,
397327
textarea {
398328
overflow: visible; /* 1 */
@@ -405,16 +335,14 @@ textarea {
405335

406336
/*
407337
* 1. Display hand cursor for submission elements
408-
* Improves usability and consistency of cursor style between image-type <input> and others
409-
* 2. Define consistent appearance for clickable form elements
410-
* Fixes inability to style clickable <input> types in iOS
338+
* 2. Fixes inability to style clickable <input> types in iOS
411339
*/
412340

341+
button,
413342
input[type="button"],
414-
input[type="submit"],
415-
button {
416-
cursor: pointer;
417-
-webkit-appearance: button;
343+
input[type="submit"] {
344+
cursor: pointer; /* 1 */
345+
-webkit-appearance: button; /* 2 */
418346
}
419347

420348

@@ -441,6 +369,15 @@ input[type="search"] {
441369
box-sizing: content-box;
442370
}
443371

372+
/*
373+
* Remove WebKit search decoration
374+
* Addresses inner padding displaying oddly in S5 Chrome on OSX
375+
*/
376+
377+
input[type="search"]::-webkit-search-decoration {
378+
-webkit-appearance: none;
379+
}
380+
444381
/*
445382
* Remove extra inner padding and border in FF3/4
446383
* - http://www.sitepen.com/blog/2008/05/14/the-devils-in-the-details-fixing-dojos-toolbar-buttons/
@@ -453,10 +390,8 @@ button::-moz-focus-inner {
453390
}
454391

455392
/*
456-
* 1. Disable default horizontal scrollbar for <textarea> element
457-
* Scrollbar displayed by default in IE6/7/8/9
393+
* 1. Disable default horizontal scrollbar for <textarea> element in IE6/7/8/9
458394
* 2. Align <textarea> with top when inline
459-
* Improves usability and corrects baseline inconsistency in Firefox 3/4
460395
*/
461396

462397
textarea {
@@ -493,7 +428,6 @@ td {
493428
* Clear an element's floated children using generated content
494429
* Inclusion of :before consistently prevents margin collapse in modern browsers
495430
* Improves visual consistency between modern browsers and IE6/7
496-
* - http://nicolasgallagher.com/micro-clearfix-hack/
497431
*/
498432

499433
.cf {
@@ -520,9 +454,9 @@ td {
520454

521455

522456

523-
/* ============================================================================================================================ **
524-
** S C R E E N (480+)
525-
** ============================================================================================================================ */
457+
/* ============================================================================================================= **
458+
** S C R E E N (480+)
459+
** ============================================================================================================= */
526460

527461
@media only screen and (min-width: 480px) {
528462

@@ -537,9 +471,9 @@ td {
537471

538472

539473

540-
/* ============================================================================================================================ **
541-
** S C R E E N (768+)
542-
** ============================================================================================================================ */
474+
/* ============================================================================================================= **
475+
** S C R E E N (768+)
476+
** ============================================================================================================= */
543477

544478
@media only screen and (min-width: 768px) {
545479

@@ -554,15 +488,14 @@ td {
554488

555489

556490

557-
/* ============================================================================================================================ **
558-
** P R I N T
559-
** ============================================================================================================================ */
491+
/* ============================================================================================================= **
492+
** P R I N T
493+
** ============================================================================================================= */
560494

561495
@media print {
562496

563497
/*
564498
* Print-only style adjustements inlined to avoid required HTTP connection
565-
* - http://www.phpied.com/delay-loading-your-print-css/
566499
*/
567500

568501
* {

0 commit comments

Comments
 (0)