styleguide-colors
generate html markup to display a scss color map
Getting Started
Install
npm install styleguide-colors
Usage
Basic Usage
Define a source file with a scss map like this:
/* <@colors */;/* colors@> */
/* <@colors */
and /* colors@> */
define the start- and endpoint of the color map.
And use the following in the code.
var sc = require('styleguide-colors');
var options = {
separator: ',',
headline: 'All my colors',
wrapper: 'section',
templatePath: '',
sassPath: './app/styles/_variables.scss',
outputFile: '.app/output.html'
};
sc(options);
The generated output:
<!-- Generated via grunt-styleguide-colors -->All my colors 'color-definition__black': #040d13 'color-definition__white': #ffffff 'color-definition__gray': #9e9e9e
Note: if no outputFile is given, the npm module returns html as string.
Contributing
In lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code using Nodeunit.