2.0.0 • Published 4 years ago

postcss-better-colors v2.0.0

Weekly downloads
4
License
Apache-2.0
Repository
github
Last release
4 years ago

PostCSS Better ColorsSponsored by Version Downloads Build Status Unix Build Status Windows Dependencies

PostCSS plugin to transform CSS2 color keywords to a custom palette

This plugin can transform color keywords such as aqua, blue, lime, etc. to any other color. Bundled with the webcolors package, making three beautiful color palettes available to use in your stylesheets: clrs.cc/mrmrs, FlatUI and Material -- simply by using standard color names.

Installation

$ npm install postcss-better-colors

Usage

// dependencies
var fs = require('fs');
var postcss = require('postcss');
var palette = require('postcss-better-colors');

// css to be processed
var css = fs.readFileSync('input.css', 'utf8');

// process it
var output = postcss()
  .use(palette({
    palette: 'material'
  })
  .process(css)
  .css;

Using this input.css:

body {
  color: yellow;
  background: linear-gradient(aqua, blue 50%, purple);
}

you will get:

body {
  color: #FFEB3B;
  background: linear-gradient(#00BCD4, #2196F3 50%, #9C27B0);
}

Options

palette

Specify a webcolors palette name (mrmrs, material or flatui), or an object mapping of CSS2 color keywords to color values. By default, uses the mrmrs color palette.

License

Apache License Version 2.0, January 2004

Copyright

Copyright 2015Zaim Bakar Copyright 2017-2020Sebastian Software GmbH

2.0.0

4 years ago

1.2.3

5 years ago

1.2.2

6 years ago

1.2.1

6 years ago

1.2.0

6 years ago

1.1.4

6 years ago

1.1.3

6 years ago

1.1.2

6 years ago

1.1.1

6 years ago

1.1.0

6 years ago

1.0.1

7 years ago

1.0.0

7 years ago

0.1.2

7 years ago

0.1.1

7 years ago

0.1.0

7 years ago