1.3.0 • Published 5 years ago

postcss-alter-color v1.3.0

Weekly downloads
1
License
MIT
Repository
github
Last release
5 years ago

postcss-alter-color

Build Status

A PostCSS plugin to replace one color with another color.

Install

npm install --save postcss-alter-color

Usage

const postcss = require('postcss');
const alterColorPlugin = require('postcss-alter-color');

const config = {
  from: 'darkslategray',
  to: '#556832'
};

postcss()
  .use(alterColorPlugin(config))

Input CSS:

body {
  background: white;
  color: darkslategray;
}
p {
  color: #2f4f4f;
}
.quote {
  border-left: 1px solid rgb(47, 79, 79);
  border-right: solid hsl(180, 25%, 25%) 1px;
}

Output CSS:

body {
  background: white;
  color: #556832;
}
p {
  color: #556832;
}
.quote {
  border-left: 1px solid #556832;
  border-right: solid #556832 1px;
}

License

MIT