Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@pascalduez
Last active August 29, 2015 14:13
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pascalduez/7c357b8ce64bf8ccf471 to your computer and use it in GitHub Desktop.
Save pascalduez/7c357b8ce64bf8ccf471 to your computer and use it in GitHub Desktop.
SassDoc

SassDoc allows to document Sass items: functions, mixins, variables, placeholders.
No CSS selectors.
It uses a similar system as JSDoc, based on comments and annotations.

You can choose between two types of comments.

Inline comments (3 slashes):

///
///
///

CStyle comments [removed support from v2.0]:

/**
 *
 */

Inline comments are preferred since they are not output to resulting CSS.

1. So the first step is actually to comment your Sass code.

/// A variable named foo.
/// @type String
$foo: 'foo';

/// A mixin that just do nothing.
/// @param {String} $arg - I'm an argument.
@mixin bar($arg) {}

Check the range of annotations available and their usage: http://sassdoc.com/annotations

2. Decide how your going to use SassDoc

I. From the command line (CLI)

Install:

npm install -g sassdoc

Run:

sassdoc src dest

Where src is the folder containing your .scss files and dest the folder you want the generated documentation to be output in.

II. Or using one of the available tasks runners plugins:

Grunt: http://sassdoc.com/grunt

Gulp: http://sassdoc.com/gulp

Voilà !

@jina
Copy link

jina commented Jan 14, 2015

Thanks! I'll give this a try. :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment