From 3d15366f129e1deb6b4b6c36d6a913fe432fd4de Mon Sep 17 00:00:00 2001 From: Nicolas Gallagher Date: Fri, 1 Jun 2012 22:23:31 +0100 Subject: [PATCH 1/5] Add multi-line CSS format Move to a more sensible and readable multi-line CSS format. Better for diffs too. --- css/style.css | 505 +++++++++++++++++++++++++++++++++++++++++--------- 1 file changed, 418 insertions(+), 87 deletions(-) diff --git a/css/style.css b/css/style.css index f4a3a44bc4..0dcc599c43 100644 --- a/css/style.css +++ b/css/style.css @@ -15,10 +15,35 @@ HTML5 display definitions ========================================================================== */ -article, aside, details, figcaption, figure, footer, header, hgroup, nav, section { display: block; } -audio, canvas, video { display: inline-block; *display: inline; *zoom: 1; } -audio:not([controls]) { display: none; } -[hidden] { display: none; } +article, +aside, +details, +figcaption, +figure, +footer, +header, +hgroup, +nav, +section, +summary { + display: block; +} + +audio, +canvas, +video { + display: inline-block; + *display: inline; + *zoom: 1; +} + +audio:not([controls]) { + display: none; +} + +[hidden] { + display: none; +} /* ============================================================================= @@ -30,11 +55,26 @@ audio:not([controls]) { display: none; } * 2. Prevent iOS text size adjust on device orientation change, without disabling user zoom: h5bp.com/g */ -html { font-size: 100%; -webkit-text-size-adjust: 100%; -ms-text-size-adjust: 100%; } +html { + font-size: 100%; + -webkit-text-size-adjust: 100%; + -ms-text-size-adjust: 100%; +} -html, button, input, select, textarea { font-family: sans-serif; color: #222; } +html, +button, +input, +select, +textarea { + font-family: sans-serif; + color: #222; +} -body { margin: 0; font-size: 1em; line-height: 1.4; } +body { + margin: 0; + font-size: 1em; + line-height: 1.4; +} /* * Remove text-shadow in selection highlight: h5bp.com/i @@ -42,65 +82,169 @@ body { margin: 0; font-size: 1em; line-height: 1.4; } * Customize the background color to match your design. */ -::-moz-selection { background: #b3d4fc; text-shadow: none; } -::selection { background: #b3d4fc; text-shadow: none; } +::-moz-selection { + background: #b3d4fc; + text-shadow: none; +} + +::selection { + background: #b3d4fc; + text-shadow: none; +} /* ============================================================================= Links ========================================================================== */ -a { color: #00e; } -a:visited { color: #551a8b; } -a:hover { color: #06e; } -a:focus { outline: thin dotted; } +a { + color: #00e; +} + +a:visited { + color: #551a8b; +} + +a:hover { + color: #06e; +} + +a:focus { + outline: thin dotted; +} + +/* + * Improve readability when focused and hovered in all browsers: h5bp.com/h + */ -/* Improve readability when focused and hovered in all browsers: h5bp.com/h */ -a:hover, a:active { outline: 0; } +a:hover, +a:active { + outline: 0; +} /* ============================================================================= Typography ========================================================================== */ -abbr[title] { border-bottom: 1px dotted; } +abbr[title] { + border-bottom: 1px dotted; +} + +b, +strong { + font-weight: bold; +} + +blockquote { + margin: 1em 40px; +} + +dfn { + font-style: italic; +} + +hr { + display: block; + height: 1px; + border: 0; + border-top: 1px solid #ccc; + margin: 1em 0; + padding: 0; +} + +ins { + background: #ff9; + color: #000; + text-decoration: none; +} -b, strong { font-weight: bold; } +mark { + background: #ff0; + color: #000; + font-style: italic; + font-weight: bold; +} -blockquote { margin: 1em 40px; } +/* + * Redeclare monospace font family: h5bp.com/j + */ -dfn { font-style: italic; } +pre, +code, +kbd, +samp { + font-family: monospace, serif; + _font-family: 'courier new', monospace; + font-size: 1em; +} + +/* + * Improve readability of pre-formatted text + */ -hr { display: block; height: 1px; border: 0; border-top: 1px solid #ccc; margin: 1em 0; padding: 0; } +pre { + white-space: pre; + white-space: pre-wrap; + word-wrap: break-word; +} -ins { background: #ff9; color: #000; text-decoration: none; } +q { + quotes: none; +} -mark { background: #ff0; color: #000; font-style: italic; font-weight: bold; } +q:before, +q:after { + content: ""; + content: none; +} -/* Redeclare monospace font family: h5bp.com/j */ -pre, code, kbd, samp { font-family: monospace, serif; _font-family: 'courier new', monospace; font-size: 1em; } +small { + font-size: 85%; +} -/* Improve readability of pre-formatted text in all browsers */ -pre { white-space: pre; white-space: pre-wrap; word-wrap: break-word; } +/* + * Position subscript and superscript content without affecting line-height: h5bp.com/k + */ -q { quotes: none; } -q:before, q:after { content: ""; content: none; } +sub, +sup { + font-size: 75%; + line-height: 0; + position: relative; + vertical-align: baseline; +} -small { font-size: 85%; } +sup { + top: -0.5em; +} -/* Position subscript and superscript content without affecting line-height: h5bp.com/k */ -sub, sup { font-size: 75%; line-height: 0; position: relative; vertical-align: baseline; } -sup { top: -0.5em; } -sub { bottom: -0.25em; } +sub { + bottom: -0.25em; +} /* ============================================================================= Lists ========================================================================== */ -ul, ol { margin: 1em 0; padding: 0 0 0 40px; } -dd { margin: 0 0 0 40px; } -nav ul, nav ol { list-style: none; list-style-image: none; margin: 0; padding: 0; } +ul, +ol { + margin: 1em 0; + padding: 0 0 0 40px; +} + +dd { + margin: 0 0 0 40px; +} + +nav ul, +nav ol { + list-style: none; + list-style-image: none; + margin: 0; + padding: 0; +} /* ============================================================================= @@ -112,38 +256,63 @@ nav ul, nav ol { list-style: none; list-style-image: none; margin: 0; padding: 0 * 2. Remove the gap between images and borders on image containers: h5bp.com/i/440 */ -img { border: 0; -ms-interpolation-mode: bicubic; vertical-align: middle; } +img { + border: 0; + vertical-align: middle; + -ms-interpolation-mode: bicubic; +} /* * Correct overflow not hidden in IE9 */ -svg:not(:root) { overflow: hidden; } +svg:not(:root) { + overflow: hidden; +} /* ============================================================================= Figures ========================================================================== */ -figure { margin: 0; } +figure { + margin: 0; +} /* ============================================================================= Forms ========================================================================== */ -form { margin: 0; } -fieldset { border: 0; margin: 0; padding: 0; } +form { + margin: 0; +} + +fieldset { + border: 0; + margin: 0; + padding: 0; +} + +/* + * Indicate that 'label' will shift focus to the associated form element + */ -/* Indicate that 'label' will shift focus to the associated form element */ -label { cursor: pointer; } +label { + cursor: pointer; +} /* * 1. Correct color not inheriting in IE6/7/8/9 * 2. Correct alignment displayed oddly in IE6/7 */ -legend { border: 0; *margin-left: -7px; padding: 0; white-space: normal; } +legend { + border: 0; + padding: 0; + white-space: normal; + *margin-left: -7px; +} /* * 1. Correct font-size not inheriting in all browsers @@ -151,13 +320,24 @@ legend { border: 0; *margin-left: -7px; padding: 0; white-space: normal; } * 3. Define consistent vertical alignment display in all browsers */ -button, input, select, textarea { font-size: 100%; margin: 0; vertical-align: baseline; *vertical-align: middle; } +button, +input, +select, +textarea { + font-size: 100%; + margin: 0; + vertical-align: baseline; + *vertical-align: middle; +} /* * 1. Define line-height as normal to match FF3/4 (set using !important in the UA stylesheet) */ -button, input { line-height: normal; } +button, +input { + line-height: normal; +} /* * 1. Display hand cursor for clickable form elements @@ -165,53 +345,94 @@ button, input { line-height: normal; } * 3. Correct inner spacing displayed oddly in IE7 (doesn't effect IE6) */ -button, input[type="button"], input[type="reset"], input[type="submit"] { cursor: pointer; -webkit-appearance: button; *overflow: visible; } +button, +input[type="button"], +input[type="reset"], +input[type="submit"] { + cursor: pointer; + -webkit-appearance: button; + *overflow: visible; +} /* * Re-set default cursor for disabled elements */ -button[disabled], input[disabled] { cursor: default; } +button[disabled], +input[disabled] { + cursor: default; +} /* * Consistent box sizing and appearance */ -input[type="checkbox"], input[type="radio"] { box-sizing: border-box; padding: 0; *width: 13px; *height: 13px; } -input[type="search"] { -webkit-appearance: textfield; -moz-box-sizing: content-box; -webkit-box-sizing: content-box; box-sizing: content-box; } -input[type="search"]::-webkit-search-decoration, input[type="search"]::-webkit-search-cancel-button { -webkit-appearance: none; } +input[type="checkbox"], +input[type="radio"] { + box-sizing: border-box; + padding: 0; + *width: 13px; + *height: 13px; +} + +input[type="search"] { + -webkit-appearance: textfield; + -moz-box-sizing: content-box; + -webkit-box-sizing: content-box; + box-sizing: content-box; +} + +input[type="search"]::-webkit-search-decoration, +input[type="search"]::-webkit-search-cancel-button { + -webkit-appearance: none; +} /* * Remove inner padding and border in FF3/4: h5bp.com/l */ -button::-moz-focus-inner, input::-moz-focus-inner { border: 0; padding: 0; } +button::-moz-focus-inner, +input::-moz-focus-inner { + border: 0; + padding: 0; +} /* * 1. Remove default vertical scrollbar in IE6/7/8/9 * 2. Allow only vertical resizing */ -textarea { overflow: auto; vertical-align: top; resize: vertical; } - -/* Colors for form validity */ -input:valid, textarea:valid { } -input:invalid, textarea:invalid { background-color: #f0dddd; } +textarea { + overflow: auto; + vertical-align: top; + resize: vertical; +} /* ============================================================================= Tables ========================================================================== */ -table { border-collapse: collapse; border-spacing: 0; } -td { vertical-align: top; } +table { + border-collapse: collapse; + border-spacing: 0; +} + +td { + vertical-align: top; +} /* ============================================================================= Chrome Frame Prompt ========================================================================== */ -.chromeframe { margin: 0.2em 0; background: #ccc; color: black; padding: 0.2em 0; } +.chromeframe { + margin: 0.2em 0; + background: #ccc; + color: #000; + padding: 0.2em 0; +} /* ==|== primary styles ===================================================== @@ -240,7 +461,7 @@ td { vertical-align: top; } ========================================================================== */ @media only screen and (min-width: 35em) { - /* Style adjustments for viewports that meet the condition */ + /* Style adjustments for viewports that meet the condition */ } @@ -249,25 +470,82 @@ td { vertical-align: top; } Please define your styles before this section. ========================================================================== */ -/* For image replacement */ -.ir { border: 0; font: 0/0 a; text-shadow: none; color: transparent; background-color: transparent; } +/* + * Image replacement + */ + +.ir { + border: 0; + font: 0/0 a; + text-shadow: none; + color: transparent; + background-color: transparent; +} + +/* + * Hide from both screenreaders and browsers: h5bp.com/u + */ + +.hidden { + display: none !important; + visibility: hidden; +} + +/* + * Hide only visually, but have it available for screenreaders: h5bp.com/v + */ + +.visuallyhidden { + border: 0; + clip: rect(0 0 0 0); + height: 1px; + margin: -1px; + overflow: hidden; + padding: 0; + position: absolute; + width: 1px; +} + +/* + * Extends the .visuallyhidden class to allow the element to be focusable + * when navigated to via the keyboard: h5bp.com/p + */ + +.visuallyhidden.focusable:active, +.visuallyhidden.focusable:focus { + clip: auto; + height: auto; + margin: 0; + overflow: visible; + position: static; + width: auto; +} + +/* + * Hide visually and from screenreaders, but maintain layout + */ -/* Hide from both screenreaders and browsers: h5bp.com/u */ -.hidden { display: none !important; visibility: hidden; } +.invisible { + visibility: hidden; +} -/* Hide only visually, but have it available for screenreaders: h5bp.com/v */ -.visuallyhidden { border: 0; clip: rect(0 0 0 0); height: 1px; margin: -1px; overflow: hidden; padding: 0; position: absolute; width: 1px; } +/* + * Contain floats: h5bp.com/q + */ -/* Extends the .visuallyhidden class to allow the element to be focusable when navigated to via the keyboard: h5bp.com/p */ -.visuallyhidden.focusable:active, .visuallyhidden.focusable:focus { clip: auto; height: auto; margin: 0; overflow: visible; position: static; width: auto; } +.clearfix:before, +.clearfix:after { + content: ""; + display: table; +} -/* Hide visually and from screenreaders, but maintain layout */ -.invisible { visibility: hidden; } +.clearfix:after { + clear: both; +} -/* Contain floats: h5bp.com/q */ -.clearfix:before, .clearfix:after { content: ""; display: table; } -.clearfix:after { clear: both; } -.clearfix { *zoom: 1; } +.clearfix { + *zoom: 1; +} @@ -277,16 +555,69 @@ td { vertical-align: top; } ========================================================================== */ @media print { - * { background: transparent !important; color: black !important; box-shadow:none !important; text-shadow: none !important; } /* Black prints faster: h5bp.com/s */ - a, a:visited { text-decoration: underline; } - a[href]:after { content: " (" attr(href) ")"; } - abbr[title]:after { content: " (" attr(title) ")"; } - .ir a:after, a[href^="javascript:"]:after, a[href^="#"]:after { content: ""; } /* Don't show links for images, or javascript/internal links */ - pre, blockquote { border: 1px solid #999; page-break-inside: avoid; } - thead { display: table-header-group; } /* h5bp.com/t */ - tr, img { page-break-inside: avoid; } - img { max-width: 100% !important; } - @page { margin: 0.5cm; } - p, h2, h3 { orphans: 3; widows: 3; } - h2, h3 { page-break-after: avoid; } + * { + background: transparent !important; + color: #000 !important; /* Black prints faster: h5bp.com/s */ + box-shadow:none !important; + text-shadow: none !important; + } + + a, + a:visited { + text-decoration: underline; + } + + a[href]:after { + content: " (" attr(href) ")"; + } + + abbr[title]:after { + content: " (" attr(title) ")"; + } + + /* + * Don't show links for images, or javascript/internal links + */ + + .ir a:after, + a[href^="javascript:"]:after, + a[href^="#"]:after { + content: ""; + } + + pre, + blockquote { + border: 1px solid #999; + page-break-inside: avoid; + } + + thead { + display: table-header-group; /* h5bp.com/t */ + } + + tr, + img { + page-break-inside: avoid; + } + + img { + max-width: 100% !important; + } + + @page { + margin: 0.5cm; + } + + p, + h2, + h3 { + orphans: 3; + widows: 3; + } + + h2, + h3 { + page-break-after: avoid; + } } + From 9536f79ab1c10f562600651337cbd5794e69b301 Mon Sep 17 00:00:00 2001 From: Nicolas Gallagher Date: Fri, 1 Jun 2012 23:13:30 +0100 Subject: [PATCH 2/5] Use 4 spaces for indentation; capitalize DOCTYPE Four spaces is generally the most common indentation level, and particularly common for CSS. Capitalized the DOCTYPE both to avoid issues being created about it, and to adhere to a more common pattern. Added closing tags to the 404 for the same reasons. --- 404.html | 192 ++++++++++++++++++++++++++++++++++++++++++----------- index.html | 73 ++++++++++---------- 2 files changed, 191 insertions(+), 74 deletions(-) diff --git a/404.html b/404.html index 9b5c0f7e60..db90ae5b54 100644 --- a/404.html +++ b/404.html @@ -1,42 +1,158 @@ - + - - Page Not Found :( - + + Page Not Found :( + -
-

Not found :(

-

Sorry, but the page you were trying to view does not exist.

-

It looks like this was the result of either:

-
    -
  • a mistyped address
  • -
  • an out-of-date link
  • -
- - -
\ No newline at end of file +
+

Not found :(

+

Sorry, but the page you were trying to view does not exist.

+

It looks like this was the result of either:

+
    +
  • a mistyped address
  • +
  • an out-of-date link
  • +
+ + +
+ + + diff --git a/index.html b/index.html index cc67900561..e740e67e6d 100644 --- a/index.html +++ b/index.html @@ -1,59 +1,60 @@ - + - + - - + + - - + + - - + + - + - + - + - - + + - - + + - + - + - - - + + + - - - - + + + + - - + + + From 88ba292bd8c4681710d140a19d42df40ab1da384 Mon Sep 17 00:00:00 2001 From: Nicolas Gallagher Date: Fri, 1 Jun 2012 23:25:05 +0100 Subject: [PATCH 3/5] Plugins.js format update Make the file readable. --- js/plugins.js | 44 +++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 41 insertions(+), 3 deletions(-) diff --git a/js/plugins.js b/js/plugins.js index c307c245eb..b47f65a54c 100644 --- a/js/plugins.js +++ b/js/plugins.js @@ -1,10 +1,48 @@ // usage: log('inside coolFunc', this, arguments); // paulirish.com/2009/log-a-lightweight-wrapper-for-consolelog/ -window.log = function f(){ log.history = log.history || []; log.history.push(arguments); if(this.console) { var args = arguments, newarr; try { args.callee = f.caller } catch(e) {}; newarr = [].slice.call(args); if (typeof console.log === 'object') log.apply.call(console.log, console, newarr); else console.log.apply(console, newarr);}}; + +window.log = function f() { + log.history = log.history || []; + log.history.push(arguments); + if (this.console) { + var args = arguments; + var newarr; + + try { + args.callee = f.caller; + } catch(e) { + + } + + newarr = [].slice.call(args); + + if (typeof console.log === 'object') { + log.apply.call(console.log, console, newarr); + } else { + console.log.apply(console, newarr); + } + } +}; // make it safe to use console.log always -(function(a){function b(){}for(var c="assert,count,debug,dir,dirxml,error,exception,group,groupCollapsed,groupEnd,info,log,markTimeline,profile,profileEnd,time,timeEnd,trace,warn".split(","),d;!!(d=c.pop());){a[d]=a[d]||b;}}) -(function(){try{console.log();return window.console;}catch(a){return (window.console={});}}()); + +(function(a) { + function b() {} + var c = "assert,count,debug,dir,dirxml,error,exception,group,groupCollapsed,groupEnd,info,log,markTimeline,profile,profileEnd,time,timeEnd,trace,warn"; + var d; + for (c.split(","); !!(d = c.pop());) { + a[d] = a[d] || b; + } +}); + +(function() { + try { + console.log(); + return window.console; + } catch(a) { + return (window.console = {}); + } +}()); // place any jQuery/helper plugins in here, instead of separate, slower script files. From b678f1d4464804ca22f5f37dfdec35d86f330694 Mon Sep 17 00:00:00 2001 From: Nicolas Gallagher Date: Fri, 1 Jun 2012 23:32:36 +0100 Subject: [PATCH 4/5] Add quotes around HTML attribute values --- index.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.html b/index.html index e740e67e6d..1bc4596fc2 100644 --- a/index.html +++ b/index.html @@ -31,7 +31,7 @@ - + From 3e5492bb5cc0952d7baaba7badff05499a0153c3 Mon Sep 17 00:00:00 2001 From: Nicolas Gallagher Date: Fri, 1 Jun 2012 23:41:59 +0100 Subject: [PATCH 5/5] Add new lines to the end uncompressed files --- humans.txt | 1 + js/main.js | 4 ---- readme.md | 1 + robots.txt | 1 + 4 files changed, 3 insertions(+), 4 deletions(-) diff --git a/humans.txt b/humans.txt index a3e535fbdf..5c072527e2 100644 --- a/humans.txt +++ b/humans.txt @@ -40,3 +40,4 @@ :-:///////:- -:/:// -////:- --//: -- -: + diff --git a/js/main.js b/js/main.js index 206efd4d38..5e4e8248b3 100644 --- a/js/main.js +++ b/js/main.js @@ -2,7 +2,3 @@ */ - - - - diff --git a/readme.md b/readme.md index 681e7e507e..53c849bbd9 100644 --- a/readme.md +++ b/readme.md @@ -53,3 +53,4 @@ Anyone and everyone is welcome to [contribute](https://github.com/h5bp/html5-boi ### Everything else: The Unlicense (aka: public domain) + diff --git a/robots.txt b/robots.txt index 9027a67f83..55b073d409 100644 --- a/robots.txt +++ b/robots.txt @@ -2,3 +2,4 @@ # https://developers.google.com/webmasters/control-crawl-index/ User-agent: * +