Firefox/Windows 8 Metro Style Guides: Difference between revisions

From MozillaWiki
Jump to navigation Jump to search
No edit summary
No edit summary
Line 6: Line 6:
= Coding Guidelines =
= Coding Guidelines =
* Generally we use [https://developer.mozilla.org/en-US/docs/Developer_Guide/Coding_Style Mozilla Coding Style], with a few exceptions:
* Generally we use [https://developer.mozilla.org/en-US/docs/Developer_Guide/Coding_Style Mozilla Coding Style], with a few exceptions:
* You don't need to wrap lines to 80 characters.  Use longer lines (up to around 120 characters; use your judgement) if it improves readability.
** You don't need to wrap lines to 80 characters.  Use longer lines (up to around 120 characters; use your judgement) if it improves readability.
* Consistency is king, and supersedes any particular rule.
* Consistency is king, and supersedes any particular rule.
== JS ==
== JS ==
* else in if/else pairings are double cuddled ( eg } else {
* Coding Style exceptions:
** Put the opening brace on the same line as the "function" keyword (rather than on a separate line by itself).
== CSS ==
== CSS ==
* if you create an attribute and it has only one value, do not set it to true/false. Remove the attribute in the case of false. This produces cleaner, more concise css, without imperiling js readability.
* if you create an attribute and it has only one value, do not set it to true/false. Remove the attribute in the case of false. This produces cleaner, more concise css, without imperiling js readability.

Revision as of 00:04, 13 March 2013

Nota Bene

  • this a spot to jot down guidelines of varying types, largely for front end developers & designers. This includes code style, theming style, and whatever else will help us produce a consistent, shiny produce faster. If you have questions about this page, please ping :ally in #windev.

Design/Theming guidelines

  • use flyout panes over dialogs

Coding Guidelines

  • Generally we use Mozilla Coding Style, with a few exceptions:
    • You don't need to wrap lines to 80 characters. Use longer lines (up to around 120 characters; use your judgement) if it improves readability.
  • Consistency is king, and supersedes any particular rule.

JS

  • Coding Style exceptions:
    • Put the opening brace on the same line as the "function" keyword (rather than on a separate line by itself).

CSS

  • if you create an attribute and it has only one value, do not set it to true/false. Remove the attribute in the case of false. This produces cleaner, more concise css, without imperiling js readability.

helpful references