Skip to content

Commit b1e640c

Browse files
committed
Update CSS to incorporate latest work from normalize.css, use equivalent of 16px font-size default, set ::selection highlight to behave like default OS X text selection. Update demo to include more tests and more obvious clearfix test.
1 parent c3925a7 commit b1e640c

File tree

2 files changed

+76
-69
lines changed

2 files changed

+76
-69
lines changed

css/default.css

+70-62
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* LE BOILERPLATE, Nicolas Gallagher 2011-07-15T17:39 UTC · http://github.com/necolas/le-boilerplate */
1+
/* 2011-08-13T01:25 UTC · http://github.com/necolas/le-boilerplate */
22

33
/*
44
* ALL MEDIA
@@ -7,62 +7,62 @@
77
* PRINT
88
*/
99

10-
/* ============================================================================================================= ALL */
1110

12-
/*
13-
* Styles affecting all viewport widths and print (keep linear and fluid)
14-
*/
11+
/* ============================================================================ HTML5 ELEMENT DISPLAY */
1512

16-
/* ============================================================================= HTML5 ELEMENT DISPLAY */
17-
18-
header,
19-
section,
20-
article,
21-
aside,
13+
article,
14+
aside,
15+
details,
16+
figcaption,
17+
figure,
2218
footer,
23-
nav,
24-
menu,
25-
hgroup,
26-
figure,
27-
figcaption,
28-
details,
29-
summary {
19+
header,
20+
hgroup,
21+
nav,
22+
section {
3023
display: block;
3124
}
3225

33-
audio[controls],
26+
audio,
3427
canvas,
3528
video {
3629
display: inline-block;
3730
*display: inline;
3831
*zoom: 1;
3932
}
4033

34+
audio:not([controls]) {
35+
display: none;
36+
}
37+
38+
[hidden] {
39+
display: none;
40+
}
41+
4142

42-
/* ============================================================================= BASE */
43+
/* ============================================================================ BASE */
4344

4445
/*
4546
* 1. Prevent text resizing oddly in IE6/7 when body font-size is set using em units
4647
* 2. Keep page centred in all browsers regardless of content height
47-
* 3. Remove Android and iOS tap highlight color; prevent entire container being highlighted
48-
* 4. Remove iOS text size adjust without disabling user zoom
48+
* 3. Remove iOS text size adjust without disabling user zoom
4949
*/
5050

5151
html {
5252
font-size: 100%; /* 1 */
5353
overflow-y: scroll; /* 2 */
54-
-webkit-tap-highlight-color: rgba(0,0,0,0); /* 3 */
55-
-webkit-text-size-adjust: 100%; /* 4 */
56-
-ms-text-size-adjust: 100%; /* 4 */
54+
-webkit-text-size-adjust: 100%; /* 3 */
55+
-ms-text-size-adjust: 100%; /* 3 */
5756
}
5857

5958
/*
60-
* N.B. Add a max-width to body/container as a fallback in certain desktop environments
59+
* N.B. Add a max-width to body/container as a fallback in desktop environments with
60+
* no Media Query support or polyfill
6161
*/
6262

6363
body {
6464
margin: 0;
65-
font-size: 0.875em; /* 14px */
65+
font-size: 1em; /* 16px */
6666
line-height: 1.4;
6767
background: #fff;
6868
}
@@ -78,22 +78,21 @@ textarea {
7878

7979
/*
8080
* Remove selection highlight text-shadow to ensure readability is not compromised
81+
* Set selection highlight background to match OSX default
8182
*/
8283

8384
::-moz-selection {
8485
text-shadow: none;
85-
color: #fff;
86-
background: #ff5e99;
86+
background: #b3d4fc;
8787
}
8888

8989
::selection {
9090
text-shadow: none;
91-
color: #fff;
92-
background: #ff5e99;
91+
background: #b3d4fc;
9392
}
9493

9594

96-
/* ============================================================================= LINKS */
95+
/* ============================================================================ LINKS */
9796

9897
a,
9998
a:visited {
@@ -122,7 +121,7 @@ a:active {
122121
}
123122

124123

125-
/* ============================================================================= TYPOGRAPHY */
124+
/* ============================================================================ TYPOGRAPHY */
126125

127126
h1 {}
128127
h2 {}
@@ -139,7 +138,7 @@ dl {
139138
margin: 1.4em 0;
140139
}
141140

142-
/* ............................................................................. Lists */
141+
/* ............................................................................ Lists */
143142

144143
ul,
145144
ol {
@@ -164,7 +163,7 @@ nav li {
164163
margin: 0;
165164
}
166165

167-
/* ............................................................................. Inline */
166+
/* ............................................................................ Inline */
168167

169168
abbr[title] {
170169
border-bottom: 1px dotted;
@@ -219,8 +218,8 @@ pre,
219218
code,
220219
kbd,
221220
samp {
222-
font-family: monospace, monospace;
223-
_font-family: 'Courier New', monospace;
221+
font-family: monospace, serif;
222+
_font-family: 'Courier New', serif;
224223
font-size: 1em;
225224
}
226225

@@ -239,7 +238,6 @@ small {
239238

240239
/*
241240
* Prevent sub and sup affecting line-height in all browsers
242-
* gist.github.com/413930
243241
*/
244242

245243
sup,
@@ -259,12 +257,11 @@ sub {
259257
}
260258

261259

262-
/* ============================================================================= EMBEDDED CONTENT */
260+
/* ============================================================================ EMBEDDED CONTENT */
263261

264262
/*
265263
* 1. Remove border when inside 'a' element in IE6/7/8/9
266264
* 2. Improve image quality when scaled in IE7
267-
* code.flickr.com/blog/2008/11/12/on-ui-quality-the-little-things-client-side-image-resizing/
268265
*/
269266

270267
img {
@@ -281,7 +278,14 @@ svg:not(:root) {
281278
}
282279

283280

284-
/* ============================================================================= FORMS */
281+
/* ============================================================================ FORMS */
282+
283+
figure {
284+
margin: 0;
285+
}
286+
287+
288+
/* ============================================================================ FORMS */
285289

286290
form {
287291
margin: 0;
@@ -300,26 +304,28 @@ legend {
300304

301305
/*
302306
* 1. Remove extra inner space from 'input' and 'button' in IE6/7
303-
* 2. Remove margins from form elements
304-
* 3. Make font-size equal to ancestor's
305-
* 4. Have all browsers use the same line-height.
306-
* 5. Remove :focus outline offset in WebKit
307-
* 6. Standardise vertical-align
307+
* 2. Make font-size equal to ancestor's
308+
* 3. Have all browsers use the same line-height.
309+
* 4. Standardise vertical-align
308310
*/
309311

310312
button,
311313
input,
312314
select,
313315
textarea {
314316
overflow: visible; /* 1 */
315-
margin: 0; /* 2 */
316-
font-size: 100%; /* 3 */
317-
line-height: normal; /* 4 */
318-
outline-offset: 0; /* 5 */
319-
vertical-align: baseline; /* 6 */
317+
margin: 0;
318+
font-size: 100%; /* 2 */
319+
line-height: normal; /* 3 */
320+
vertical-align: baseline; /* 4 */
320321
*vertical-align: middle;
321322
}
322323

324+
table button,
325+
table input {
326+
*overflow: auto;
327+
}
328+
323329
/*
324330
* 1. Display hand cursor for submission elements
325331
* 2. Fix inability to style clickable 'input' types in iOS
@@ -340,18 +346,21 @@ input[type="submit"] {
340346
input[type="checkbox"],
341347
input[type="radio"] {
342348
box-sizing: border-box;
349+
padding: 0;
343350
}
344351

345352
/*
346-
* 1. Fix ability to fully style search inputs in WebKit browsers
353+
* 1. Fix inability to fully style search inputs in WebKit browsers
347354
* 2. Fix box sizing set to border-box in S5, Chrome
355+
* 3. Set outline offset to match other textfields
348356
*/
349357

350358
input[type="search"] {
351359
-webkit-appearance: textfield; /* 1 */
352360
-moz-box-sizing: content-box;
353361
-webkit-box-sizing: content-box; /* 2 */
354362
box-sizing: content-box;
363+
outline-offset: -2px; /* 3 */
355364
}
356365

357366
/*
@@ -385,7 +394,7 @@ textarea {
385394
}
386395

387396

388-
/* ============================================================================= TABLES */
397+
/* ============================================================================ TABLES */
389398

390399
/*
391400
* Remove most spacing between table cells
@@ -406,13 +415,12 @@ td {
406415
}
407416

408417

409-
/* ============================================================================= HELPER CLASSES */
418+
/* ============================================================================ HELPER CLASSES */
410419

411-
/* ............................................................................. Clearfix */
420+
/* ............................................................................ Clearfix */
412421

413422
/*
414423
* Clear an element's floated children using generated content
415-
* nicolasgallagher.com/micro-clearfix-hack/
416424
*/
417425

418426
.cf {
@@ -429,7 +437,7 @@ td {
429437
clear: both;
430438
}
431439

432-
/* ............................................................................. Hidden */
440+
/* ............................................................................ Hidden */
433441

434442
/*
435443
* Hide visually and for screenreaders
@@ -441,7 +449,7 @@ td {
441449
}
442450

443451

444-
/* ============================================================================= COMPONENTS */
452+
/* ============================================================================ COMPONENTS */
445453

446454

447455

@@ -452,12 +460,12 @@ td {
452460

453461

454462

455-
/* ============================================================================================================= SCREEN (480+) */
463+
/* ========================================================================================================== SCREEN (480+) */
456464

457465
@media screen and (min-width: 480px) {
458466

459467
/*
460-
* Screen-only style adjustmenets for viewport widths 480px to 780px
468+
* Screen-only style adjustmenets for viewport widths 480px to 768px
461469
*/
462470

463471

@@ -467,7 +475,7 @@ td {
467475

468476

469477

470-
/* ============================================================================================================= SCREEN (768+) */
478+
/* ========================================================================================================== SCREEN (768+) */
471479

472480
@media screen and (min-width: 768px) {
473481

@@ -482,7 +490,7 @@ td {
482490

483491

484492

485-
/* ============================================================================================================= PRINT */
493+
/* ========================================================================================================== PRINT */
486494

487495
@media print {
488496

demo.html

+6-7
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
<div>
1414

15-
<header>
15+
<header>
1616
<hgroup>
1717
<h1>Grouped Heading 1</h1>
1818
<h2>Grouped Heading 2</h2>
@@ -32,6 +32,8 @@ <h3>Heading 3</h3>
3232
<h4>Heading 4</h4>
3333
<h5>Heading 5</h5>
3434
<h6>Heading 6</h6>
35+
36+
<p hidden>This should be hidden in all browsers, apart from IE6</p>
3537

3638
<section>
3739
<h1>Section Heading 1</h1>
@@ -47,12 +49,12 @@ <h1>Text-level semantics</h1>
4749

4850
<p>
4951
The <a href="#">a element</a> example<br>
50-
The <abbr>abbr element</abbr> and <abbr title="Title text">abbr element with title</abbr> example<br>
52+
The <abbr>abbr element</abbr> and <abbr title="Title text">abbr element with title</abbr> examples<br>
5153
The <b>b element</b> example<br>
5254
The <cite>cite element</cite> example<br>
5355
The <code>code element</code> example<br>
5456
The <del>del element</del> example<br>
55-
The <dfn>dfn element</dfn> example<br>
57+
The <dfn>dfn element</dfn> and <dfn title="Title text">dfn element with title</dfn> examples<br>
5658
The <em>em element</em> example<br>
5759
The <i>i element</i> example<br>
5860
The img element <img src="http://placekitten.com/16/16" alt=""> example<br>
@@ -309,7 +311,7 @@ <h1>Forms</h1>
309311
</fieldset>
310312
</form>
311313

312-
<div class="cf" style="margin-top:20px; background:#ddd;">
314+
<div class="cf" style="margin-top:20px; background:yellow;">
313315
<h3>clearfix test</h3>
314316
<div style="float:left; width:48%; height:100px; margin:0 1% 0 20px; background:#ccc;">float</div>
315317
<div style="height:50px; background:#aaa;">non-float</div>
@@ -320,8 +322,5 @@ <h3>clearfix test</h3>
320322
<!-- jQuery CDN and fallback -->
321323
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js"></script>
322324
<script>window.jQuery || document.write('<script src="/js/libs/jquery-1.6.2.min.js">\x3C/script>')</script>
323-
<!-- scripts concatenated and minified via ant build script-->
324-
<script src="/js/helpers.js"></script>
325-
<!-- end scripts-->
326325
</body>
327326
</html>

0 commit comments

Comments
 (0)