Home

Awesome

THIS REPO HAS BEEN MOVED TO vieron/ui-docs

css-docs

CSS Styleguide Generator focused on CSS Modular Architectures and written in Javascript.

css-docs is a WORK IN PROGRESS but you can see a demo here

Features

Installation

$ npm install css-docs

Usage

css-docs is a node package, you can write a small .js file and run it from the command line. See example/css-docs.js

Or if you are using Grunt, there is a css-docs grunt plugin here.

Example

/**
 * Icon
 * Lorem ipsum Non do id tempor laboris do ut veniam in sint fugiat fugiat
 * adipisicing elit Excepteur.
 *
 * @modifier .Ico-edit Lorem ipsum dolor sit amet
 * @modifier .Ico-settings Lorem ipsum dolor sit amet
 *
 * @markup
 * <i class="Ico {{classes}}"></i>
 *
 * @styleguide components.icon
 */
/**
 * Button
 * Lorem ipsum Non do id tempor laboris do ut veniam in sint fugiat fugiat
 * adipisicing elit Excepteur.
 *
 * @state :hover
 * @state .js-isDisabled Lorem ipsum dolor sit amet
 *
 * @modifier .btn--success Lorem ipsum dolor sit amet
 * @modifier .btn--cancel Lorem ipsum dolor sit amet
 *
 * @depends component.icon
 * @depends component.foo
 *
 * @extends component.link
 *
 * @markup
 * <a class="button {{classes}}">Button</a>
 *
 * @markup
 * <button class="button {{classes}}">Button</button>
 *
 * @markup
 * <a class="button {{classes}}">
 *     {{use 'components.icon Ico--edit'}}
 *     <span>Button</span>
 * </a>
 *
 * @styleguide components.button
 */
/**
 * Button Group
 * Lorem ipsum Non do id tempor laboris do ut veniam in sint fugiat fugiat
 * adipisicing elit Excepteur.
 *
 * @modifier .BtnGroup--compact Lorem ipsum dolor sit amet
 * @modifier .BtnGroup--fullWidth Lorem ipsum dolor sit amet
 *
 * @depends component.button
 *
 * @markup
 * <div class="BtnGroup {{classes}}">
 *     {{#repeat 4}}
 *         {{use 'components.button'}}
 *     {{/repeat}}
 * </div>
 *
 * @styleguide components.buttonGroup
 */

Options

NameTypeDefaultDescription
titleString'css-docs'Title used in the generated Docs
logoString/BooleanfalseIf it's a String is used as src attribute of an image tag. It replaces title.
docsPathString'docs/'Path where generated Docs are placed
docsAssetsPathString'docs/assets/css-docs/'Path where theme assets are copied to use in generated Docs
styleDirString'assets/sass/'Path where your project CSS/sass/less files are located.
styleFileExtArray['.scss', '.css', '.sass', '.styl', '.less']Valid file extensions to search for comments. Used by styleDir.
ignoreArray['**/bourbon/**']Ignore files to be parsed. Uses multimatch
builtAssetsDirString'assets/'Your project assets (images, fonts, javascripts). That are copied to docsPath + '/assets'.
builtCSSPathString'css/built.css'Path to the compiled, concatenated, mininified... CSS. Relative to builtAssetsDir.

Doc block variables (for templating)

Development

Checkout the project and go to:

$ git clone git@github.com:vieron/css-docs.git
$ cd css-docs/example
$ git clone git@github.com:vieron/css-docs.git docs
$ cd docs
$ git checkout gh-pages

Compile example sass

$ cd example
$ sass --watch assets/sass/ducksboard.scss:assets/css/built.css

Generate docs

$ node css-docs.js

TO-DO