palette-factory

For a given color palette, generate color files for use in different languages and a preview page

Usage no npm install needed!

<script type="module">
  import paletteFactory from 'https://cdn.skypack.dev/palette-factory';
</script>

README

palette-factory NPM version Build Status Dependency Status

For a given color palette, generate color files for use in different languages and a preview page

Command-line Usage

Install

$ npm install -g palette-factory

Then

$ palette-factory input/palette.scss --type js,html --output output/name

Input (.scss)

The input is a .scss file, with a special property that you can use markdown in the comments. However only // ... syntax is allowed for comments, not /* ... */.

// # Colors
// ## Test
$blue: #0066ff;
$dark-blue: #0055ff;
$dark-blue2: lighten($dark-blue, 30%);

Output (.js)

Colors are ready to use as variables in javascript.

export var colors = {
// # Colors
// ## Test
blue: '#0066ff',
darkBlue: '#0055ff',
darkBlue2: '#99bbff',
};

Output (.html)

A vanilla preview page. You can easily add style to make it looks nicer.

Library Usage

$ npm install --save palette-factory
var paletteFactory = require('palette-factory');

License

Apache-2.0 © Krist Wongsuphasawat