Skip to content

Instantly share code, notes, and snippets.

@pascalduez pascalduez/SassDoc.md
Last active Aug 29, 2015

Embed
What would you like to do?
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

This comment has been minimized.

Copy link

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
You can’t perform that action at this time.