Fork for personal hacking, please use original at jacobrask/styledocco.Automatically generate a style guide from your stylesheets.

6 years after
 _______ __         __        _____
|     __|  |_.--.--|  |-----.|     \-----.----.----.-----.
|__     |   _|  |  |  |  -__||  --  | _  |  __|  __|  _  |
|_______|____|___  |__|_____||_____/_____|____|____|_____|

StyleDocco generates documentation and style guide documents from your stylesheets.

Stylesheet comments will be parsed through Markdown and displayed in a generated HTML document. You can write code examples inside GitHub Markdown code fences (```) or prefixed with 4 spaces in your comments, and StyleDocco both renders the HTML and shows the code example.

The document is automatically split into new sections when it encounters a level 1 or 2 heading. Read more about the heading syntax in the Markdown guide. Only comments at the beginning of new lines are included, so to exclude something from the style guide, put some whitespace before the comment.

If your project includes a README file, it will be used as the base for an index.html. StyleDocco will also add some default styles to your documentation, but they are easy to modify to make it fit with your project.

StyleDocco will automatically compile any SASS, SCSS, Less or Stylus code before it is applied to the page.


StyleDocco requires Node.js.

npm install -g styledocco

or check out this repository.

StyleDocco is free software, released under the MIT license.


styledocco [options] [INPUT]


  • --name, -n Name of the project (required)
  • --out, -o Output directory (default: "docs")
  • --tmpl Directory for custom docs.jade template (optional)
  • --overwrite Overwrite existing files (docs.css) in target directory.
  • --pass Pass arguments through to the CSS precompiler (optional) (ex: --pass="--include-path=../less/include")


/* Provides extra visual weight and identifies the primary action in a set of buttons
<button class="btn primary">Primary</button>  
``` */
.btn.primary {
    background: blue;
    color: white;

Would display the description, a button as well as the example HTML code. The CSS will be included in the style element of the document.

See the examples folder for more in-depth examples.


A lot of the heavy lifting in StyleDocco is done by the excellent Marked module by Christopher Jeffrey. The original Docco by Jeremy Ashkenas and Docco Husky by Mike Brevoort were also of great help to this project.

Related Repositories



Landscaping With Front-end Tools ...



Community driven list of useful things for Front End Developers ...



An overview of automatic living styleguide generators ...



This project aims at making sure your style sheets are fully documented whilst b ...



:thumbsup: A curated contents of amazing CSS Ever :) ...

Top Contributors

jacobrask jashkenas mbrevoort andrewschaaf strathmeyer nevir G3z pascalopitz ddlsmurf thejefflarson jedahan raoulmillais tswicegood isaacs mathieuravaux