From 5850f637ab8247ab36d7153d1e7025feca0bb567 Mon Sep 17 00:00:00 2001 From: Mark Otto Date: Sat, 12 Jul 2014 15:36:08 -0700 Subject: [PATCH] code guide, fixes #14126 --- CONTRIBUTING.md | 18 ++++-------------- 1 file changed, 4 insertions(+), 14 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 8c437df9af..c0c9820f6d 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -154,26 +154,16 @@ license your work under the terms of the [MIT License](LICENSE.md). ### HTML -- Two spaces for indentation, never tabs. -- Double quotes only, never single quotes. -- Always use proper indentation. +[Adhere to the Code Guide.](http://codeguide.co/#html) + - Use tags and elements appropriate for an HTML5 doctype (e.g., self-closing tags). - Use CDNs and HTTPS for third-party JS when possible. We don't use protocol-relative URLs in this case because they break when viewing the page locally via `file://`. - Use [WAI-ARIA](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA) attributes in documentation examples to promote accessibility. ### CSS -- CSS changes must be done in `.less` files first, never just in the compiled `.css` files. -- Adhere to the [CSS property order](http://markdotto.com/2011/11/29/css-property-order/). -- Multiple-line approach (one property and value per line). -- Always a space after a property's colon (e.g., `display: block;` and not `display:block;`). -- End all lines with a semi-colon. -- For multiple, comma-separated selectors, place each selector on its own line. -- Don't add vendor prefixed properties to their unprefixed counterparts (e.g., only `box-sizing` and not also include `-webkit-box-sizing`), as this is done automagically at build time. -- Attribute selectors, like `input[type="text"]` should always wrap the attribute's value in double quotes, for consistency and safety (see this [blog post on unquoted attribute values](http://mathiasbynens.be/notes/unquoted-attribute-values) that can lead to XSS attacks). -- Attribute selectors should only be used where absolutely necessary (e.g., form controls) and should be avoided on custom components for performance and explicitness. -- Series of classes for a component should include a base class (e.g., `.component`) and use the base class as a prefix for modifier and sub-components (e.g., `.component-lg`). -- Avoid inheritance and over nesting—use single, explicit classes whenever possible. +[Adhere to the Code Guide.](http://codeguide.co/#css) + - When feasible, default color palettes should comply with [WCAG color contrast guidelines](http://www.w3.org/TR/WCAG20/#visual-audio-contrast). - Except in rare cases, don't remove default `:focus` styles (via e.g. `outline: none;`) without providing alternative styles. See [this A11Y Project post](http://a11yproject.com/posts/never-remove-css-outlines/) for more details.