forked from mdo/code-guide
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
39 changed files
with
1,409 additions
and
1,030 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
1.9.3-p448 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
name: "Code Guide" | ||
description: "Standards for developing flexible, durable, and sustainable HTML and CSS." | ||
url: http://mdo.github.com/code-guide | ||
name: Code Guide by @mdo | ||
description: Standards for developing flexible, durable, and sustainable HTML and CSS. | ||
url: http://mdo.github.com/code-guide | ||
|
||
markdown: rdiscount | ||
permalink: pretty | ||
pygments: true | ||
markdown: rdiscount | ||
permalink: pretty | ||
pygments: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
/* Bad example */ | ||
.t { ... } | ||
.red { ... } | ||
.header { ... } | ||
|
||
/* Good example */ | ||
.tweet { ... } | ||
.important { ... } | ||
.tweet-header { ... } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
/* Bad example */ | ||
/* Modal header */ | ||
.modal-header { | ||
... | ||
} | ||
|
||
/* Good example */ | ||
/* Wrapping element for .modal-title and .modal-close */ | ||
.modal-header { | ||
... | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
.declaration-order { | ||
/* Positioning */ | ||
position: absolute; | ||
top: 0; | ||
right: 0; | ||
bottom: 0; | ||
left: 0; | ||
z-index: 100; | ||
|
||
/* Box-model */ | ||
display: block; | ||
float: right; | ||
width: 100px; | ||
height: 100px; | ||
|
||
/* Typography */ | ||
font: normal 13px "Helvetica Neue", sans-serif; | ||
line-height: 1.5; | ||
color: #333; | ||
text-align: center; | ||
|
||
/* Visual */ | ||
background-color: #f5f5f5; | ||
border: 1px solid #e5e5e5; | ||
border-radius: 3px; | ||
|
||
/* Misc */ | ||
opacity: 1; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
.element { ... } | ||
.element-avatar { ... } | ||
.element-selected { ... } | ||
|
||
@media (min-width: 480px) { | ||
element { ... } | ||
.element-avatar { ... } | ||
.element-selected { ... } | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
// Without nesting | ||
.table > thead > tr > th { … } | ||
.table > thead > tr > td { … } | ||
|
||
// With nesting | ||
.table > thead > tr { | ||
> th { … } | ||
> td { … } | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
/* Prefixed properties */ | ||
.selector { | ||
-webkit-box-shadow: 0 1px 2px rgba(0,0,0,.15); | ||
box-shadow: 0 1px 2px rgba(0,0,0,.15); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
/* Bad example */ | ||
span { ... } | ||
.page-container #stream .stream-item .tweet .tweet-header .username { ... } | ||
.avatar { ... } | ||
|
||
/* Good example */ | ||
.avatar { ... } | ||
.tweet-header .username { ... } | ||
.tweet .avatar { ... } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
/* Single declarations */ | ||
.span1 { width: 60px; } | ||
.span2 { width: 140px; } | ||
.span3 { width: 220px; } | ||
|
||
.sprite { | ||
display: inline-block; | ||
width: 16px; | ||
height: 15px; | ||
background-image: url(../img/sprite.png); | ||
} | ||
.icon { background-position: 0 0; } | ||
.icon-home { background-position: 0 -20px; } | ||
.icon-account { background-position: 0 -40px; } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
/* Bad CSS */ | ||
.selector, .selector-secondary, .selector[type=text] { | ||
padding:15px; | ||
margin:0px 0px 15px; | ||
background-color:rgba(0, 0, 0, 0.5); | ||
box-shadow:0 1px 2px #CCC,inset 0 1px 0 #FFFFFF | ||
} | ||
|
||
/* Good CSS */ | ||
.selector, | ||
.selector-secondary, | ||
.selector[type="text"] { | ||
padding: 15px; | ||
margin: 0 0 15px; | ||
background-color: rgba(0,0,0,.5); | ||
box-shadow: 0 1px 2px #ccc, inset 0 1px 0 #fff; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
@font-face { | ||
font-family: 'fontello'; | ||
src: url('../font/fontello.eot?74318141'); | ||
src: url('../font/fontello.eot?74318141#iefix') format('embedded-opentype'), | ||
url('../font/fontello.woff?74318141') format('woff'), | ||
url('../font/fontello.ttf?74318141') format('truetype'), | ||
url('../font/fontello.svg?74318141#fontello') format('svg'); | ||
font-weight: normal; | ||
font-style: normal; | ||
} | ||
|
||
[class^="icon-"]:before, [class*=" icon-"]:before { | ||
font-family: "fontello"; | ||
font-style: normal; | ||
font-weight: normal; | ||
speak: none; | ||
display: inline-block; | ||
text-decoration: inherit; | ||
width: 1em; | ||
margin-right: .2em; | ||
text-align: center; | ||
font-variant: normal; | ||
text-transform: none; | ||
} | ||
|
||
.icon-github-circled:before { content: '\e800'; } /* '' */ | ||
.icon-twitter:before { content: '\e801'; } /* '' */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,16 @@ | ||
<header class="masthead"> | ||
<h1>{{ site.name }}</h1> | ||
<p class="lead">{{ site.description }}</p> | ||
</header> | ||
<div class="container"> | ||
<span class="icon">✍</span> | ||
<h1>{{ site.name }}</h1> | ||
<p class="lead">{{ site.description }}</p> | ||
|
||
<hr> | ||
<p class="masthead-links"> | ||
<a href="https://github.com/mdo/code-guide"> | ||
<span class="icon icon-github-circled"></span> | ||
</a> | ||
<a href="https://twitter.com/mdo"> | ||
<span class="icon icon-twitter"></span> | ||
</a> | ||
</p> | ||
</div> | ||
</header> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
<a class="..." id="..." data-modal="toggle" href="#"> | ||
Example link | ||
</a> | ||
|
||
<input class="form-control" type="text"> | ||
|
||
<img src="..." alt="..."> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
<input type="text" disabled> | ||
|
||
<input type="checkbox" value="1" checked> | ||
|
||
<select> | ||
<option value="1" selected></option> | ||
</select> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
<!DOCTYPE html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
.element { | ||
... | ||
} | ||
.element-title { | ||
... | ||
} | ||
.element-button { | ||
... | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
<!-- Not so great --> | ||
<span class="avatar"> | ||
<img src="..."> | ||
</span> | ||
|
||
<!-- Better --> | ||
<img class="avatar" src="..."> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<title>Page title</title> | ||
</head> | ||
<body> | ||
<img src="images/company-logo.png" alt="Company"> | ||
<h1 class="hello-world">Hello, world!</h1> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
.hll { background-color: #ffffcc } | ||
/*{ background: #f0f3f3; }*/ | ||
.c { color: #999; } /* Comment */ | ||
.err { color: #AA0000; background-color: #FFAAAA } /* Error */ | ||
.k { color: #006699; } /* Keyword */ | ||
.o { color: #555555 } /* Operator */ | ||
.cm { color: #999; } /* Comment.Multiline */ /* Edited to remove italics and make into comment */ | ||
.cp { color: #009999 } /* Comment.Preproc */ | ||
.c1 { color: #999; } /* Comment.Single */ | ||
.cs { color: #999; } /* Comment.Special */ | ||
.gd { background-color: #FFCCCC; border: 1px solid #CC0000 } /* Generic.Deleted */ | ||
.ge { font-style: italic } /* Generic.Emph */ | ||
.gr { color: #FF0000 } /* Generic.Error */ | ||
.gh { color: #003300; } /* Generic.Heading */ | ||
.gi { background-color: #CCFFCC; border: 1px solid #00CC00 } /* Generic.Inserted */ | ||
.go { color: #AAAAAA } /* Generic.Output */ | ||
.gp { color: #000099; } /* Generic.Prompt */ | ||
.gs { } /* Generic.Strong */ | ||
.gu { color: #003300; } /* Generic.Subheading */ | ||
.gt { color: #99CC66 } /* Generic.Traceback */ | ||
.kc { color: #006699; } /* Keyword.Constant */ | ||
.kd { color: #006699; } /* Keyword.Declaration */ | ||
.kn { color: #006699; } /* Keyword.Namespace */ | ||
.kp { color: #006699 } /* Keyword.Pseudo */ | ||
.kr { color: #006699; } /* Keyword.Reserved */ | ||
.kt { color: #007788; } /* Keyword.Type */ | ||
.m { color: #FF6600 } /* Literal.Number */ | ||
.s { color: #d44950 } /* Literal.String */ | ||
.na { color: #4f9fcf } /* Name.Attribute */ | ||
.nb { color: #336666 } /* Name.Builtin */ | ||
.nc { color: #00AA88; } /* Name.Class */ | ||
.no { color: #336600 } /* Name.Constant */ | ||
.nd { color: #9999FF } /* Name.Decorator */ | ||
.ni { color: #999999; } /* Name.Entity */ | ||
.ne { color: #CC0000; } /* Name.Exception */ | ||
.nf { color: #CC00FF } /* Name.Function */ | ||
.nl { color: #9999FF } /* Name.Label */ | ||
.nn { color: #00CCFF; } /* Name.Namespace */ | ||
.nt { color: #2f6f9f; } /* Name.Tag */ | ||
.nv { color: #003333 } /* Name.Variable */ | ||
.ow { color: #000000; } /* Operator.Word */ | ||
.w { color: #bbbbbb } /* Text.Whitespace */ | ||
.mf { color: #FF6600 } /* Literal.Number.Float */ | ||
.mh { color: #FF6600 } /* Literal.Number.Hex */ | ||
.mi { color: #FF6600 } /* Literal.Number.Integer */ | ||
.mo { color: #FF6600 } /* Literal.Number.Oct */ | ||
.sb { color: #CC3300 } /* Literal.String.Backtick */ | ||
.sc { color: #CC3300 } /* Literal.String.Char */ | ||
.sd { color: #CC3300; font-style: italic } /* Literal.String.Doc */ | ||
.s2 { color: #CC3300 } /* Literal.String.Double */ | ||
.se { color: #CC3300; } /* Literal.String.Escape */ | ||
.sh { color: #CC3300 } /* Literal.String.Heredoc */ | ||
.si { color: #AA0000 } /* Literal.String.Interpol */ | ||
.sx { color: #CC3300 } /* Literal.String.Other */ | ||
.sr { color: #33AAAA } /* Literal.String.Regex */ | ||
.s1 { color: #CC3300 } /* Literal.String.Single */ | ||
.ss { color: #FFCC33 } /* Literal.String.Symbol */ | ||
.bp { color: #336666 } /* Name.Builtin.Pseudo */ | ||
.vc { color: #003333 } /* Name.Variable.Class */ | ||
.vg { color: #003333 } /* Name.Variable.Global */ | ||
.vi { color: #003333 } /* Name.Variable.Instance */ | ||
.il { color: #FF6600 } /* Literal.Number.Integer.Long */ | ||
|
||
.css .o, | ||
.css .o + .nt, | ||
.css .nt + .nt { color: #999; } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.