This document covers some basic conventions that are used in XWiki codebase. Please read over this document and make sure your code conforms to the rules here.


The following rules must be followed:

  • The HTML output produced by XWiki pages must be valid HTML 5.


The XWiki project is also following the W3C WCAG Guidelines. In addition we're also following the Dutch Web Guidelines which are even stricter than the WCAG ones. 

The following WCAG-related rules must be followed (in addition to the ones automatically enforced by the XWiki's WCAG Tests):


The following rules must be followed:

The following recommendations could be followed:

  • Properties:
    • alphabetical order
    • 2 spaces indentation
    • put a space between selector and declaration start, ex. "a {}"
    • use of CSS shorthands
    • use relative sizes (em, %) instead of fixed ones (px)
    • use appropriate CSS files for writing IE rules
      • limit as much as possible the number of IE hacks used
  • Organization:
    • comment headers for separation and grouping of different parts of the code
  • Overwriting:
    • document the localization of the overwrite using "Overwrites" and "Should be in" comments


Short comments (less then 120 characters):

/* This is a short comment. */

Long comments:

/* This is a very long comment that wraps
  on multiple lines ...
  and so on. */


This style should be used to declare sub-sections on a CSS file.

 * Section title.


  • We currently don't have a naming convention



See the Testing.


Get Connected