https://codeguide.co
Code Guide by @mdo
Standards for developing consistent, flexible, and sustainable HTML and CSS
Code Guide by @mdo Code Guide Standards for developing consistent, flexible, and sustainable HTML and CSS. Created by @mdo · v4.0.0 · GitHub repo Table of contents HTML HTML syntax HTML5 doctype Language attribute IE compatibility mode Character encoding CSS and JavaScript includes Practicality over purity Attribute order Boolean attributes Reduce markup Editor preferences CSS CSS syntax Declaration order Colors Logical properties Avoid @import`s Media query placement Single declarations Shorthand notation Nesting in preprocessors Operators in preprocessors Comments Class names Selectors Child and descendant selectors Organization Golden rule 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. Every line of code should appear to be written by a single person, no matter the number of contributors. HTML Syntax Don’t capitalize tags, including the doctype. Use soft tabs with two spaces—they’re the only way to guarantee code renders the same in any environment. Nested elements should be indented once (two spaces). Always use double quotes, never single quotes, on attributes. Don’t include a trailing slash in self-closing elements—the HTML5 spec says they’re optional. Don’t omit optional closing tags (e.g. or