├── .nojekyll ├── src ├── content │ ├── es │ │ ├── css.md │ │ ├── html.md │ │ ├── general.md │ │ ├── javascript.md │ │ ├── responsive.md │ │ ├── build │ │ │ ├── data.json │ │ │ └── es.hbs │ │ └── appendix.md │ └── en │ │ ├── build │ │ ├── en.hbs │ │ └── data.json │ │ ├── appendix.md │ │ ├── general.md │ │ ├── html.md │ │ ├── css.md │ │ ├── responsive.md │ │ └── javascript.md ├── img │ ├── .gitignore │ ├── favicon.ico │ ├── fork-me.png │ ├── isobar.png │ └── orange.svg ├── scss │ ├── global │ │ ├── _cat.scss │ │ ├── _links.scss │ │ ├── _footer.scss │ │ ├── _alignments.scss │ │ ├── _table_of_contents.scss │ │ ├── _layout.scss │ │ ├── _print.scss │ │ ├── _mediaqueries.scss │ │ ├── _typography.scss │ │ ├── _header.scss │ │ └── _base.scss │ ├── js-only.scss │ ├── helpers │ │ ├── _mixins.scss │ │ └── _variables.scss │ ├── style.scss │ └── js-only │ │ └── _prism.css ├── js │ ├── vendor │ │ ├── plugins.js │ │ ├── jquery.scrollTo.js │ │ └── prism.js │ └── script.js └── _layouts │ └── main.hbs ├── favicon.ico ├── _assets ├── img │ ├── favicon.ico │ ├── fork-me.png │ ├── isobar.png │ └── orange.svg ├── js │ └── main.min.js └── css │ └── style.css ├── robots.txt ├── .gitignore ├── package.json ├── Gruntfile.js └── README.md /.nojekyll: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/content/es/css.md: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/content/es/html.md: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/content/es/general.md: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/content/es/javascript.md: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/content/es/responsive.md: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/img/.gitignore: -------------------------------------------------------------------------------- 1 | !.gitignore 2 | 3 | -------------------------------------------------------------------------------- /favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/isobar-us/code-standards/HEAD/favicon.ico -------------------------------------------------------------------------------- /src/img/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/isobar-us/code-standards/HEAD/src/img/favicon.ico -------------------------------------------------------------------------------- /src/img/fork-me.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/isobar-us/code-standards/HEAD/src/img/fork-me.png -------------------------------------------------------------------------------- /src/img/isobar.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/isobar-us/code-standards/HEAD/src/img/isobar.png -------------------------------------------------------------------------------- /_assets/img/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/isobar-us/code-standards/HEAD/_assets/img/favicon.ico -------------------------------------------------------------------------------- /_assets/img/fork-me.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/isobar-us/code-standards/HEAD/_assets/img/fork-me.png -------------------------------------------------------------------------------- /_assets/img/isobar.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/isobar-us/code-standards/HEAD/_assets/img/isobar.png -------------------------------------------------------------------------------- /robots.txt: -------------------------------------------------------------------------------- 1 | # www.robotstxt.org/ 2 | # www.google.com/support/webmasters/bin/answer.py?hl=en&answer=156449 3 | 4 | User-agent: * 5 | 6 | -------------------------------------------------------------------------------- /src/content/es/build/data.json: -------------------------------------------------------------------------------- 1 | { 2 | "lang" : "es", 3 | "title": "", 4 | "meta" : { 5 | "description": "", 6 | "keywords" : "" 7 | }, 8 | "return_link": "" 9 | } -------------------------------------------------------------------------------- /src/scss/global/_cat.scss: -------------------------------------------------------------------------------- 1 | 2 | 3 | /* 4 | |\ _,,,---,,__ 5 | /,`.-'`' -. ;-;;,_/| 6 | |,4- ) ) -,_..;\ ( `'-' 7 | '---''(_/--' `-'\_) 8 | ----------------------------*/ -------------------------------------------------------------------------------- /src/scss/js-only.scss: -------------------------------------------------------------------------------- 1 | @import 'js-only/_prism'; 2 | 3 | /* for code blocks if JS isn't running */ 4 | pre { 5 | background-color: #000; 6 | overflow-x: scroll; 7 | font-size: 14px; 8 | } 9 | -------------------------------------------------------------------------------- /src/scss/helpers/_mixins.scss: -------------------------------------------------------------------------------- 1 | @mixin box-shadow() { 2 | box-shadow: $shadow-color 0 1px 3px; 3 | -moz-box-shadow: $shadow-color 0 1px 3px; 4 | -webkit-box-shadow: $shadow-color 0 1px 3px; 5 | -o-box-shadow: $shadow-color 0 1px 3px; 6 | } -------------------------------------------------------------------------------- /src/content/es/appendix.md: -------------------------------------------------------------------------------- 1 | 2 | ## Appendix 3 | 4 | ### Advanced Topics 5 | 6 | #### CSS Preprocessors 7 | 8 | #### Performance 9 | 10 | #### Accessibility 11 | 12 | #### More Tools and Resources 13 | 14 | ### Acknowledgements 15 | 16 | -------------------------------------------------------------------------------- /src/scss/global/_links.scss: -------------------------------------------------------------------------------- 1 | @import '../helpers/variables'; 2 | @import '../helpers/mixins'; 3 | a { 4 | color: $link-color; 5 | /* Accessible focus treatment: people.opera.com/patrickl/experiments/keyboard/test */ 6 | &:hover, &:active { 7 | outline: none; 8 | } 9 | &:hover { 10 | color: $link-hover-color; 11 | } 12 | } 13 | 14 | -------------------------------------------------------------------------------- /src/content/en/build/en.hbs: -------------------------------------------------------------------------------- 1 | 2 |
3 | 4 |
{{md 'src/content/en/general.md' }}
5 |
{{md 'src/content/en/html.md' }}
6 |
{{md 'src/content/en/css.md' }}
7 |
{{md 'src/content/en/javascript.md' }}
8 |
{{md 'src/content/en/responsive.md' }}
9 |
{{md 'src/content/en/appendix.md' }}
10 | 11 |
-------------------------------------------------------------------------------- /src/content/es/build/es.hbs: -------------------------------------------------------------------------------- 1 | 2 |
3 | 4 |
{{md 'src/content/es/general.md' }}
5 |
{{md 'src/content/es/html.md' }}
6 |
{{md 'src/content/es/css.md' }}
7 |
{{md 'src/content/es/javascript.md' }}
8 |
{{md 'src/content/es/responsive.md' }}
9 |
{{md 'src/content/es/appendix.md' }}
10 | 11 |
-------------------------------------------------------------------------------- /src/content/en/build/data.json: -------------------------------------------------------------------------------- 1 | { 2 | "lang" : "en", 3 | "title": "ISOBAR Front-end Code Standards & Best Practices", 4 | "meta" : { 5 | "description": "Isobar's Coding Standards and Frontend development Best Practices", 6 | "keywords" : "Isobar code standards, coding standards, frontend development, frontend best practices, html code standards, html5 code standards, css code standards, best code practices, development, frontend development" 7 | }, 8 | "return_link": "Return to Isobar" 9 | } -------------------------------------------------------------------------------- /src/scss/style.scss: -------------------------------------------------------------------------------- 1 | // Styles and Settings 2 | @import 'helpers/variables'; 3 | @import 'helpers/mixins'; 4 | 5 | // Core Styles 6 | @import 'global/base'; 7 | @import 'global/typography'; 8 | @import 'global/links'; 9 | @import 'global/layout'; 10 | @import 'global/footer'; 11 | @import 'global/header'; 12 | @import 'global/alignments'; 13 | @import 'global/table_of_contents'; 14 | 15 | //queries 16 | @import 'global/print'; 17 | @import 'global/mediaqueries'; 18 | 19 | //Styles specific to the JS features. 20 | @import 'js-only'; 21 | 22 | // this include greatly improves performance. 23 | @import 'global/cat'; 24 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Numerous always-ignore extensions 2 | *.diff 3 | *.err 4 | *.orig 5 | *.log 6 | *.map 7 | *.rej 8 | *.swo 9 | *.swp 10 | *.vi 11 | *.scssc 12 | *~ 13 | 14 | # OS or Editor folders 15 | .DS_Store 16 | .cache 17 | .project 18 | .settings 19 | nbproject 20 | thumbs.db 21 | 22 | # Dreamweaver added files 23 | _notes 24 | dwsync.xml 25 | 26 | # Komodo 27 | *.komodoproject 28 | .komodotools 29 | 30 | # Folders to ignore 31 | .hg 32 | .svn 33 | publish 34 | .idea 35 | .sass-cache 36 | _site 37 | .jekyll 38 | node_modules 39 | 40 | # build script local files 41 | build/buildinfo.properties 42 | build/config/buildinfo.properties 43 | -------------------------------------------------------------------------------- /src/scss/global/_footer.scss: -------------------------------------------------------------------------------- 1 | @import '../helpers/variables'; 2 | @import '../helpers/mixins'; 3 | /* Shoes + Footer 4 | ----------------------------------------------------------------------------------------------------*/ 5 | 6 | footer { 7 | background: $dark-gray; 8 | color: $white; 9 | font-size: 11px; 10 | margin: 0; 11 | overflow: hidden; 12 | line-height: 35px; 13 | width: 100%; 14 | padding: 0px 0px; 15 | } 16 | .footer-inner{ 17 | box-sizing: border-box; 18 | -webkit-box-sizing: border-box; 19 | -moz-box-sizing: border-box; 20 | max-width: 960px; 21 | margin: 0px auto; 22 | padding: 20px; 23 | } 24 | footer p { 25 | padding: 5px 0px; 26 | } 27 | 28 | -------------------------------------------------------------------------------- /src/scss/global/_alignments.scss: -------------------------------------------------------------------------------- 1 | @import '../helpers/variables'; 2 | @import '../helpers/mixins'; 3 | //todo: cleanup styling 4 | /* Alignments 5 | ----------------------------------------------------------------------------------------------------*/ 6 | 7 | .box, .box_notice { 8 | background: $gray-background; 9 | margin: 0 0 20px; 10 | padding: 20px 20px 10px; 11 | @include box-shadow(); 12 | } 13 | 14 | .box_notice { 15 | background: $isobar-orange; 16 | color: $alt-text; 17 | } 18 | 19 | .box_title { 20 | background: $alt-background; 21 | background: rgba(10, 10, 10, 0.5); 22 | color: $white; 23 | font-size: 13px; 24 | font-weight: bold; 25 | margin: 20px; 26 | padding: 5px 10px; 27 | } -------------------------------------------------------------------------------- /src/scss/helpers/_variables.scss: -------------------------------------------------------------------------------- 1 | //colors 2 | $isobar-orange: #f23109; 3 | $link-color: #000; 4 | $link-hover-color: #F74902; 5 | 6 | $highlight-color: #ff9; 7 | $white: #fff; 8 | $black: #000; 9 | $border-color: #f0f0f0;//todo: confirm is correct color for borders 10 | $shadow-color: #ccc; 11 | 12 | 13 | //colors from isobar.com 14 | $default-text: $black; 15 | $default-background: #ffffff; 16 | $default-2-text: #444444; 17 | $default-3-text: #999999; 18 | 19 | $alt-text: #ffffff; 20 | $alt-background: #1e1e1e; 21 | $alt-2-text: #ededed;//secondary text color 22 | 23 | $gray-background: #f0f0f0; 24 | $medium-gray: #4b4b4b; 25 | $dark-gray: #333; 26 | $very-dark-gray: #1e1e1e; 27 | $separator-gray: #999; 28 | 29 | 30 | 31 | //fonts 32 | $font-stack: Calibri, sans-serif; 33 | $heading-font-stack: "Helvetica Neue", sans-serif; //should be Kyrial if we get webfonts 34 | $pre-font-stack: Consolas, monaco, monospace; -------------------------------------------------------------------------------- /src/js/vendor/plugins.js: -------------------------------------------------------------------------------- 1 | // make it safe to use console.log always 2 | (function(b){ 3 | function c(){} 4 | for(var d="assert,count,debug,dir,dirxml,error,exception,group,groupCollapsed,groupEnd,info,log,markTimeline,profile,profileEnd,time,timeEnd,trace,warn".split(","),a; a = d.pop(); ) 5 | b[a] = b[a] || c; 6 | })(window.console = window.console || {}); 7 | 8 | /** 9 | * Provides requestAnimationFrame in a cross browser way. 10 | * http://paulirish.com/2011/requestanimationframe-for-smart-animating/ 11 | */ 12 | if( !window.requestAnimationFrame ) { 13 | window.requestAnimationFrame = ( function() { 14 | return window.webkitRequestAnimationFrame || 15 | window.mozRequestAnimationFrame || 16 | window.oRequestAnimationFrame || 17 | window.msRequestAnimationFrame || 18 | function( /* function FrameRequestCallback */ callback, /* DOMElement Element */ element ) { 19 | window.setTimeout( callback, 1000 / 60 ); 20 | }; 21 | })(); 22 | } 23 | -------------------------------------------------------------------------------- /src/scss/global/_table_of_contents.scss: -------------------------------------------------------------------------------- 1 | @import '../helpers/variables'; 2 | @import '../helpers/mixins'; 3 | 4 | /* Table of Contents 5 | ----------------------------------------------------------------------------------------------------*/ 6 | 7 | .anchor_link { 8 | color: rgba(137, 137, 137, 0.4); 9 | font-size: 20px; 10 | font-weight: normal; 11 | position: relative; 12 | text-decoration: none; 13 | top: 0; 14 | left: 5px; 15 | z-index: 0; 16 | } 17 | 18 | .back-anchor, .back-anchor a { 19 | display: inline-block; 20 | color: $dark-gray; 21 | font-size: 12px; 22 | margin: 0; 23 | padding: 3px 4px; 24 | position: absolute; 25 | right: 0; 26 | top: -20px; 27 | text-decoration: none; 28 | } 29 | 30 | .no-anchor .back-anchor { display: none; } 31 | 32 | /* @todo - temp style for nav to "work" */ 33 | .h3 { 34 | font-size: 90%; 35 | /*text-indent: 5%;*/ 36 | a { 37 | text-decoration: none; 38 | } 39 | } 40 | .h2 { 41 | font-size: 120%; 42 | font-weight: bolder; 43 | a { 44 | text-decoration: none; 45 | } 46 | } 47 | 48 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "code-standards", 3 | "version": "0.0.3", 4 | "description": "", 5 | "main": "Gruntfile.js", 6 | "scripts": {}, 7 | "repository": { 8 | "type": "git", 9 | "url": "https://github.com/isobar-idev/code-standards.git" 10 | }, 11 | "author": "Isobar", 12 | "bugs": { 13 | "url": "https://github.com/isobar-idev/code-standards/issues" 14 | }, 15 | "devDependencies": { 16 | "assemble": "^0.4.42", 17 | "async": "^0.2.10", 18 | "chai": "^1.8.1", 19 | "frep": "^0.1.8", 20 | "grunt": "~0.4.5", 21 | "grunt-contrib-clean": "~0.5.0", 22 | "grunt-contrib-concat": "^0.2.0", 23 | "grunt-contrib-copy": "^0.4.1", 24 | "grunt-contrib-jshint": "^0.7.2", 25 | "grunt-contrib-watch": "^0.5.3", 26 | "grunt-contrib-uglify": "^0.9.1", 27 | "grunt-prettify": "~0.3.1", 28 | "grunt-readme": "~0.4.0", 29 | "grunt-release": "^0.6.0", 30 | "grunt-repos": "~0.1.2", 31 | "grunt-sass": "^1.0.0", 32 | "grunt-sync-pkg": "~0.1.1", 33 | "handlebars-helper-eachitems": "~0.1.2", 34 | "inflection": "^1.2.7", 35 | "lodash": "^1.3.1", 36 | "marked": "^0.3.2", 37 | "pretty": "~0.1.1", 38 | "resolve-dep": "^0.1.3", 39 | "time-grunt": "^1.2.1", 40 | "underscore.string": "~2.3.3" 41 | }, 42 | "dependencies": { 43 | "grunt-contrib-connect": "^0.9.0" 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /src/scss/global/_layout.scss: -------------------------------------------------------------------------------- 1 | @import '../helpers/variables'; 2 | @import '../helpers/mixins'; 3 | /* Logo + Container + Main + Section + Aside 4 | ----------------------------------------------------------------------------------------------------*/ 5 | .overlay{ 6 | position: fixed; 7 | height: 100%; 8 | width: 100%; 9 | top: 0px; 10 | left: 0px; 11 | background-color: rgba(0,0,0,0.8); 12 | z-index:1; 13 | display: none; 14 | } 15 | .menu-open .overlay{ 16 | display: block; 17 | } 18 | .container { 19 | margin: 0 auto; 20 | position: relative; 21 | overflow: hidden; 22 | max-width: 970px; 23 | } 24 | main { 25 | box-sizing: border-box; 26 | -webkit-box-sizing: border-box; 27 | -moz-box-sizing: border-box; 28 | display: block; 29 | overflow: hidden; 30 | padding: 10px 20px 60px 20px; 31 | max-width: 620px; 32 | width: 66%; 33 | float: left; 34 | border-right: 1px solid $border-color; 35 | } 36 | .nav-toc { 37 | box-sizing: border-box; 38 | -webkit-box-sizing: border-box; 39 | -moz-box-sizing: border-box; 40 | height: 100%; 41 | z-index: 3; 42 | display: block; 43 | position: relative; 44 | font-size: 13px; 45 | padding: 20px 20px; 46 | width: 33.33%; 47 | max-width: 340px; 48 | height: 100%; 49 | top: 0px; 50 | left: 0px; 51 | float: right; 52 | background-color: #ffffff; 53 | -webkit-transition: right .5s; 54 | -moz-transition: right .5s; 55 | transition: right .5s; 56 | } 57 | 58 | main > section { padding-bottom: 20px; } 59 | 60 | #toc{ 61 | .h2{ 62 | margin-top: 20px; 63 | } 64 | .h2:nth-child(1){ 65 | margin-top: 0px; 66 | } 67 | .h3{ 68 | margin-top: 6px; 69 | } 70 | } 71 | 72 | body.fix-desktop-toc .nav-toc{ 73 | position: fixed; 74 | top: 0px; 75 | right: 0px; 76 | left:auto; 77 | overflow-y: scroll; 78 | } 79 | -------------------------------------------------------------------------------- /src/scss/global/_print.scss: -------------------------------------------------------------------------------- 1 | @import '../helpers/variables'; 2 | @import '../helpers/mixins'; 3 | //todo: cleanup 4 | /** 5 | * Print styles. 6 | * 7 | * Inlined to avoid required HTTP connection: www.phpied.com/delay-loading-your-print-css/ 8 | */ 9 | @media print { 10 | * { background: transparent !important; color: black !important; text-shadow: none !important; filter: none !important; 11 | -ms-filter: none !important; } /* Black prints faster: sanbeiji.com/archives/953 */ 12 | a, a:visited { color: #444 !important; text-decoration: underline; } 13 | a[href]:after { content: " (" attr(href) ")"; } 14 | abbr[title]:after { content: " (" attr(title) ")"; } 15 | .ir a:after, a[href^="javascript:"]:after, a[href^="#"]:after { content: ""; } /* Don't show links for images, or javascript/internal links */ 16 | pre, blockquote { border: 1px solid #999; page-break-inside: avoid; } 17 | thead { display: table-header-group; } /* css-discuss.incutio.com/wiki/Printing_Tables */ 18 | tr, img { page-break-inside: avoid; } 19 | @page { margin: 0.5cm; } 20 | p, h2, h3 { orphans: 3; widows: 3; } 21 | h2, h3{ page-break-after: avoid; } 22 | 23 | 24 | body { width: 80%; font-family: Calibri, Arial, Helvetica, sans-serif; } 25 | header { width: 100%; } 26 | 27 | .header-logo{ 28 | background:url("../img/logo-roundarchisobar.png") no-repeat 0 0 29 | } 30 | 31 | h1, h2, h3, h4, h5, h6 { } 32 | 33 | h1, h2, h3 { 34 | /* color:#f30; */ 35 | color:#F74902; 36 | position: relative; 37 | margin-top: 20px; 38 | font-weight:200 39 | } 40 | 41 | h1{ 42 | padding:0; 43 | margin:0; 44 | color:#00050a 45 | } 46 | 47 | header h1 a{ 48 | font-size:48px 49 | } 50 | 51 | a,a:visited{ 52 | text-decoration:none; 53 | /* color:#f30 */ 54 | color:#F74902 55 | } 56 | 57 | body .fork,#side,header #social,canvas,.anchor_link,.back-anchor{ 58 | visibility:hidden 59 | } 60 | 61 | .syntaxhighlighter{ 62 | background:#ccc 63 | } 64 | 65 | } -------------------------------------------------------------------------------- /src/scss/global/_mediaqueries.scss: -------------------------------------------------------------------------------- 1 | @import '../helpers/variables'; 2 | @import '../helpers/mixins'; 3 | /** 4 | * Media queries for responsive design. 5 | * 6 | * These follow after primary styles so they will successfully override. 7 | */ 8 | 9 | @media all and (orientation:portrait) { 10 | /* Style adjustments for portrait mode goes here */ 11 | } 12 | 13 | @media all and (orientation:landscape) { 14 | /* Style adjustments for landscape mode goes here */ 15 | } 16 | 17 | @media all and (max-width: 770px) { 18 | body{ 19 | border-top: 90px solid $white; 20 | } 21 | header{ 22 | border-top: 5px solid $isobar-orange; 23 | position: fixed; 24 | padding-left: 0px; 25 | z-index:5; 26 | } 27 | .menu-button{ 28 | display: block; 29 | } 30 | .fork, 31 | .social{ 32 | display: none; 33 | } 34 | main{ 35 | padding: 20px; 36 | width: auto; 37 | margin-left: 0px; 38 | float: none; 39 | border-right: none; 40 | } 41 | .nav-toc{ 42 | width: 250px; 43 | right: -250px; 44 | left: auto; 45 | float: none; 46 | position:fixed; 47 | z-index:4; 48 | overflow-y: scroll; 49 | border-top: 90px solid $white; 50 | } 51 | body.menu-open .nav-toc{ 52 | right: 0px; 53 | } 54 | } 55 | 56 | @media all and (max-width: 400px) { 57 | body{ 58 | border-top: 60px solid $white; 59 | } 60 | header{ 61 | height: 60px; 62 | } 63 | header h1{ 64 | margin-top: 12px; 65 | } 66 | .menu-button{ 67 | top: 21px; 68 | } 69 | main{ 70 | padding: 10px; 71 | } 72 | .nav-toc{ 73 | border-top: 60px solid #f5f5f5; 74 | } 75 | } 76 | 77 | /* Grade-A Mobile Browsers (Opera Mobile, Mobile Safari, Android Chrome) 78 | consider this: www.cloudfour.com/css-media-query-for-mobile-is-fools-gold/ */ 79 | @media screen and (max-device-width: 480px) { 80 | /* Uncomment if you don't want iOS and WinMobile to mobile-optimize the text for you: j.mp/textsizeadjust */ 81 | /* html { -webkit-text-size-adjust:none;-ms-text-size-adjust:none;} */ 82 | } 83 | 84 | @media screen and (min-width: 770px) { 85 | p, ol, ul { 86 | font-size: 16px; 87 | } 88 | } 89 | -------------------------------------------------------------------------------- /src/scss/global/_typography.scss: -------------------------------------------------------------------------------- 1 | @import '../helpers/variables'; 2 | @import '../helpers/mixins'; 3 | //todo: refactor, consider switching to rems 4 | 5 | /** 6 | * Font normalization inspired by YUI Library's fonts.css: developer.yahoo.com/yui/ 7 | */ 8 | 9 | body { font: 13px/1.231 $font-stack; *font-size: small; } /* Hack retained to preserve specificity */ 10 | select, input, textarea, button { font: 99% sans-serif; } 11 | 12 | /* Normalize monospace sizing: 13 | en.wikipedia.org/wiki/MediaWiki_talk:Common.css/Archive_11#Teletype_style_fix_for_Chrome */ 14 | pre, code, kbd, samp { font-family: $pre-font-stack; } 15 | 16 | small { font-size: 85%; } 17 | strong, th { font-weight: bold; } 18 | 19 | /* Set sub, sup without affecting line-height: gist.github.com/413930 */ 20 | sub, sup { font-size: 75%; line-height: 0; position: relative; } 21 | sup { top: -0.5em; } 22 | sub { bottom: -0.25em; } 23 | 24 | 25 | body, select, input, textarea { 26 | /* #444 looks better than black: twitter.com/H_FJ/statuses/11800719859 */ 27 | color: $default-2-text; 28 | /* Set your base font here, to apply evenly */ 29 | font-family: $font-stack; 30 | font-size: 14px; 31 | } 32 | 33 | 34 | p { 35 | margin: 0 0 10px 0; 36 | } 37 | 38 | p, ol, ul { 39 | font-size: 14px; 40 | line-height: 20px; 41 | } 42 | 43 | 44 | /* `Headings 45 | ----------------------------------------------------------------------------------------------------*/ 46 | 47 | /* Headers (h1, h2, etc) have no default font-size or margin;define those yourself */ 48 | h1, h2, h3, h4, h5, h6 { 49 | font-family: $heading-font-stack; 50 | color: $isobar-orange; 51 | position: relative; 52 | margin-top:20px 53 | } 54 | 55 | h3, h4, h5, h6 { font-weight: normal; } 56 | 57 | h1 { 58 | color: $default-text; 59 | font-size: 36px; 60 | font-weight: 700; 61 | line-height: 1.1em; 62 | margin-bottom: 14px; 63 | } 64 | 65 | h2 { 66 | color: $default-text; 67 | font-size: 28px; 68 | margin: 40px 0 12px; 69 | } 70 | 71 | h3 { 72 | font-size: 24px; 73 | margin-bottom: 11px; 74 | } 75 | 76 | h4 { 77 | font-size: 20px; 78 | color: $default-3-text; 79 | margin-bottom: 8px; 80 | } 81 | h5 { 82 | font-size: 18px; 83 | color: $default-2-text; 84 | } 85 | 86 | h2::before{ 87 | content: '{ }'; 88 | font-family: Calibri,AlexandriaBold,Arial,Helvetica,sans-serif; 89 | color: white; 90 | border-radius: 100px; 91 | padding-top: 6px; 92 | padding-left: 20px; 93 | height: 94px; 94 | font-size:65px; 95 | width: 80px; 96 | background: none repeat scroll 0% 0% #F74902; 97 | float: left; 98 | margin: 0px 20px 20px 0px; 99 | } 100 | -------------------------------------------------------------------------------- /src/_layouts/main.hbs: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | {{ title }} | Isobar 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 25 | 26 | 27 | 28 |
29 | 30 |
31 |

32 | 35 | 37 |
38 | 39 |
40 | {{>body}} 41 |
42 | 43 | 47 | 48 |
49 | 50 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | -------------------------------------------------------------------------------- /src/scss/global/_header.scss: -------------------------------------------------------------------------------- 1 | @import '../helpers/variables'; 2 | @import '../helpers/mixins'; 3 | /* `Topper + Header (who called it a topper in old version? lol) 4 | ----------------------------------------------------------------------------------------------------*/ 5 | 6 | body .fork { 7 | position: fixed; 8 | top: 0; 9 | right: -15px; 10 | z-index:4; 11 | width: 149px; 12 | height: 149px; 13 | background: url(../img/fork-me.png) no-repeat -15px top; 14 | } 15 | 16 | header { 17 | position: relative; 18 | height: 90px; 19 | top: 0px; 20 | width: 100%; 21 | z-index:3; 22 | background-color: #ffffff; 23 | } 24 | 25 | //social links in header? 26 | header a { 27 | width: 137px; 28 | height: 39px; 29 | display: inline-block; 30 | } 31 | 32 | header h1 { 33 | width: 137px; 34 | padding: 0; 35 | height: 40px; 36 | margin-left: 20px; 37 | } 38 | 39 | //todo: what is this for? 40 | header canvas { 41 | position: absolute; 42 | visibility: hidden; 43 | padding: 0; 44 | top: -40px; 45 | } 46 | 47 | .menu-button{ 48 | cursor: pointer; 49 | display: none; 50 | height: 16px; 51 | width: 32px; 52 | position: absolute; 53 | top: 29px; 54 | right: 19px; 55 | border-bottom: 5px solid #2b2b21; 56 | -webkit-transition: border 0.5s; 57 | -moz-transition: border 0.5s; 58 | transition: border 0.5s; 59 | } 60 | 61 | .menu-button::after, .menu-button::before{ 62 | content: ''; 63 | display: block; 64 | box-sizing: border-box; 65 | -webkit-box-sizing: border-box; 66 | -moz-box-sizing: border-box; 67 | display: block; 68 | width: 100%; 69 | height: 5px; 70 | background-color: #2b2b2b; 71 | margin-bottom: 3px; 72 | -webkit-transition: background-color 0.5s; 73 | -moz-transition: background-color 0.5s; 74 | transition: background-color 0.5s; 75 | } 76 | .menu-open{ 77 | .menu-button:after, .menu-button:before{ 78 | background-color: $isobar-orange; 79 | } 80 | .menu-button{ 81 | border-bottom: 5px solid $isobar-orange; 82 | } 83 | } 84 | header h1 a { 85 | background:url("../img/orange.svg") no-repeat 0 0; 86 | background-size: auto 80%; 87 | overflow: hidden; 88 | text-indent: 200%; 89 | white-space: nowrap; 90 | display:block; 91 | } 92 | 93 | header .social #linkback:hover { 94 | /*color: $isobar-orange;*/ 95 | } 96 | 97 | .social{ 98 | margin: 0px; 99 | position: absolute; 100 | right: 0px; 101 | top: 9px; 102 | li { 103 | display: inline-block; 104 | height: 22px; 105 | width: 22px; 106 | margin-right: 6px; 107 | vertical-align: top; 108 | a { 109 | width: 100%; 110 | height: 100%; 111 | display: block; 112 | background-size: 100%; 113 | } 114 | } 115 | li:last-child{ 116 | width: auto; 117 | } 118 | } 119 | #linkback { 120 | color: $medium-gray; 121 | text-decoration: none; 122 | text-align: center; 123 | background: none; 124 | /*text-transform: uppercase;*/ 125 | line-height: 25px; 126 | padding: 0px 0px; 127 | span{ 128 | color: $isobar-orange; 129 | } 130 | } 131 | #linkback:hover { 132 | text-decoration: underline; 133 | } 134 | -------------------------------------------------------------------------------- /src/img/orange.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 7 | 8 | 10 | 14 | 19 | 24 | 25 | 27 | 28 | 34 | 35 | 36 | 37 | -------------------------------------------------------------------------------- /_assets/img/orange.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 7 | 8 | 10 | 14 | 19 | 24 | 25 | 27 | 28 | 34 | 35 | 36 | 37 | -------------------------------------------------------------------------------- /Gruntfile.js: -------------------------------------------------------------------------------- 1 | /*global module:false*/ 2 | module.exports = function(grunt) { 3 | 4 | 'use strict'; 5 | 6 | // @todo: move to json file 7 | var standards = { 8 | ourLanguages : ['en', 'es'], 9 | defaultFile : 'index', 10 | defaultExt : '.html', 11 | // change this to have the 'index' file be another language 12 | defaultLanguage : 'en' 13 | }; 14 | 15 | // output build time stats 16 | require('time-grunt')(grunt); 17 | 18 | // Project configuration. 19 | grunt.initConfig({ 20 | // Metadata. 21 | pkg: grunt.file.readJSON('package.json'), 22 | 23 | // combine our files into one file, language by language 24 | assemble: { 25 | options: { 26 | marked: { 27 | sanitize: false 28 | }, 29 | flatten : true, 30 | layout: './src/_layouts/main.hbs' 31 | }, 32 | en: { 33 | options : { 34 | data : 'src/content/en/build/data.json' 35 | }, 36 | files : { 37 | 'en.html' : ['src/content/en/build/en.hbs'] 38 | } 39 | }, 40 | /*es: { 41 | options : { 42 | data : 'src/content/es/build/data.json' 43 | }, 44 | files : { 45 | 'es.html' : ['src/content/es/build/es.hbs'] 46 | } 47 | },*/ 48 | }, 49 | 50 | // clean up after the previous build 51 | clean: { 52 | build : (function(){ 53 | var arr = []; 54 | 55 | // we iterate over the languages and create our list of output files 56 | standards.ourLanguages.forEach(function(val){ 57 | arr.push(val + standards.defaultExt); 58 | }); 59 | 60 | // add the default file to the list since it will be replaced by "copy" 61 | arr.push(standards.defaultFile + standards.defaultExt); 62 | 63 | return arr; 64 | }()), 65 | assets: ['_assets/**/*'] 66 | }, 67 | 68 | // concatenate the js files into one 69 | concat: { 70 | js: { 71 | options: { 72 | separator: ';', 73 | }, 74 | files: { 75 | '_assets/js/main.js': ['src/js/**/*.js','!src/js/vendor/jquery-*min.js'] 76 | } 77 | } 78 | }, 79 | 80 | // connect to the local server 81 | connect: { 82 | server: { 83 | options: { 84 | port: 8000, 85 | hostname: '127.0.0.1', 86 | keepalive: true 87 | } 88 | } 89 | }, 90 | 91 | // copy the specified default language to the specified file 92 | copy: { 93 | assets: { 94 | expand: true, 95 | cwd: 'src/js/vendor/', 96 | src: ['jquery*min.js'], 97 | dest: '_assets/js/vendor/' 98 | }, 99 | // mat be replaced by imagemin 100 | images: { 101 | expand: true, 102 | cwd: 'src/img', 103 | src: ['**/*.{png,jpg,gif,svg,ico}'], 104 | dest: '_assets/img/' 105 | }, 106 | realeaseLanguage : { 107 | src : standards.defaultLanguage + standards.defaultExt, 108 | dest : standards.defaultFile + standards.defaultExt 109 | } 110 | }, 111 | 112 | // run sass to generate the css 113 | sass: { 114 | global: { 115 | options: { 116 | sourceMap: true, 117 | sourceComments: false, 118 | outputStyle: 'expanded' 119 | }, 120 | files: [{ 121 | expand: true, 122 | cwd: 'src/scss/', 123 | src: ['*.scss', '!js-only.scss'], 124 | dest: '_assets/css/', 125 | ext: '.css' 126 | }, 127 | ], 128 | } 129 | }, 130 | 131 | // watch the file system for new changes 132 | watch: { 133 | css: { 134 | files: ['src/scss/**/*.scss'], 135 | tasks: ['sass'] 136 | }, 137 | html: { 138 | files: ['src/_layouts/**.*', 'src/content/en/**/*.*'], 139 | tasks: ['assemble','copy'] 140 | }, 141 | img: { 142 | files: ['src/img/**/*.{png,jpg,gif}'], 143 | tasks: ['copy:images'] // may be replaced by imagemin 144 | }, 145 | js: { 146 | files: ['src/js/**/*.js'], 147 | tasks: ['concat', 'uglify', 'copy:assets'] 148 | } 149 | }, 150 | 151 | // minify the js 152 | uglify: { 153 | target: { 154 | files: { 155 | '_assets/js/main.min.js': ['_assets/js/main.js'] 156 | } 157 | } 158 | } 159 | 160 | }); 161 | 162 | // These plugins provide necessary tasks. 163 | grunt.loadNpmTasks('grunt-sass'); 164 | grunt.loadNpmTasks('grunt-contrib-clean'); 165 | grunt.loadNpmTasks('grunt-contrib-concat'); 166 | grunt.loadNpmTasks('grunt-contrib-connect'); 167 | grunt.loadNpmTasks('grunt-contrib-copy'); 168 | grunt.loadNpmTasks('grunt-contrib-watch'); 169 | grunt.loadNpmTasks('grunt-contrib-uglify'); 170 | grunt.loadNpmTasks('assemble'); 171 | 172 | // Default task. 173 | grunt.registerTask('cleanup', ['clean']); 174 | grunt.registerTask('server', ['connect']); 175 | grunt.registerTask('default', ['clean', 'sass', 'concat', 'uglify', 'assemble', 'copy']); 176 | grunt.registerTask('dev', ['watch']); 177 | 178 | }; 179 | -------------------------------------------------------------------------------- /src/scss/global/_base.scss: -------------------------------------------------------------------------------- 1 | @import '../helpers/variables'; 2 | @import '../helpers/mixins'; 3 | /** 4 | * html5doctor.com Reset Stylesheet (Eric Meyer's Reset Reloaded + HTML5 baseline) 5 | * v1.6.1 2010-09-17 | Authors: Eric Meyer & Richard Clark 6 | * html5doctor.com/html-5-reset-stylesheet/ 7 | */ 8 | 9 | html, body, div, span, object, iframe, 10 | h1, h2, h3, h4, h5, h6, p, blockquote, pre, 11 | abbr, address, cite, code, del, dfn, em, img, ins, kbd, q, samp, 12 | small, strong, sub, sup, var, b, i, dl, dt, dd, ol, ul, li, 13 | fieldset, form, label, legend, 14 | table, caption, tbody, tfoot, thead, tr, th, td, 15 | article, aside, canvas, details, figcaption, figure, 16 | footer, header, hgroup, menu, nav, section, summary, 17 | time, mark, audio, video { 18 | margin: 0; 19 | padding: 0; 20 | border: 0; 21 | font-size: 100%; 22 | font: inherit; 23 | vertical-align: baseline; 24 | } 25 | 26 | article, aside, details, figcaption, figure, 27 | footer, header, hgroup, menu, nav, section { 28 | display: block; 29 | } 30 | 31 | blockquote, q { quotes: none; } 32 | 33 | blockquote:before, blockquote:after, 34 | q:before, q:after { content: ""; content: none; } 35 | 36 | ins { background-color: $highlight-color; color: $black; text-decoration: none; } 37 | 38 | mark { background-color: $highlight-color; color: $black; font-style: italic; font-weight: bold; } 39 | 40 | del { text-decoration: line-through; } 41 | 42 | abbr[title], dfn[title] { border-bottom: 1px dotted; cursor: help; } 43 | 44 | table { border-collapse: collapse; border-spacing: 0; } 45 | 46 | hr { display: block; height: 1px; border: 0; border-top: 1px solid $border-color; margin: 1em 0; padding: 0; } 47 | 48 | input, select { vertical-align: middle; } 49 | 50 | //Reset finished, start styles, consider merging reset into base styles 51 | /** 52 | * Minimal base styles. 53 | */ 54 | 55 | /* Always force a scrollbar in non-IE */ 56 | html { overflow-y: scroll; } 57 | 58 | /* Accessible focus treatment: people.opera.com/patrickl/experiments/keyboard/test */ 59 | a:hover, a:active { outline: none; } 60 | 61 | ul, ol { margin-left: 2em; } 62 | ol { list-style-type: decimal; } 63 | 64 | /* Remove margins for navigation lists */ 65 | nav ul, nav li { margin: 0; list-style: none; list-style-image: none; } 66 | 67 | td { vertical-align: top; } 68 | 69 | textarea { overflow: auto; } /* www.sitepoint.com/blogs/2010/08/20/ie-remove-textarea-scrollbars/ */ 70 | 71 | /* Align checkboxes, radios, text inputs with their label by: Thierry Koblentz tjkdesign.com/ez-css/css/base.css */ 72 | input[type="radio"] { vertical-align: text-bottom; } 73 | input[type="checkbox"] { vertical-align: bottom; } 74 | 75 | /* Hand cursor on clickable input elements */ 76 | label, input[type="button"], input[type="submit"], input[type="image"], button { cursor: pointer; } 77 | 78 | /* Webkit browsers add a 2px margin outside the chrome of form elements */ 79 | button, input, select, textarea { margin: 0; } 80 | 81 | /* Colors for form validity */ 82 | input:valid, textarea:valid { } 83 | input:invalid, textarea:invalid { 84 | -ms-border-radius: 1px; 85 | -moz-border-radius: 1px; 86 | -webkit-border-radius: 1px; 87 | -o-border-radius: 1px; 88 | border-radius: 1px; 89 | -moz-box-shadow: 0 0 5px red; 90 | -webkit-box-shadow: 0 0 5px red; 91 | -o-box-shadow: 0 0 5px red; 92 | box-shadow: 0 0 5px red; 93 | } 94 | 95 | 96 | /* These selection declarations have to be separate 97 | No text-shadow: twitter.com/miketaylr/status/12228805301 98 | Also: hot pink! */ 99 | ::-moz-selection{ background: #FF5E99; color: #fff; text-shadow: none; } 100 | ::selection { background: #FF5E99; color: #fff; text-shadow: none; } 101 | 102 | /* j.mp/webkit-tap-highlight-color */ 103 | a:link { -webkit-tap-highlight-color: #FF5E99; } 104 | 105 | /* Make buttons play nice in IE: 106 | www.viget.com/inspire/styling-the-button-element-in-internet-explorer/ */ 107 | button { width: auto; overflow: visible; } 108 | 109 | 110 | 111 | /** 112 | ---------------------------------------------------------------------------------------------------- 113 | * Primary styles 114 | * 115 | * Author: ISOBAR 116 | ----------------------------------------------------------------------------------------------------*/ 117 | 118 | body { 119 | background: $white; 120 | color: $default-2-text; 121 | border-top: 5px solid $isobar-orange; 122 | } 123 | 124 | figure { 125 | background: $gray-background; 126 | display: block; 127 | margin: 10px; 128 | padding: 1px; 129 | text-align: center; 130 | @include box-shadow(); 131 | } 132 | 133 | //todo: check what this is used for 134 | figure.extra { margin-top: 10px; } 135 | 136 | figcaption { 137 | font-size: 10px; 138 | font-style: italic; 139 | text-align: left; 140 | } 141 | 142 | abbr { border-bottom: 1px dotted; } 143 | 144 | p, dl, hr, h1, h2, h3, h4, h5, h6, ol, ul, pre, table, address, fieldset { 145 | margin-bottom: 10px; 146 | } 147 | 148 | //todo: check what this is used for 149 | p.indent { margin: 0 0 5px 0; } 150 | 151 | dl { margin-left: 15px; } 152 | dt { font-weight: bold; } 153 | dt:after { content: ':'; } 154 | dd { margin-bottom: 10px; } 155 | 156 | dd{ 157 | margin-bottom:10px 158 | } 159 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Isobar Front-end Development Standards and Guidelines 2 | 3 | ## License: 4 | 5 | All content licensed under Creative Commons Attribution 3.0 Unported License 6 | 7 | ## Summary: 8 | 9 | This document contains guidelines for web applications built by the Front-end development practice of Isobar. It is to be readily available to anyone who wishes to check or contribute to the iterative progress of our discipline's best practices. 10 | 11 | This document's primary motivation is two-fold: 12 | 13 | 1. code consistency and 14 | 2. best practices. 15 | 16 | By maintaining consistency in coding styles and conventions, we can ease the burden of legacy code maintenance, and mitigate risk of breakage in the future. By adhering to best practices, we ensure optimized page loading, performance and maintainable code. 17 | 18 | We hope to encourage other developers to think about how to best standardize their approaches to development, to propose their own ideas for debate and for inclusion in our version of the document, and to adapt our standards for their own unique development practices. What better way of achieving consensus on how best to develop in our discipline than through feedback from members of that discipline themselves? 19 | 20 | ## Intent for Build and Content 21 | 22 | We hope to separate the structure of the document from the content contained in the standards themselves. Effectively, our goal is to be able to easily update the content without having to worry about the structure. 23 | 24 | This also enables pull requests to focus on content and forks to the content to be easily re-branded. 25 | 26 | ## Viewing the Document 27 | 28 | To view the latest, you can just clone locally: 29 | 30 | ```bash 31 | git clone git://github.com/isobar-idev/code-standards.git 32 | ``` 33 | 34 | To make changes using the process in place, please use the build process. The next few sections describe this build process. 35 | 36 | ## Building the Document 37 | 38 | ### Requirements 39 | 40 | The build system uses [Grunt.js](http://gruntjs.com) via [Node.js](http://nodejs.org/) and [SASS](http://sass-lang.com/) via [libsass](http://libsass.org/). 41 | 42 | First, install [Node.js](http://nodejs.org) from their Web site. 43 | 44 | ### Build Details 45 | 46 | We are using [Grunt](https://github.com/gruntjs/) to run the [Assemble](https://github.com/assemble/assemble/) task to parse, populate variables, and combine files for the HTML, Markdown, and [Handlebars](http://handlebarsjs.com/) templates. 47 | 48 | > Note: [Assemble](http://assemble.io) is an exceptionally active and flexible framework for building static HTML pages. It allows the usage of Handlebars, Markdown, and HTML files so we can gradually migrate to Markdown content files over time. 49 | 50 | > We suggest you check out [Assemble](http://assemble.io) as well. 51 | 52 | The Gruntfile (`grunt.js`) includes the build for the multi-lingual copies of the document. There is a variable for `standards.defaultLanguage` which will determine what language the default `index.html` is rendered in. 53 | 54 | To start with a clean slate, the Gruntfile has a `cleanup` task which will remove the previously generated `index.html` and associated language files. 55 | 56 | There is also a `watch` task if you like to work that way. 57 | 58 | ### Execute the Build 59 | 60 | Run `'npm install'` from the command line of the project directory to install all the node dependencies. You may need to occasionally re-run this command as new dependencies are added. 61 | 62 | > Windows: You may need to manually run `npm install -g grunt` and `npm install -g grunt-cli` to correctly set the path variables required to run grunt from the command line. 63 | 64 | Run `'grunt'` from the command line of the project directory to run the build process. 65 | 66 | ### Structure of Page Content 67 | 68 | The `*.html` files in the root are generated via `grunt` and should not be edited directly. There is one file per language, by language code. 69 | 70 | ``` 71 | ./en.html 72 | ./es.html 73 | ./ru.html 74 | ... 75 | ``` 76 | Finally, the `standards.defaultLanguage` setting determines which `*.html` file will be copied to the `index.html` file. 77 | 78 | > Note: In the near future the layout and templates will be updated to include the i18l language menus. 79 | 80 | #### Content 81 | 82 | The content is written in Markdown files and the build converts it to HTML. Example: 83 | 84 | ``` 85 | ./src/content/[lang]/css.md 86 | ./src/content/[lang]/general.md 87 | ./src/content/[lang]/html.md 88 | ``` 89 | 90 | ...and so on. 91 | 92 | Each of the `.md` files contained within these directories is a portion of the final output file. We have separated the different sections that make up the page into individual files so that it is easier to edit. 93 | 94 | #### Including A Content File 95 | 96 | The content files are included as partials and the data and order is defined in the following folder and files: 97 | 98 | ``` 99 | ./src/content/[lang]/build/[lang].hbs 100 | ./src/content/[lang]/build/data.json 101 | ``` 102 | 103 | The `data.json` file has special significance to Assemble, *do not rename this file*. 104 | 105 | #### Page Layout (Presentation) 106 | 107 | The main layout is a Handlebars file that the content is injected into and language specific attributes are updated. 108 | 109 | The file is `./src/_layouts/main.hbs`. 110 | 111 | ### Structure of CSS 112 | 113 | The CSS files are generated via LibSass from the SCSS files located in the SCSS folder, which is run as part of the Grunt task. 114 | 115 | 116 | ### Deploy 117 | 118 | Because github pages only serve static content, you must push your generated files to the gh-pages branch for updates to appear online. 119 | 120 | -------------------------------------------------------------------------------- /src/content/en/appendix.md: -------------------------------------------------------------------------------- 1 | 2 | ## Appendix 3 | 4 | Being a Front-end developer these days covers an enormous spectrum of technologies and techniques. 5 | 6 | We hope to add more content, edit, and revise the content above with more information, samples, and resources. 7 | 8 | ### Advanced Topics 9 | 10 | There's so much to cover, and so little time. What follows is just a sample of links the team at Isobar regularly uses to find current information. We plan on adding more over time. 11 | 12 | #### On the Server 13 | 14 | - [Node.js](http://nodejs.org) 15 | - [Phantom.js](http://phantomjs.org/) 16 | 17 | #### Front-end Developer Tool Chain | Workflow 18 | 19 | - [Chrome DevTools](https://developer.chrome.com/devtools) 20 | - [Firefox Developer Tools](https://developer.mozilla.org/en-US/docs/Tools) 21 | - [MSIE F12 Developer Tools](https://msdn.microsoft.com/library/bg182326(v=vs.85)) 22 | - [Firebug Wiki](https://getfirebug.com/wiki/index.php/Main_Page) 23 | - [On and About MSIE 11 / Edge etc.](http://dev.modern.ie/) 24 | - [BrowserStack](http://www.browserstack.com) 25 | - [JSLint](http://www.jslint.com/) 26 | - [JSHint](http://jshint.com/) 27 | - [Grunt.js](http://gruntjs.com) 28 | - [Gulp.js](http://gulpjs.com/) 29 | - [Webpack](http://webpack.github.io/) 30 | - [Require.js](http://requirejs.org/) 31 | - [Browserify](http://browserify.org/) 32 | 33 | #### CSS Preprocessors / Post-processors 34 | 35 | - [SASS / SCSS](http://sass-lang.com/) 36 | - [LESS CSS](http://lesscss.org/) 37 | - [SASS vs. LESS](http://css-tricks.com/sass-vs-less/) 38 | 39 | #### Performance 40 | 41 | Performance is a huge topic. Links and more content coming soon. 42 | 43 | - [Google's Front End Performance Rules](https://developers.google.com/speed/docs/best-practices/rules_intro) 44 | - [Yahoo! Exceptional Performance Rules](http://developer.yahoo.com/performance/) 45 | - [Web Page Test.org](http://www.webpagetest.org/) 46 | - [JS Perf](http://jsperf.com/) 47 | - [Google Chrome Speed Tracer](https://developers.google.com/web-toolkit/speedtracer/) 48 | - [DynaTrace Ajax Edition](http://www.compuware.com/application-performance-management/ajax-performance-testing.html) 49 | - [YSlow!](https://addons.mozilla.org/en-us/firefox/addon/yslow/) 50 | - [Measuring Page Load Speed With Navigation Timing](http://www.html5rocks.com/en/tutorials/webperformance/basics/) 51 | - [JavaScript Performance](https://gist.github.com/3086328) 52 | 53 | #### Accessibility 54 | 55 | Isobar regularly codes with accessibility in mind. Links and content coming soon. 56 | 57 | - [ARIA](http://www.w3.org/WAI/intro/aria) 58 | - [WAI Resources](http://www.w3.org/WAI/Resources/Overview) 59 | - [Simply Accessible](http://simplyaccessible.com/) 60 | 61 | ### Links for More Resources 62 | 63 | #### Help and Reference 64 | 65 | - [HTML5 Weekly](http://html5weekly.com/archive/) 66 | - [JavaScript Weekly](http://javascriptweekly.com/archive/) 67 | - [Responsive Design Weekly](http://responsivedesignweekly.com/) 68 | - [Move the Web Forward](http://movethewebforward.org/) 69 | - [Can I Use ... ?](http://caniuse.com/) 70 | - [HTML5 Please](http://html5please.com/) 71 | - [CSS3 Please Syntax Generator](http://css3please.com/) 72 | - [Dive Into HTML5](http://diveintohtml5.info/) 73 | - [HTML5 Rocks](http://www.html5rocks.com) 74 | 75 | #### Additional Guides 76 | 77 | We don't claim to be the only story in town, that's for sure. We're standing on the shoulders of giants. There are many, many more out there. 78 | 79 | - [Code Guide by @mdo](http://mdo.github.io/code-guide/) 80 | - [Interactive Development Best Practices](http://joemorgan.github.io/Developer-Docs/) 81 | - [Viget's old FED Docs](https://github.com/greypants/FED-docs/tree/patch-1) 82 | - [FF0000 (red) Front-end Development Guides](http://ff0000.github.io/Front-End-Development-Guidelines/) 83 | - [Starbucks Style Guide](http://www.starbucks.com/static/reference/styleguide/) 84 | - [WordPress Core Contributors HTML Guide](https://make.wordpress.org/core/handbook/best-practices/coding-standards/html/) 85 | 86 | ##### CSS Guides 87 | 88 | - [Google HTML and CSS Style Guide](http://google-styleguide.googlecode.com/svn/trunk/htmlcssguide.xml) 89 | - [CSS Tricks](http://css-tricks.com/) especially the [Snippets](http://css-tricks.com/snippets/) 90 | - [Object Oriented CSS](https://github.com/stubbornella/oocss/wiki/) 91 | - [SMACSS](http://smacss.com/) 92 | - [Idiomatic CSS](https://github.com/necolas/idiomatic-css/) 93 | - [Github CSS Primer](http://primercss.io/) 94 | - [CSS Tricks Style Guides](https://css-tricks.com/css-style-guides/) 95 | - [WordPress Core Contributors CSS Guide](https://make.wordpress.org/core/handbook/best-practices/coding-standards/css/) 96 | 97 | ##### JavaScript Guides 98 | 99 | - [Idiomatic JavaScript](https://github.com/rwldrn/idiomatic.js) 100 | - [Google's JavaScript Style Guide](http://google-styleguide.googlecode.com/svn/trunk/javascriptguide.xml) 101 | - [jQuery Core Style Guidelines](http://docs.jquery.com/JQuery_Core_Style_Guidelines) 102 | - [JavaScript Style Guides and Beautifiers](http://addyosmani.com/blog/javascript-style-guides-and-beautifiers/) 103 | - [Aloha Editor Guides - JavaScript](http://www.alohaeditor.org/guides/style_guide.html) 104 | - [Douglas Crockford's JavaScript Conventions](http://javascript.crockford.com/code.html) 105 | - [Github JS Styleguide](https://github.com/styleguide/javascript) 106 | - [WordPress Core Contributors JS Guide](https://make.wordpress.org/core/handbook/best-practices/coding-standards/javascript/) 107 | 108 | 109 | ### Acknowledgments 110 | 111 | And acknowledgments... 112 | 113 | Dozens of folks have contributed to this guide either directly, through project experience, or have served as prior art that has inspired ideas in this document. 114 | 115 | Special thanks to: 116 | 117 | - Adam McIntyre 118 | - Addy Osmani 119 | - Brad Frost 120 | - Chris Coyier 121 | - Doug Crockford 122 | - Nicholas C. Zakas 123 | - Nicolas Gallagher 124 | - Nicole Sullivan 125 | - Paul Irish 126 | - Riccardo La Rosa 127 | - Rick Waldron 128 | - Rob Larsen 129 | - Tim Berners-Lee 130 | 131 | 132 | 133 | 134 | 135 | -------------------------------------------------------------------------------- /src/scss/js-only/_prism.css: -------------------------------------------------------------------------------- 1 | /* http://prismjs.com/download.html?themes=prism-twilight&languages=markup+css+clike+javascript&plugins=line-numbers */ 2 | /** 3 | * prism.js Twilight theme 4 | * Based (more or less) on the Twilight theme originally of Textmate fame. 5 | * @author Remy Bach 6 | */ 7 | code[class*="language-"], 8 | pre[class*="language-"] { 9 | color: white; 10 | direction: ltr; 11 | font-family: Consolas, Monaco, 'Andale Mono', monospace; 12 | text-align: left; 13 | text-shadow: 0 -.1em .2em black; 14 | white-space: pre; 15 | word-spacing: normal; 16 | word-break: normal; 17 | line-height: 1.5; 18 | 19 | -moz-tab-size: 4; 20 | -o-tab-size: 4; 21 | tab-size: 4; 22 | 23 | -webkit-hyphens: none; 24 | -moz-hyphens: none; 25 | -ms-hyphens: none; 26 | hyphens: none; 27 | } 28 | 29 | pre[class*="language-"], 30 | :not(pre) > code[class*="language-"] { 31 | background: hsl(0, 0%, 8%); /* #141414 */ 32 | } 33 | 34 | /* Code blocks */ 35 | pre[class*="language-"] { 36 | border-radius: .5em; 37 | border: .3em solid hsl(0, 0%, 33%); /* #282A2B */ 38 | box-shadow: 1px 1px .5em black inset; 39 | margin: .5em 0; 40 | overflow: auto; 41 | padding: 1em; 42 | } 43 | 44 | pre[class*="language-"]::selection { 45 | /* Safari */ 46 | background: hsl(200, 4%, 16%); /* #282A2B */ 47 | } 48 | 49 | pre[class*="language-"]::selection { 50 | /* Firefox */ 51 | background: hsl(200, 4%, 16%); /* #282A2B */ 52 | } 53 | 54 | /* Text Selection colour */ 55 | pre[class*="language-"]::-moz-selection, pre[class*="language-"] ::-moz-selection, 56 | code[class*="language-"]::-moz-selection, code[class*="language-"] ::-moz-selection { 57 | text-shadow: none; 58 | background: hsla(0, 0%, 93%, 0.15); /* #EDEDED */ 59 | } 60 | 61 | pre[class*="language-"]::selection, pre[class*="language-"] ::selection, 62 | code[class*="language-"]::selection, code[class*="language-"] ::selection { 63 | text-shadow: none; 64 | background: hsla(0, 0%, 93%, 0.15); /* #EDEDED */ 65 | } 66 | 67 | /* Inline code */ 68 | :not(pre) > code[class*="language-"] { 69 | border-radius: .3em; 70 | border: .13em solid hsl(0, 0%, 33%); /* #545454 */ 71 | box-shadow: 1px 1px .3em -.1em black inset; 72 | padding: .15em .2em .05em; 73 | } 74 | 75 | .token.comment, 76 | .token.prolog, 77 | .token.doctype, 78 | .token.cdata { 79 | color: hsl(0, 0%, 47%); /* #777777 */ 80 | } 81 | 82 | .token.punctuation { 83 | opacity: .7; 84 | } 85 | 86 | .namespace { 87 | opacity: .7; 88 | } 89 | 90 | .token.tag, 91 | .token.boolean, 92 | .token.number, 93 | .token.deleted { 94 | color: hsl(14, 58%, 55%); /* #CF6A4C */ 95 | } 96 | 97 | .token.keyword, 98 | .token.property, 99 | .token.selector, 100 | .token.constant, 101 | .token.symbol, 102 | .token.builtin { 103 | color: hsl(53, 89%, 79%); /* #F9EE98 */ 104 | } 105 | 106 | .token.attr-name, 107 | .token.attr-value, 108 | .token.string, 109 | .token.char, 110 | .token.operator, 111 | .token.entity, 112 | .token.url, 113 | .language-css .token.string, 114 | .style .token.string, 115 | .token.variable, 116 | .token.inserted { 117 | color: hsl(76, 21%, 52%); /* #8F9D6A */ 118 | } 119 | 120 | .token.atrule { 121 | color: hsl(218, 22%, 55%); /* #7587A6 */ 122 | } 123 | 124 | .token.regex, 125 | .token.important { 126 | color: hsl(42, 75%, 65%); /* #E9C062 */ 127 | } 128 | 129 | .token.important, 130 | .token.bold { 131 | font-weight: bold; 132 | } 133 | .token.italic { 134 | font-style: italic; 135 | } 136 | 137 | .token.entity { 138 | cursor: help; 139 | } 140 | 141 | pre[data-line] { 142 | padding: 1em 0 1em 3em; 143 | position: relative; 144 | } 145 | 146 | /* Markup */ 147 | .language-markup .token.tag, 148 | .language-markup .token.attr-name, 149 | .language-markup .token.punctuation { 150 | color: hsl(33, 33%, 52%); /* #AC885B */ 151 | } 152 | 153 | /* Make the tokens sit above the line highlight so the colours don't look faded. */ 154 | .token { 155 | position: relative; 156 | z-index: 1; 157 | } 158 | 159 | .line-highlight { 160 | background: -moz-linear-gradient(left, hsla(0, 0%, 33%, .1) 70%, hsla(0, 0%, 33%, 0)); /* #545454 */ 161 | background: -o-linear-gradient(left, hsla(0, 0%, 33%, .1) 70%, hsla(0, 0%, 33%, 0)); /* #545454 */ 162 | background: -webkit-linear-gradient(left, hsla(0, 0%, 33%, .1) 70%, hsla(0, 0%, 33%, 0)); /* #545454 */ 163 | background: hsla(0, 0%, 33%, 0.25); /* #545454 */ 164 | background: linear-gradient(left, hsla(0, 0%, 33%, .1) 70%, hsla(0, 0%, 33%, 0)); /* #545454 */ 165 | border-bottom: 1px dashed hsl(0, 0%, 33%); /* #545454 */ 166 | border-top: 1px dashed hsl(0, 0%, 33%); /* #545454 */ 167 | left: 0; 168 | line-height: inherit; 169 | margin-top: 0.75em; /* Same as .prism’s padding-top */ 170 | padding: inherit 0; 171 | pointer-events: none; 172 | position: absolute; 173 | right: 0; 174 | white-space: pre; 175 | z-index: 0; 176 | } 177 | 178 | .line-highlight:before, 179 | .line-highlight[data-end]:after { 180 | background-color: hsl(215, 15%, 59%); /* #8794A6 */ 181 | border-radius: 999px; 182 | box-shadow: 0 1px white; 183 | color: hsl(24, 20%, 95%); /* #F5F2F0 */ 184 | content: attr(data-start); 185 | font: bold 65%/1.5 sans-serif; 186 | left: .6em; 187 | min-width: 1em; 188 | padding: 0 .5em; 189 | position: absolute; 190 | text-align: center; 191 | text-shadow: none; 192 | top: .4em; 193 | vertical-align: .3em; 194 | } 195 | 196 | .line-highlight[data-end]:after { 197 | bottom: .4em; 198 | content: attr(data-end); 199 | top: auto; 200 | } 201 | 202 | pre.line-numbers { 203 | position: relative; 204 | padding-left: 3.8em; 205 | counter-reset: linenumber; 206 | } 207 | 208 | pre.line-numbers > code { 209 | position: relative; 210 | } 211 | 212 | .line-numbers .line-numbers-rows { 213 | position: absolute; 214 | pointer-events: none; 215 | top: 0; 216 | font-size: 100%; 217 | left: -3.8em; 218 | width: 3em; /* works for line-numbers below 1000 lines */ 219 | letter-spacing: -1px; 220 | border-right: 1px solid #999; 221 | 222 | -webkit-user-select: none; 223 | -moz-user-select: none; 224 | -ms-user-select: none; 225 | user-select: none; 226 | 227 | } 228 | 229 | .line-numbers-rows > span { 230 | pointer-events: none; 231 | display: block; 232 | counter-increment: linenumber; 233 | } 234 | 235 | .line-numbers-rows > span:before { 236 | content: counter(linenumber); 237 | color: #999; 238 | display: block; 239 | padding-right: 0.8em; 240 | text-align: right; 241 | } 242 | -------------------------------------------------------------------------------- /src/js/vendor/jquery.scrollTo.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * jQuery.scrollTo 3 | * Copyright (c) 2007-2015 Ariel Flesler - afleslergmailcom | http://flesler.blogspot.com 4 | * Licensed under MIT 5 | * http://flesler.blogspot.com/2007/10/jqueryscrollto.html 6 | * @projectDescription Lightweight, cross-browser and highly customizable animated scrolling with jQuery 7 | * @author Ariel Flesler 8 | * @version 2.1.1 9 | */ 10 | ;(function(factory) { 11 | 'use strict'; 12 | if (typeof define === 'function' && define.amd) { 13 | // AMD 14 | define(['jquery'], factory); 15 | } else if (typeof module !== 'undefined' && module.exports) { 16 | // CommonJS 17 | module.exports = factory(require('jquery')); 18 | } else { 19 | // Global 20 | factory(jQuery); 21 | } 22 | })(function($) { 23 | 'use strict'; 24 | 25 | var $scrollTo = $.scrollTo = function(target, duration, settings) { 26 | return $(window).scrollTo(target, duration, settings); 27 | }; 28 | 29 | $scrollTo.defaults = { 30 | axis:'xy', 31 | duration: 0, 32 | limit:true 33 | }; 34 | 35 | function isWin(elem) { 36 | return !elem.nodeName || 37 | $.inArray(elem.nodeName.toLowerCase(), ['iframe','#document','html','body']) !== -1; 38 | } 39 | 40 | $.fn.scrollTo = function(target, duration, settings) { 41 | if (typeof duration === 'object') { 42 | settings = duration; 43 | duration = 0; 44 | } 45 | if (typeof settings === 'function') { 46 | settings = { onAfter:settings }; 47 | } 48 | if (target === 'max') { 49 | target = 9e9; 50 | } 51 | 52 | settings = $.extend({}, $scrollTo.defaults, settings); 53 | // Speed is still recognized for backwards compatibility 54 | duration = duration || settings.duration; 55 | // Make sure the settings are given right 56 | var queue = settings.queue && settings.axis.length > 1; 57 | if (queue) { 58 | // Let's keep the overall duration 59 | duration /= 2; 60 | } 61 | settings.offset = both(settings.offset); 62 | settings.over = both(settings.over); 63 | 64 | return this.each(function() { 65 | // Null target yields nothing, just like jQuery does 66 | if (target === null) return; 67 | 68 | var win = isWin(this), 69 | elem = win ? this.contentWindow || window : this, 70 | $elem = $(elem), 71 | targ = target, 72 | attr = {}, 73 | toff; 74 | 75 | switch (typeof targ) { 76 | // A number will pass the regex 77 | case 'number': 78 | case 'string': 79 | if (/^([+-]=?)?\d+(\.\d+)?(px|%)?$/.test(targ)) { 80 | targ = both(targ); 81 | // We are done 82 | break; 83 | } 84 | // Relative/Absolute selector 85 | targ = win ? $(targ) : $(targ, elem); 86 | if (!targ.length) return; 87 | /* falls through */ 88 | case 'object': 89 | // DOMElement / jQuery 90 | if (targ.is || targ.style) { 91 | // Get the real position of the target 92 | toff = (targ = $(targ)).offset(); 93 | } 94 | } 95 | 96 | var offset = $.isFunction(settings.offset) && settings.offset(elem, targ) || settings.offset; 97 | 98 | $.each(settings.axis.split(''), function(i, axis) { 99 | var Pos = axis === 'x' ? 'Left' : 'Top', 100 | pos = Pos.toLowerCase(), 101 | key = 'scroll' + Pos, 102 | prev = $elem[key](), 103 | max = $scrollTo.max(elem, axis); 104 | 105 | if (toff) {// jQuery / DOMElement 106 | attr[key] = toff[pos] + (win ? 0 : prev - $elem.offset()[pos]); 107 | 108 | // If it's a dom element, reduce the margin 109 | if (settings.margin) { 110 | attr[key] -= parseInt(targ.css('margin'+Pos), 10) || 0; 111 | attr[key] -= parseInt(targ.css('border'+Pos+'Width'), 10) || 0; 112 | } 113 | 114 | attr[key] += offset[pos] || 0; 115 | 116 | if (settings.over[pos]) { 117 | // Scroll to a fraction of its width/height 118 | attr[key] += targ[axis === 'x'?'width':'height']() * settings.over[pos]; 119 | } 120 | } else { 121 | var val = targ[pos]; 122 | // Handle percentage values 123 | attr[key] = val.slice && val.slice(-1) === '%' ? 124 | parseFloat(val) / 100 * max 125 | : val; 126 | } 127 | 128 | // Number or 'number' 129 | if (settings.limit && /^\d+$/.test(attr[key])) { 130 | // Check the limits 131 | attr[key] = attr[key] <= 0 ? 0 : Math.min(attr[key], max); 132 | } 133 | 134 | // Don't waste time animating, if there's no need. 135 | if (!i && settings.axis.length > 1) { 136 | if (prev === attr[key]) { 137 | // No animation needed 138 | attr = {}; 139 | } else if (queue) { 140 | // Intermediate animation 141 | animate(settings.onAfterFirst); 142 | // Don't animate this axis again in the next iteration. 143 | attr = {}; 144 | } 145 | } 146 | }); 147 | 148 | animate(settings.onAfter); 149 | 150 | function animate(callback) { 151 | var opts = $.extend({}, settings, { 152 | // The queue setting conflicts with animate() 153 | // Force it to always be true 154 | queue: true, 155 | duration: duration, 156 | complete: callback && function() { 157 | callback.call(elem, targ, settings); 158 | } 159 | }); 160 | $elem.animate(attr, opts); 161 | } 162 | }); 163 | }; 164 | 165 | // Max scrolling position, works on quirks mode 166 | // It only fails (not too badly) on IE, quirks mode. 167 | $scrollTo.max = function(elem, axis) { 168 | var Dim = axis === 'x' ? 'Width' : 'Height', 169 | scroll = 'scroll'+Dim; 170 | 171 | if (!isWin(elem)) 172 | return elem[scroll] - $(elem)[Dim.toLowerCase()](); 173 | 174 | var size = 'client' + Dim, 175 | doc = elem.ownerDocument || elem.document, 176 | html = doc.documentElement, 177 | body = doc.body; 178 | 179 | return Math.max(html[scroll], body[scroll]) - Math.min(html[size], body[size]); 180 | }; 181 | 182 | function both(val) { 183 | return $.isFunction(val) || $.isPlainObject(val) ? val : { top:val, left:val }; 184 | } 185 | 186 | // Add special hooks so that window scroll properties can be animated 187 | $.Tween.propHooks.scrollLeft = 188 | $.Tween.propHooks.scrollTop = { 189 | get: function(t) { 190 | return $(t.elem)[t.prop](); 191 | }, 192 | set: function(t) { 193 | var curr = this.get(t); 194 | // If interrupt is true and user scrolled, stop animating 195 | if (t.options.interrupt && t._last && t._last !== curr) { 196 | return $(t.elem).stop(); 197 | } 198 | var next = Math.round(t.now); 199 | // Don't waste CPU 200 | // Browsers don't render floating point scroll 201 | if (curr !== next) { 202 | $(t.elem)[t.prop](next); 203 | t._last = this.get(t); 204 | } 205 | } 206 | }; 207 | 208 | // AMD requirement 209 | return $scrollTo; 210 | }); 211 | 212 | 213 | -------------------------------------------------------------------------------- /src/js/script.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | /** 3 | * Author: Isobar 4 | */ 5 | var ISOBAR = { 6 | settings: { 7 | mobMenu: 770 // size at which the menu converts 8 | }, 9 | common: { 10 | $body: {}, 11 | 12 | init: function() { 13 | this.$body = ISOBAR.util.$body; 14 | 15 | this.toc(); 16 | this.anchors(); 17 | }, 18 | // generate table of contents 19 | toc: function() { 20 | var toc = document.getElementById('toc'); 21 | var hx = $('h2, h3, h4, h5', 'section'); 22 | // var frag = document.createDocumentFragment(); 23 | var hx_len = hx.length; 24 | var toc_contents = ''; 25 | var anchor, tag, the_text; 26 | var firstBlock = false; 27 | 28 | var firstWord = /\w+/; 29 | var currentMatch = ''; 30 | var inner; 31 | 32 | for (var i = 0, j = hx_len; i < j; i++) { 33 | tag = hx[i].tagName.toLowerCase(); 34 | inner = ''; 35 | 36 | if (tag === 'h2') { 37 | currentMatch = firstWord.exec(hx[i].innerHTML); 38 | currentMatch = currentMatch[0].toLowerCase(); 39 | }; 40 | 41 | the_text = $.trim(hx[i].innerHTML); 42 | anchor = currentMatch + '_' + the_text.replace(/\s+|\-/g, '_').replace(/[^A-Z0-9_]/gi, '').replace(/_+/g, '_').toLowerCase(); 43 | inner += ''; 44 | 45 | if (tag === 'h2' || tag === 'h3') { 46 | toc_contents += '
  • ' + the_text + '
  • '; 47 | } 48 | if (tag === 'h2' && firstBlock === true) { 49 | inner += 'Back to Top'; 50 | } 51 | if (inner !== '') { 52 | hx[i].id = anchor; 53 | hx[i].innerHTML += inner; 54 | }; 55 | if (tag === 'h2') { 56 | firstBlock = true; 57 | } 58 | } 59 | toc.innerHTML = toc_contents; 60 | toc.style.display = 'block'; 61 | }, 62 | // just hooking up back to top 63 | anchors: function() { 64 | var iso = ISOBAR.util; 65 | 66 | this.$body.on('click', '.back-anchor', function() { 67 | window.scrollTo(0, 0); 68 | window.location.hash = ''; 69 | return false; 70 | }); 71 | this.$body.on('click', '.js-here', function(e){ 72 | if (iso.$body.hasClass('mob')) { 73 | ISOBAR.common.scrollNow(e); 74 | } 75 | }); 76 | }, 77 | toggleMenu: function(e){ 78 | var iso = ISOBAR.util; 79 | iso.$body.toggleClass('menu-open'); 80 | 81 | if (iso.$body.hasClass('mob')) { 82 | iso.$body.on('click', '#toc a', ISOBAR.common.scrollNow); 83 | }; 84 | }, 85 | scrollNow: function(e){ 86 | e.preventDefault; 87 | var target = e.target.getAttribute('href'); 88 | if (target[0] === '#') { 89 | $.scrollTo(target, { offset: -95, duration: 250 }); 90 | }; 91 | } 92 | }, 93 | util: { 94 | $body : $('body'), // cache the body 95 | settings: {}, 96 | 97 | fire: function(func, funcname, args) { 98 | var namespace = ISOBAR; // indicate your obj literal namespace here 99 | funcname = (typeof funcname === 'undefined') ? 'init' : funcname; 100 | if (func !== '' && namespace[func] && typeof namespace[func][funcname] == 'function') { 101 | namespace[func][funcname](args); 102 | } 103 | }, 104 | loadEvents: function() { 105 | var iso = ISOBAR.util; 106 | iso.settings = ISOBAR.settings; // convenience 107 | 108 | $('html').removeClass('no-js'); 109 | 110 | //Fire resize event and call setLayout(). Put onresize events in there. 111 | window.addEventListener('resize', iso.debounce(iso.setLayout, 50)); 112 | 113 | // may want this to track the menu at some point (future) 114 | // window.addEventListener('scroll', iso.debounce(function(){ 115 | // console.log('scroll'); 116 | // }, 100)) 117 | 118 | // enable pointer events for touch devices 119 | FastClick.attach(document.body); 120 | 121 | // hit up common first. 122 | iso.fire('common'); 123 | 124 | iso.$body.on('click', '.menu-button', ISOBAR.common.toggleMenu); 125 | iso.setLayout(); 126 | }, 127 | debounce: function(func, wait, immediate) { 128 | 129 | var timeout; 130 | 131 | return function() { 132 | var context = this, 133 | args = arguments; 134 | var later = function() { 135 | timeout = null; 136 | if (!immediate) func.apply(context, args); 137 | }; 138 | var callNow = immediate && !timeout; 139 | clearTimeout(timeout); 140 | timeout = setTimeout(later, wait); 141 | if (callNow) func.apply(context, args); 142 | }; 143 | }, 144 | setLayout: function() { 145 | var iso = ISOBAR.util; 146 | 147 | //Set classes on the body based on screen width. 148 | //Display the, 'hamburger' button & menu through css based on these classes added. 149 | var screenWidth = window.innerWidth; 150 | if (screenWidth > iso.settings.mobMenu) { 151 | iso.$body.removeClass('menu-open'); 152 | 153 | if (iso.$body.hasClass('mob')) { 154 | iso.$body.removeClass('mob'); 155 | iso.$body.off('click', ISOBAR.common.scrollNow); 156 | }; 157 | } else { 158 | iso.$body.addClass('mob'); 159 | iso.overlay(); 160 | }; 161 | 162 | }, 163 | overlay: function() { 164 | if ($('.overlay').length == 0) { 165 | $('body').append('
    '); 166 | $('.overlay').on('click', function(e) { 167 | $('body').toggleClass('menu-open'); 168 | }); 169 | } 170 | } 171 | } 172 | }; 173 | 174 | // kick it all off here 175 | $(document).ready(ISOBAR.util.loadEvents); 176 | 177 | -------------------------------------------------------------------------------- /src/content/en/general.md: -------------------------------------------------------------------------------- 1 | # Isobar Front-end Code Standards 2 | 3 | ## Introduction 4 | 5 | This document contains the guidelines and best practices for the front-end web development team at Isobar. 6 | 7 | Each item here represents either: 8 | 9 | 1. A reminder to follow existing standards or industry conventions, 10 | 1. guidance on what constitutes professional patterns and organization, or 11 | 1. a decision we've made favoring one method over its alternatives. 12 | 13 | What this document is _not_ is a series of explanations as to how front-end technologies work; a basic familiarity is assumed. It also does _not_ provide evaluations of the pros and cons of various alternatives unless there is common confusion about which option is best; when appropriate we pick what we consider to be the best solutions and present them. Issues that don't yet have a clear solution are considered flexible and may or may not be listed. 14 | 15 | 20 | 21 | ### Goals 22 | 23 | Our motivations in creating this document are to: 24 | 25 | 1. Foster code consistency across our projects. 26 | 1. Facilitate ease of maintenance. 27 | 1. Ensure we create professional quality Web sites. 28 | 1. Guide staff on-boarding or educate new developers. 29 | 30 | This document is not intended to replace common sense, conventions requested by particular clients, teams, or prevent expressive or creative solutions to problems. Team or project-specific agreements or client requests will always supersede this document's content. 31 | 32 | #### Professional Responsibility 33 | 34 | We are experts in our field creating solutions for our clients and their audiences, not for ourselves. Every technology and code choice needs to be measured against the benefits to the project versus the _cool factor_ or how _trendy_ a particular solution may be. 35 | 36 | Our industry is wrought with the flavor of the month, so please be deliberate. 37 | 38 | Always remember that **just because you can does not mean you should**. Some solutions are not reliable, may not perform well, or may be difficult to maintain over time or add more code to. Always remember your code may not be the last added to a project in that particular feature area. 39 | 40 | ### Getting Started 41 | 42 | At the outset of the project it is essential to **properly understand the goals of the project** and **identify the specific deliverables** expected of the front-end team. Where your responsibilities begin and end should not be taken for granted or assumed. 43 | 44 | It's important to understand how the development environment will work, what tools will be available, and what the differences between development, test, and production environments may ultimately be. 45 | 46 | Finally, all project teams should get a reasonable understanding of the what client's **browser and device requirements** are. Make no assumptions as to the technology available either from the client or their audience. 47 | 48 | #### Pillars of Front-end Development 49 | 50 | Whenever possible, the front-end technology solutions produced shall adhere to industry best practices honoring as strict a separation of concerns as possible between: 51 | 52 | - [Semantic][link-semantic] HyperText Markup Language (HTML) for structure 53 | - Cascading Style Sheets (CSS) for presentation 54 | - JavaScript (JS) for behavior and interaction 55 | 56 | When at all possible, we strive for a [progressive enhancement][link-progressive] strategy. 57 | 58 | ### General Standards 59 | 60 | For any project: 61 | 62 | - Consistency and conventions between team members is paramount. 63 | - Solutions should be as simple and clear as possible. 64 | - Solutions should serve a specific purpose. 65 | - Clever code does not mean good code; readability is **critical** 66 | 67 | A key hallmark of professional code includes a notion that while we are writing code that must reach a desired goal, we are also creating code that must be read and understood by others. 68 | 69 | #### Code Consistency 70 | 71 | Usage of the same patterns is critical between team members so as to never cause confusion. 72 | 73 | It's worth establishing conventions at the project start or enabling automatic settings in the build or editor environments that might enforce particular rules. 74 | 75 | #### Indentation 76 | 77 | Please consistently indent, nest, include braces, quotes, and new lines so that code is clear and can be read easily. New code that is added should never deviate from existing formatting conventions or change the indent levels. 78 | 79 | For all code languages, we recommend the **use soft tabs** comprised of four spaces per tab. Hitting the Tab key in your text editor should generate four space characters rather than one tab character. This results in our code appearing identical across platforms. 80 | 81 | If **tab stops** are favored by a team, simply **maintain consistency** for a project and it's deliverables so developers can make adjustments to their editing environments a **single** time. 82 | 83 | #### Readability 84 | 85 | We encourage liberal use of whitespace, comments, and descriptive variable names as appropriate for writing easy-to-read code. 86 | 87 | - There is no need to write code in an obfuscated or compressed way for the purpose of file-size savings. 88 | - We will use automated server-side or other build processes to optimize files. 89 | - This includes concatenating files, code minification, gzipping, and setting "Far Future Expires". 90 | 91 | The ability for another developer to read the code is paramount above other concerns, especially if optimization can be handled another way. 92 | 93 | #### Third-Party Libraries 94 | 95 | Un-minified libraries and third-party scripts should be leveraged in local development environments for easier debugging if available. The code should be committed to source control in an unmodified state, or simply referenced in dependency management components that resolve the files in a build. The final products will be compressed with the rest of the source for delivery. 96 | 97 | Likewise, third-party code and libraries should never be modified and their original source and the license must be documented and be appropriate for a project. Any changes to third party code must be agreed upon and must be for specific reasons. If changes are mandated by bug fixes then the appropriate upstream project should have the changes submitted (assuming the code is part of an open source repository). 98 | 99 | Library code should be treated as an external dependency and should be considered something that may need to be wholesale updated or replaced at a later time. 100 | 101 | Inclusion of any third-party code should be carefully considered and verified with the project team as the appropriate solution to a given problem. "Adding another plug-in" is not always the best solution. Finally, selection of third party libraries should be done carefully and not be out of alignment with the nature of the problem being addressed. 102 | 103 | 107 | 108 | To be blunt, **use the right tool for the right job**. 109 | 110 | ### Deliverables 111 | 112 | Quality deliverables are essential for professionals. Sloppy or messy deliverables are unprofessional and reflect poorly on the final product and the delivery team. Please remove legacy files, be certain the work is delivered in a clean file system, and in an orderly, logical structure that serves a clear purpose. 113 | 114 | 115 | [link-semantic]: http://www.bbc.co.uk/guidelines/futuremedia/technical/semantic_markup.shtml 116 | [link-progressive]: https://en.wikipedia.org/wiki/Progressive_enhancement 117 | 118 | 119 | -------------------------------------------------------------------------------- /src/js/vendor/prism.js: -------------------------------------------------------------------------------- 1 | /* http://prismjs.com/download.html?themes=prism-twilight&languages=markup+css+clike+javascript&plugins=line-numbers */ 2 | self="undefined"!=typeof window?window:"undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope?self:{};var Prism=function(){var e=/\blang(?:uage)?-(?!\*)(\w+)\b/i,t=self.Prism={util:{encode:function(e){return e instanceof n?new n(e.type,t.util.encode(e.content),e.alias):"Array"===t.util.type(e)?e.map(t.util.encode):e.replace(/&/g,"&").replace(/e.length)break e;if(!(d instanceof a)){u.lastIndex=0;var m=u.exec(d);if(m){c&&(f=m[1].length);var y=m.index-1+f,m=m[0].slice(f),v=m.length,k=y+v,b=d.slice(0,y+1),w=d.slice(k+1),N=[p,1];b&&N.push(b);var O=new a(l,g?t.tokenize(m,g):m,h);N.push(O),w&&N.push(w),Array.prototype.splice.apply(r,N)}}}}}return r},hooks:{all:{},add:function(e,n){var a=t.hooks.all;a[e]=a[e]||[],a[e].push(n)},run:function(e,n){var a=t.hooks.all[e];if(a&&a.length)for(var r,i=0;r=a[i++];)r(n)}}},n=t.Token=function(e,t,n){this.type=e,this.content=t,this.alias=n};if(n.stringify=function(e,a,r){if("string"==typeof e)return e;if("Array"===t.util.type(e))return e.map(function(t){return n.stringify(t,a,e)}).join("");var i={type:e.type,content:n.stringify(e.content,a,r),tag:"span",classes:["token",e.type],attributes:{},language:a,parent:r};if("comment"==i.type&&(i.attributes.spellcheck="true"),e.alias){var l="Array"===t.util.type(e.alias)?e.alias:[e.alias];Array.prototype.push.apply(i.classes,l)}t.hooks.run("wrap",i);var s="";for(var o in i.attributes)s+=o+'="'+(i.attributes[o]||"")+'"';return"<"+i.tag+' class="'+i.classes.join(" ")+'" '+s+">"+i.content+""},!self.document)return self.addEventListener?(self.addEventListener("message",function(e){var n=JSON.parse(e.data),a=n.language,r=n.code;self.postMessage(JSON.stringify(t.util.encode(t.tokenize(r,t.languages[a])))),self.close()},!1),self.Prism):self.Prism;var a=document.getElementsByTagName("script");return a=a[a.length-1],a&&(t.filename=a.src,document.addEventListener&&!a.hasAttribute("data-manual")&&document.addEventListener("DOMContentLoaded",t.highlightAll)),self.Prism}();"undefined"!=typeof module&&module.exports&&(module.exports=Prism);; 3 | Prism.languages.markup={comment://,prolog:/<\?.+?\?>/,doctype://,cdata://i,tag:{pattern:/<\/?[\w:-]+\s*(?:\s+[\w:-]+(?:=(?:("|')(\\?[\w\W])*?\1|[^\s'">=]+))?\s*)*\/?>/i,inside:{tag:{pattern:/^<\/?[\w:-]+/i,inside:{punctuation:/^<\/?/,namespace:/^[\w-]+?:/}},"attr-value":{pattern:/=(?:('|")[\w\W]*?(\1)|[^\s>]+)/i,inside:{punctuation:/=|>|"/}},punctuation:/\/?>/,"attr-name":{pattern:/[\w:-]+/,inside:{namespace:/^[\w-]+?:/}}}},entity:/&#?[\da-z]{1,8};/i},Prism.hooks.add("wrap",function(t){"entity"===t.type&&(t.attributes.title=t.content.replace(/&/,"&"))});; 4 | Prism.languages.css={comment:/\/\*[\w\W]*?\*\//,atrule:{pattern:/@[\w-]+?.*?(;|(?=\s*\{))/i,inside:{punctuation:/[;:]/}},url:/url\((?:(["'])(\\\n|\\?.)*?\1|.*?)\)/i,selector:/[^\{\}\s][^\{\};]*(?=\s*\{)/,string:/("|')(\\\n|\\?.)*?\1/,property:/(\b|\B)[\w-]+(?=\s*:)/i,important:/\B!important\b/i,punctuation:/[\{\};:]/,"function":/[-a-z0-9]+(?=\()/i},Prism.languages.markup&&(Prism.languages.insertBefore("markup","tag",{style:{pattern:/[\w\W]*?<\/style>/i,inside:{tag:{pattern:/|<\/style>/i,inside:Prism.languages.markup.tag.inside},rest:Prism.languages.css},alias:"language-css"}}),Prism.languages.insertBefore("inside","attr-value",{"style-attr":{pattern:/\s*style=("|').*?\1/i,inside:{"attr-name":{pattern:/^\s*style/i,inside:Prism.languages.markup.tag.inside},punctuation:/^\s*=\s*['"]|['"]\s*$/,"attr-value":{pattern:/.+/i,inside:Prism.languages.css}},alias:"language-css"}},Prism.languages.markup.tag));; 5 | Prism.languages.clike={comment:[{pattern:/(^|[^\\])\/\*[\w\W]*?\*\//,lookbehind:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0}],string:/("|')(\\\n|\\?.)*?\1/,"class-name":{pattern:/((?:(?:class|interface|extends|implements|trait|instanceof|new)\s+)|(?:catch\s+\())[a-z0-9_\.\\]+/i,lookbehind:!0,inside:{punctuation:/(\.|\\)/}},keyword:/\b(if|else|while|do|for|return|in|instanceof|function|new|try|throw|catch|finally|null|break|continue)\b/,"boolean":/\b(true|false)\b/,"function":{pattern:/[a-z0-9_]+\(/i,inside:{punctuation:/\(/}},number:/\b-?(0x[\dA-Fa-f]+|\d*\.?\d+([Ee]-?\d+)?)\b/,operator:/[-+]{1,2}|!|<=?|>=?|={1,3}|&{1,2}|\|?\||\?|\*|\/|~|\^|%/,ignore:/&(lt|gt|amp);/i,punctuation:/[{}[\];(),.:]/};; 6 | Prism.languages.javascript=Prism.languages.extend("clike",{keyword:/\b(break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|false|finally|for|function|get|if|implements|import|in|instanceof|interface|let|new|null|package|private|protected|public|return|set|static|super|switch|this|throw|true|try|typeof|var|void|while|with|yield)\b/,number:/\b-?(0x[\dA-Fa-f]+|\d*\.?\d+([Ee][+-]?\d+)?|NaN|-?Infinity)\b/,"function":/(?!\d)[a-z0-9_$]+(?=\()/i}),Prism.languages.insertBefore("javascript","keyword",{regex:{pattern:/(^|[^/])\/(?!\/)(\[.+?]|\\.|[^/\r\n])+\/[gim]{0,3}(?=\s*($|[\r\n,.;})]))/,lookbehind:!0}}),Prism.languages.markup&&Prism.languages.insertBefore("markup","tag",{script:{pattern:/[\w\W]*?<\/script>/i,inside:{tag:{pattern:/|<\/script>/i,inside:Prism.languages.markup.tag.inside},rest:Prism.languages.javascript},alias:"language-javascript"}});; 7 | Prism.hooks.add("after-highlight",function(e){var t=e.element.parentNode,s=/\s*\bline-numbers\b\s*/;if(t&&/pre/i.test(t.nodeName)&&(s.test(t.className)||s.test(e.element.className))){s.test(e.element.className)&&(e.element.className=e.element.className.replace(s,"")),s.test(t.className)||(t.className+=" line-numbers");var a,n=1+e.code.split("\n").length,l=new Array(n);l=l.join(""),a=document.createElement("span"),a.className="line-numbers-rows",a.innerHTML=l,t.hasAttribute("data-start")&&(t.style.counterReset="linenumber "+(parseInt(t.getAttribute("data-start"),10)-1)),e.element.appendChild(a)}});; 8 | -------------------------------------------------------------------------------- /src/content/en/html.md: -------------------------------------------------------------------------------- 1 | ## HTML 2 | 3 | HTML markup defines the content of a document and gives it a rudimentary structure such as section dividers, headers, paragraphs, lists, menus, and forms. 4 | 5 | ### Goals for Markup 6 | 7 | Please follow conventions established for a given project so all team members can have the same expectations around document structure and markup. 8 | 9 | Structural consistency is critical when talking about the types of pages being used on a site or in a Web app. The markup structure provides all the necessary hooks for scripting and behavior, so it's important that the appropriate hooks are in place. 10 | 11 | A clear, clean, and concise HTML structure is also necessary for semantics, flexibility, and a **reliable deployment environment**. Do **not** deviate from established templates or patterns without architect approval. 12 | 13 | Which markup is used does matter: 14 | 15 | - Use the most *meaningful* yet *minimal* markup required to present the styles and interaction required 16 | - Application-centric deliverables often have different types of requirements; please code accordingly 17 | - **Maintain a clear separation of concerns, avoid in-line styles and in-line JavaScript whenever possible** 18 | - Have reference implementations so that each team member knows what sorts of structures are appropriate, as well as where to add new code. 19 | - Build pages as a **library of components**, in such a way that blocks of code can be broken up and reused when implemented. 20 | - Be sure front-end code is compatible with destination environments and delivery platforms. 21 | 22 | The flexible nature of HTML markup and how loosely browsers interpret markup sometimes lends itself to inconsistencies not always being discovered immediately. This belies the care necessary in crafting a document's structure and in following established patterns. 23 | 24 | ### Getting Started on Markup 25 | 26 | When crafting the HTML for a website, environment or technical constraints may impact the type of markup that can be used. Please discuss the final delivery environment in depth with technical leads and clients so that pages are not structured or styled in some way that is not effective for the project solution. 27 | 28 | Discuss types of: 29 | 30 | - Templates and types of pages. 31 | - Which sections of pages (i.e. components) are reused or managed by software vs. by hand. 32 | - Frameworks, CSS grid systems (custom or otherwise). 33 | - Server-Side delivery platforms. 34 | 35 | *Note that it is vital to take into account how the site will ultimately be maintained and who will be doing that work.* 36 | 37 | ### HTML Markup Best Practices 38 | 39 | As noted these guidelines are flexible for projects as long as consensus or need determines a particular path, consistency is what matters most. 40 | 41 | #### Semantic Markup 42 | 43 | HTML provides a number of [semantic constructs][link-semantic] that allow automated tools like search engines and screen readers to make sense of the document and to understand relationships between pieces of content. Use *semantic* markup whenever possible — that is to say use elements with specific meanings for specific purposes to convey the spirit of the markup. 44 | 45 | A well-written HTML document will make appropriate use of these semantic elements and leave all responsibility for controlling the presentation of the document to the CSS style sheet. 46 | 47 | #### HTML Standards and Browser Support 48 | 49 | All markup will be written using the latest HTML5 markup specifications from the W3C, as implemented by browsers and devices that meet project requirements. When creating markup be sure that the target environments support the techniques being implemented, or that there is a fall-back plan. 50 | 51 | Please use a common [HTML5 polyfill][link-poly] or HTML5 Shiv to enable styling and recognition of HTML5 elements in older devices' browsers. 52 | 53 | 58 | 59 | #### Doctype 60 | 61 | Always include a proper doctype to trigger standards mode. Omitting the doctype [triggers quirks mode][link-quirks] and should always be avoided. The HTML5 doctype is simple and easy to remember. 62 | 63 | ```markup 64 | 65 | ``` 66 | 67 | #### Character Encoding 68 | 69 | All markup should be delivered as UTF-8, since it has the best support for internationalization. The character encoding should be designated in both the HTTP header and the head of the document via a meta tag. If the server happens to omit the HTTP header, browsers can take a guess at the character encoding and begins parsing and rendering the markup in a particular way. If there are inconsistencies, the browser will re-parse and re-render, throwing away all that work and starting over if it encounters the meta tag and its guess was incorrect. As a best practice, we always put the meta tag as early in the `` tag as early as possible — however server-settings are ideal. 70 | 71 | ```markup 72 | 73 | ``` 74 | 75 | #### Optional and Self-closing Tags 76 | 77 | While current standards designate certain closing elements and even document level elements as optional, use all open and closing elements nested in the correct ways to ensure maximum compatibility and clarity of document structure. 78 | 79 | Generally speaking, self-closing XML (i.e. XHTML, XML) style tags are not necessary. 80 | 81 | ```markup 82 | 83 | ISOBAR 84 | 85 | 86 |

    Lorem ipsum dolor sit amet, consectetur adipisicing elit:

    87 |
      88 |
    • Vero sunt veritatis magni sit odit,
    • 89 |
    • voluptatum ratione suscipit.
    • 90 |
    91 | ``` 92 | 93 | Unusual markup (or indeed, invalid) can lead to bugs in page rendering, DOM interpretation, or even how styles are applied, so it should be avoided whenever possible. 94 | 95 | 99 | 100 | ##### Validation 101 | 102 | [Valid markup][link-valid] is a goal but not a mandate. However, be aware validation can be an excellent starting place while debugging a Web page — especially if the problems are unusual. 103 | 104 | If it becomes necessary, please have reasons for invalid markup — otherwise it is just sloppy code. 105 | 106 | #### Indentation in HTML 107 | 108 | Indent nested elements and tags with single indentation settings, whatever they may be, for each level in the hierarchy of the document. 109 | 110 | ```markup 111 |
    112 |

    Lorem ipsumLorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod.

    113 |
      114 |
    • tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam,
    • 115 |
    • quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo 116 | consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse
    • 117 |
    • cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non
    • 118 |
    • proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
    • 119 |
    120 |
    121 | ``` 122 | 123 | #### HTML5 Elements 124 | 125 | To provide additional semantic value to our documents, make use of HTML5 elements such as `
    `, `
    `, and `
    ` where appropriate. However, in cases where the HTML needs to be as backwards-compatible as possible, do not apply IDs or classes to them, since older browsers do not understand these elements by default and will not apply styling to them. 126 | 127 | ```markup 128 |
    129 | 132 |
    133 | ``` 134 | 135 | #### Attribute Values 136 | 137 | Use quotes to surround all attribute values in HTML, despite quotes being optional in HTML5. This maintains consistency between attribute values that contain whitespace and those that don't. 138 | 139 | ```markup 140 |
    141 | ``` 142 | 143 | #### IDs vs. Classes 144 | 145 | HTML elements can be identified by using the `id` and `class` attributes. An ID is a unique identifier for that particular element; no other element on the page should use the same ID. 146 | 147 | This uniqueness allows `