├── .editorconfig
├── .gitignore
├── CNAME
├── LICENSE.md
├── README.md
├── _config.yml
├── _includes
├── footer.html
├── header.html
├── js.html
└── tweet-button.html
├── _layouts
└── default.html
├── _sass
├── _ads.scss
├── _og.scss
└── _syntax.scss
├── cg.scss
├── code-guide-logo.png
├── code-guide-social.png
├── code-guide.svg
├── favicon.ico
└── index.md
/.editorconfig:
--------------------------------------------------------------------------------
1 | # editorconfig.org
2 |
3 | root = true
4 |
5 | [*]
6 | charset = utf-8
7 | end_of_line = lf
8 | indent_size = 2
9 | indent_style = space
10 | insert_final_newline = true
11 | trim_trailing_whitespace = true
12 |
13 | [*.md]
14 | trim_trailing_whitespace = false
15 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | # Ignore docs files
2 | _gh_pages
3 | _site
4 | .jekyll-cache
5 | .ruby-version
6 | .sass-cache
7 |
8 | # Numerous always-ignore extensions
9 | *.diff
10 | *.err
11 | *.orig
12 | *.log
13 | *.rej
14 | *.swo
15 | *.swp
16 | *.zip
17 | *.vi
18 | *~
19 |
20 | # OS or Editor folders
21 | .DS_Store
22 | ._*
23 | Thumbs.db
24 | .cache
25 | .project
26 | .settings
27 | .tmproj
28 | *.esproj
29 | nbproject
30 | *.sublime-project
31 | *.sublime-workspace
32 | .idea
33 |
34 | # Komodo
35 | *.komodoproject
36 | .komodotools
37 |
38 | # grunt-html-validation
39 | validation-status.json
40 | validation-report.json
41 |
42 | # Folders to ignore
43 | node_modules
44 | bower_components
45 |
--------------------------------------------------------------------------------
/CNAME:
--------------------------------------------------------------------------------
1 | codeguide.co
2 |
--------------------------------------------------------------------------------
/LICENSE.md:
--------------------------------------------------------------------------------
1 | The MIT License (MIT)
2 |
3 | Copyright (c) Mark Otto.
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | Code Guide
7 |
8 |
9 |
10 | Standards for developing consistent, flexible, and sustainable HTML and CSS.
11 |
12 | Start reading ☞
13 |
14 |
15 | ---
16 |
17 | ## Setup
18 |
19 | Code Guide is built on Jekyll and hosted on GitHub Pages. To install Jekyll:
20 |
21 | ```sh
22 | gem install jekyll
23 | ```
24 |
25 | To start the local server:
26 |
27 | ```sh
28 | jekyll serve
29 | ```
30 |
31 | Open `localhost:4000` in your browser.
32 |
33 | ## License
34 |
35 | Released under MIT by, and copyright, @mdo.
36 |
37 | ## Translations
38 |
39 | Translations are maintained by their creators and may not always be up to date with the original here.
40 |
41 | - [Chinese](http://zoomzhao.github.io/code-guide/) - Translated by [Zoom Zhao](https://github.com/ZoomZhao)
42 | - [Chinese](http://codeguide.bootcss.com/) - Translated by [Wang Sai](https://github.com/wangsai)
43 | - [Dutch](http://chunfeilung.github.io/code-guide/) - Translated by [Chun Fei Lung](https://github.com/chunfeilung)
44 | - [French](http://pixelastic.github.io/code-guide/) - Translated by [Tim Carry](https://github.com/pixelastic/)
45 | - [German](http://BackendButters.github.io/code-guide/) - Translated by [BackendButters](https://github.com/BackendButters)
46 | - [German](https://philipbrembeck.github.io/code-guide/) - Translated by [Philip Brembeck](https://github.com/philipbrembeck)
47 | - [Hindi](https://hidaytrahman.github.io/code-guide/) - Translated by [Hidaytullah Rahmani](https://github.com/hidaytrahman)
48 | - [Indonesian](http://diagramatics.github.io/code-guide-id) - Translated by [Steven Sinatra](http://diagramatics.me)
49 | - [Japanese](http://kia-king.com/code-guide/) - Translated by [Kia King Ishii](https://github.com/kiaking)
50 | - [Korean](http://code-guide.aliencube.org/) - Translated by [Aliencube](https://github.com/aliencube)
51 | - [Persian](https://cg.arash-hatami.ir/) - Translated by [Arash Hatami](https://github.com/hatamiarash7)
52 | - [Polish](http://bondarewicz.github.io/code-guide/) - Translated by [Łukasz Bondarewicz](https://github.com/bondarewicz)
53 | - [Portuguese](http://diegoeis.github.io/code-guide/) - Translated by [Diego Eis](http://tableless.com.br/)
54 | - [Romanian](http://vmazare.github.io/code-guide-romanian/) - Translated by [Valeriu Mazare](https://github.com/vmazare)
55 | - [Russian](http://sadcitizen.github.io/code-guide/) - Translated by [Eugene Abrosimov](https://github.com/sadcitizen)
56 | - [Spanish](https://hansfelix.github.io/code-guide) - Translated by [Hans Felix](https://github.com/hansfelix)
57 | - [Traditional Chinese](https://codeguide.intersection.tw) - Translated by [Yuming Cheung](https://github.com/ymcheung)
58 |
59 | Have a translation you'd like to link to? Open a pull request to add it here. Be sure to keep it alphabetical.
60 |
61 | <3
62 |
--------------------------------------------------------------------------------
/_config.yml:
--------------------------------------------------------------------------------
1 | name: Code Guide by @mdo
2 | description: Standards for developing consistent, flexible, and sustainable HTML and CSS.
3 | url: https://codeguide.co
4 | permalink: pretty
5 | sass:
6 | style: compressed
7 | version: 4.0.0
8 | og_image: https://raw.githubusercontent.com/mdo/code-guide/gh-pages/code-guide-social.png
9 |
--------------------------------------------------------------------------------
/_includes/footer.html:
--------------------------------------------------------------------------------
1 |
24 |
--------------------------------------------------------------------------------
/_includes/header.html:
--------------------------------------------------------------------------------
1 |
17 |
--------------------------------------------------------------------------------
/_includes/js.html:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/_includes/tweet-button.html:
--------------------------------------------------------------------------------
1 |
4 |
--------------------------------------------------------------------------------
/_layouts/default.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 | {{ site.name }}
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
44 |
45 |
46 |
47 |
48 | {% include header.html %}
49 |
50 |
51 | {{ content }}
52 |
53 | {% include footer.html %}
54 |
55 |
56 | {% include js.html %}
57 |
58 |
59 |
--------------------------------------------------------------------------------
/_sass/_ads.scss:
--------------------------------------------------------------------------------
1 | // stylelint-disable declaration-no-important, selector-max-id
2 |
3 | //
4 | // Carbon ads
5 | //
6 |
7 | #carbonads {
8 | position: static;
9 | display: block;
10 | max-width: 400px;
11 | padding: 15px 15px 15px 160px;
12 | margin: 2rem 0 0;
13 | overflow: hidden;
14 | font-size: .8125rem;
15 | line-height: 1.4;
16 | text-align: left;
17 | background-color: var(--body-bg);
18 | border: 1px solid var(--border-color);
19 | border-radius: .5rem;
20 |
21 | a {
22 | color: var(--body-color);
23 | text-decoration: none;
24 | }
25 | }
26 |
27 | .carbon-img {
28 | float: left;
29 | margin-left: -145px;
30 | }
31 |
32 | .carbon-poweredby {
33 | display: block;
34 | margin-top: .75rem;
35 | color: var(--accent-color) !important;
36 | }
37 |
--------------------------------------------------------------------------------
/_sass/_og.scss:
--------------------------------------------------------------------------------
1 | //
2 | // Global
3 | //
4 |
5 | :root {
6 | --blue: #0d6efd;
7 | --indigo: #6610f2;
8 | --purple: #6f42c1;
9 | --pink: #d63384;
10 | --red: #dc3545;
11 | --orange: #fd7e14;
12 | --yellow: #ffc107;
13 | --green: #198754;
14 | --teal: #20c997;
15 | --cyan: #0dcaf0;
16 | --white: #fff;
17 | --gray: #6c757d;
18 | --gray-dark: #343a40;
19 |
20 | --blue-300: #6ea8fe;
21 | --blue-700: #084298;
22 |
23 | --font: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
24 | --font-heading: InterDisplay;
25 |
26 | --body-bg: #fff;
27 | --body-color: #212529;
28 | --secondary-color: #6c757d;
29 | --border-color: rgba(0, 0, 0, .1);
30 | --accent-bg: #f8f9fa;
31 | --link-color: var(--blue);
32 | --masthead-bg: var(--accent-bg);
33 | --gap: 2rem;
34 | }
35 |
36 | @media (prefers-color-scheme: dark) {
37 | :root {
38 | --body-bg: #212529;
39 | --body-color: #dee2e6;
40 | --accent-bg: #2a2f34;
41 | --link-color: var(--blue-300);
42 | --border-color: rgba(255, 255, 255, .1);
43 | }
44 | }
45 |
46 | *,
47 | *::before,
48 | *::after {
49 | box-sizing: border-box;
50 | }
51 |
52 | html {
53 | font-size: 16px;
54 | font-family: var(--font);
55 | line-height: 1.5;
56 | }
57 |
58 | body {
59 | margin: 0;
60 | color: var(--body-color);
61 | background-color: var(--body-bg);
62 | }
63 |
64 | a {
65 | color: var(--link-color);
66 | text-decoration: none;
67 |
68 | &:hover {
69 | text-decoration: underline;
70 | }
71 |
72 | code {
73 | color: inherit;
74 | }
75 | }
76 |
77 | h1, h2, h3, h4 {
78 | margin-top: 0;
79 | margin-bottom: .5rem;
80 | font-family: var(--font-heading), var(--font);
81 | font-weight: 600;
82 | line-height: 1;
83 | }
84 | h1 { font-size: 2.5rem; }
85 | h2 { font-size: 2rem; }
86 | h3 { font-size: 1.75rem; }
87 | h4 { font-size: 1.5rem }
88 |
89 | p {
90 | margin-top: 0;
91 | margin-bottom: 1rem;
92 | }
93 |
94 | blockquote {
95 | position: relative;
96 | margin: 0 1rem 1rem;
97 | font-style: italic;
98 | color: #7a7a7a;
99 |
100 | p {
101 | margin-bottom: 0;
102 | }
103 | }
104 |
105 | ul {
106 | padding-left: 1.5em;
107 | }
108 |
109 | li {
110 | padding-inline-start: 1.5ch;
111 | margin-bottom: .25rem;
112 | list-style-type: "—";
113 |
114 | &::marker { color: var(--secondary-color); }
115 | }
116 |
117 | p:last-child,
118 | ul:last-child,
119 | blockquote:last-child {
120 | margin-bottom: 0;
121 | }
122 |
123 |
124 | //
125 | // Code
126 | //
127 |
128 | code,
129 | pre {
130 | font-family: "SFMono-Regular", Menlo, "Courier New", monospace;
131 | font-size: 95%;
132 | }
133 | code {
134 | font-size: 85%;
135 | color: var(--pink);
136 | border-radius: .2rem;
137 | }
138 |
139 | pre {
140 | display: block;
141 | margin: 0 0 1rem;
142 | line-height: 1.4;
143 | white-space: pre;
144 | white-space: pre-wrap;
145 |
146 | code {
147 | padding: 0;
148 | color: inherit;
149 | background-color: transparent;
150 | border: 0;
151 | }
152 | }
153 |
154 | .highlight {
155 | margin: 0;
156 | background-color: var(--accent-bg);
157 |
158 | pre {
159 | margin-bottom: 0;
160 | padding: var(--gap);
161 | }
162 |
163 | & + .highlight {
164 | margin-top: 1rem;
165 | }
166 | }
167 |
168 |
169 | //
170 | // Masthead
171 | //
172 |
173 | .cg-icon {
174 | display: block;
175 | width: 128px;
176 | height: 128px;
177 | margin-left: -.75rem;
178 | margin-bottom: 1.5rem;
179 |
180 | @media (min-width: 768px) {
181 | width: 192px;
182 | height: 192px;
183 | margin-left: -1.25rem;
184 | }
185 | }
186 |
187 | .cg-masthead {
188 | padding-top: 2rem;
189 | padding-bottom: 3rem;
190 | margin-bottom: 1.5rem;
191 | background-color: var(--masthead-bg);
192 |
193 | p {
194 | margin-bottom: 1rem;
195 | }
196 |
197 | @media (min-width: 960px) {
198 | padding-top: 3rem;
199 | padding-bottom: 4rem;
200 | }
201 | }
202 |
203 | .cg-masthead-title {
204 | margin-bottom: 1rem;
205 | font-size: 4rem;
206 | font-weight: 700;
207 | line-height: .9;
208 | color: inherit;
209 |
210 | @media (min-width: 768px) {
211 | font-size: 6rem;
212 | }
213 | }
214 |
215 | .cg-masthead-subtitle {
216 | max-width: 46rem;
217 | margin-bottom: 1.5rem;
218 | font-size: 1.5rem;
219 | line-height: 1.25;
220 |
221 | @media (min-width: 768px) {
222 | font-size: 2rem;
223 | }
224 | }
225 |
226 |
227 | //
228 | // Content
229 | //
230 |
231 | .container {
232 | max-width: 80em;
233 | padding-right: 2rem;
234 | padding-left: 2rem;
235 | margin-right: auto;
236 | margin-left: auto;
237 |
238 | @media (min-width: 768px) {
239 | padding-right: 3rem;
240 | padding-left: 3rem;
241 | }
242 | }
243 |
244 | .content {
245 | display: flex;
246 | flex-direction: column;
247 | gap: var(--gap);
248 |
249 | @media (min-width: 768px) {
250 | display: grid;
251 | grid-template-columns: repeat(2, 1fr);
252 | gap: calc(var(--gap) * 2) var(--gap);
253 | align-items: stretch;
254 |
255 | h2 {
256 | grid-column: auto / span 2;
257 | }
258 |
259 | .highlight {
260 | height: 100%;
261 | }
262 | }
263 | }
264 |
265 |
266 | //
267 | // The Grid
268 | //
269 |
270 | @media (min-width: 768px) {
271 | .col,
272 | blockquote {
273 | grid-column: auto / span 1;
274 | }
275 | }
276 |
277 |
278 | //
279 | // Sections
280 | //
281 |
282 | h2 {
283 | padding-top: 1rem;
284 | margin-top: 3rem;
285 | margin-bottom: 0;
286 | border-top: .25rem solid;
287 | }
288 |
289 |
290 | //
291 | // Footer
292 | //
293 |
294 | .footer {
295 | grid-column: auto / span 2;
296 | padding-top: 3rem;
297 | padding-bottom: 3rem;
298 | margin-top: 5rem;
299 | border-top: .25rem solid;
300 | }
301 |
302 | .footer p {
303 | margin-bottom: .5rem;
304 | }
305 |
306 | .quick-links {
307 | display: flex;
308 | gap: 1.25rem;
309 | list-style: none;
310 | margin-left: 0;
311 | padding-left: 0;
312 | }
313 | .quick-links li {
314 | display: inline;
315 | padding-inline-start: 0;
316 | }
317 |
--------------------------------------------------------------------------------
/_sass/_syntax.scss:
--------------------------------------------------------------------------------
1 | // GitHub
2 | :root {
3 | --base00: #ffffff;
4 | --base01: #f5f5f5;
5 | --base02: #c8c8fa;
6 | --base03: #969896;
7 | --base04: #030303;
8 | --base05: #333333;
9 | --base06: #ffffff;
10 | --base07: #b08800;
11 | --base08: #ed6a43;
12 | --base09: #0086b3;
13 | --base0A: #795da3;
14 | --base0B: #183691;
15 | --base0C: #183691;
16 | --base0D: #795da3;
17 | --base0E: #a71d5d;
18 | --base0F: #333333;
19 | }
20 |
21 | // One Light
22 | // :root {
23 | // --base00: #fafafa;
24 | // --base01: #f0f0f1;
25 | // --base02: #e5e5e6;
26 | // --base03: #a0a1a7;
27 | // --base04: #696c77;
28 | // --base05: #383a42;
29 | // --base06: #202227;
30 | // --base07: #090a0b;
31 | // --base08: #ca1243;
32 | // --base09: #d75f00;
33 | // --base0A: #c18401;
34 | // --base0B: #50a14f;
35 | // --base0C: #0184bc;
36 | // --base0D: #4078f2;
37 | // --base0E: #a626a4;
38 | // --base0F: #986801;
39 | // }
40 |
41 | @media (prefers-color-scheme: dark) {
42 | // One Dark
43 | :root {
44 | --base00: #282c34;
45 | --base01: #353b45;
46 | --base02: #3e4451;
47 | --base03: #545862;
48 | --base04: #565c64;
49 | --base05: #abb2bf;
50 | --base06: #b6bdca;
51 | --base07: #d19a66;
52 | --base08: #e06c75;
53 | --base09: #d19a66;
54 | --base0A: #e5c07b;
55 | --base0B: #98c379;
56 | --base0C: #56b6c2;
57 | --base0D: #61afef;
58 | --base0E: #c678dd;
59 | --base0F: #be5046;
60 | }
61 | }
62 |
63 | .hll { background-color: #ffffff }
64 | .c { color: var(--base03) }
65 | .err { color: var(--base08) }
66 | .k { color: var(--base0E) }
67 | .l { color: var(----base09) }
68 | .n { color: var(--base08) }
69 | .o { color: var(--base08) }
70 | .p { color: var(--base05) }
71 | .cm { color: var(--base04) }
72 | .cp { color: var(--base04) }
73 | .c1 { color: var(--base03) }
74 | .cs { color: var(--base04) }
75 | .gd { color: var(--base08) }
76 | .ge { font-style: italic }
77 | .gh { color: #ffffff; font-weight: bold }
78 | .gi { color: var(--base0C) }
79 | .gp { color: var(--base04); font-weight: bold }
80 | .gs { font-weight: bold }
81 | .gu { color: var(--base0C); font-weight: bold }
82 | .kc { color: var(--base0E) }
83 | .kd { color: var(--base0E) }
84 | .kn { color: var(--base0C) }
85 | .kp { color: var(--base0E) }
86 | .kr { color: var(--base0E) }
87 | .kt { color: var(--base0A) }
88 | .ld { color: var(--base0C) }
89 | .m { color: var(--base09) }
90 | .s { color: var(--base0C) }
91 | .na { color: var(--base08) }
92 | .nb { color: var(--base05) }
93 | .nc { color: var(--base07) }
94 | .no { color: var(--base08) }
95 | .nd { color: var(--base07) }
96 | .ni { color: #ffffff }
97 | .ne { color: var(--base08) }
98 | .nf { color: var(--base0B) }
99 | .nl { color: var(--base05) }
100 | .nn { color: var(--base0A) }
101 | .nx { color: var(--base0A) }
102 | .py { color: var(--base08) }
103 | .nt { color: var(--base08) }
104 | .nv { color: var(--base08) }
105 | .ow { color: var(--base0C) }
106 | .w { color: #ffffff }
107 | .mf { color: var(--base09) }
108 | .mh { color: var(--base09) }
109 | .mi { color: var(--base09) }
110 | .mo { color: var(--base09) }
111 | .sb { color: var(--base0C) }
112 | .sc { color: #ffffff }
113 | .sd { color: var(--base04) }
114 | .s2 { color: var(--base0C) }
115 | .se { color: var(--base09) }
116 | .sh { color: var(--base0C) }
117 | .si { color: var(--base09) }
118 | .sx { color: var(--base0C) }
119 | .sr { color: var(--base0C) }
120 | .s1 { color: var(--base0C) }
121 | .ss { color: var(--base0C) }
122 | .bp { color: var(--base05) }
123 | .vc { color: var(--base08) }
124 | .vg { color: var(--base08) }
125 | .vi { color: var(--base08) }
126 | .il { color: var(--base09) }
127 |
128 | // Color commas in rgba() values
129 | .m + .o { color: var(--base03) }
130 |
131 | // Fix bash
132 | .language-sh .c { color: var(--base03) }
--------------------------------------------------------------------------------
/cg.scss:
--------------------------------------------------------------------------------
1 | ---
2 | # Front matter comment to ensure Jekyll properly reads file.
3 | ---
4 |
5 | /*
6 | * Code Guide by @mdo
7 | * Licensed MIT
8 | * https://codeguide.co
9 | */
10 |
11 | @import "ads";
12 | @import "syntax";
13 | @import "og";
14 |
--------------------------------------------------------------------------------
/code-guide-logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mdo/code-guide/6918226689cb46f6888244f1ee17389b0bd592be/code-guide-logo.png
--------------------------------------------------------------------------------
/code-guide-social.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mdo/code-guide/6918226689cb46f6888244f1ee17389b0bd592be/code-guide-social.png
--------------------------------------------------------------------------------
/code-guide.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mdo/code-guide/6918226689cb46f6888244f1ee17389b0bd592be/favicon.ico
--------------------------------------------------------------------------------
/index.md:
--------------------------------------------------------------------------------
1 | ---
2 | layout: default
3 | ---
4 |
5 | Table of contents
6 |
7 |
8 | ### [HTML](#html)
9 |
10 | - [HTML syntax](#html-syntax)
11 | - [HTML5 doctype](#html5-doctype)
12 | - [Language attribute](#language-attribute)
13 | - [IE compatibility mode](#ie-compatibility-mode)
14 | - [Character encoding](#character-encoding)
15 | - [CSS and JavaScript includes](#css-and-javascript-includes)
16 | - [Practicality over purity](#practicality-over-purity)
17 | - [Attribute order](#attribute-order)
18 | - [Boolean attributes](#boolean-attributes)
19 | - [Reduce markup](#reduce-markup)
20 | - [Editor preferences](#editor-preferences)
21 |
22 |
23 |
24 | ### [CSS](#css)
25 |
26 | - [CSS syntax](#css-syntax)
27 | - [Declaration order](#declaration-order)
28 | - [Colors](#colors)
29 | - [Logical properties](#logical-properties)
30 | - [Avoid @import`s](#avoid-imports)
31 | - [Media query placement](#media-query-placement)
32 | - [Single declarations](#single-declarations)
33 | - [Shorthand notation](#shorthand-notation)
34 | - [Nesting in preprocessors](#nesting-in-preprocessors)
35 | - [Operators in preprocessors](#operators-in-preprocessors)
36 | - [Comments](#comments)
37 | - [Class names](#class-names)
38 | - [Selectors](#selectors)
39 | - [Child and descendant selectors](#child-and-descendant-selectors)
40 | - [Organization](#organization)
41 |
42 |
43 | ## Golden rule
44 |
45 | Enforce these, or your own, agreed upon guidelines at all times. Small or large, call out what's incorrect. For additions or contributions to this Code Guide, please [open an issue on GitHub](https://github.com/mdo/code-guide/issues/new).
46 |
47 | > Every line of code should appear to be written by a single person, no matter the number of contributors.
48 |
49 | ## HTML
50 |
51 |
52 | ### Syntax
53 | {: #html-syntax }
54 |
55 | - Don't capitalize tags, including the doctype.
56 | - Use soft tabs with two spaces—they're the only way to guarantee code renders the same in any environment.
57 | - Nested elements should be indented once (two spaces).
58 | - Always use double quotes, never single quotes, on attributes.
59 | - Don't include a trailing slash in self-closing elements—the [HTML5 spec](https://html.spec.whatwg.org/multipage/syntax.html#syntax-start-tag) says they're optional.
60 | - Don’t omit optional closing tags (e.g. `` or `
70 |
71 | Hello, world!
72 |