A PostCSS plugin to get the complementary of a color
npm install postcss-complementary
/* input */
div { color: complementary(#34bbed) }
/* output */
div { color: #ed6634 }
/* input */
div { color: complementary(#34bbed, uniform) }
/* output */
div { color: #e6a12d }
Option | Type | Default | Description |
---|---|---|---|
uniform |
Boolean | false |
Whether or not to use the uniform complementary as the default for the plugin |
postcss([require('postcss-complementary')]).process(yourCSS);
const gulp = require('gulp');
const postcss = require('gulp-postcss');
const complementary = require('postcss-complementary');
gulp.task('css', () => {
gulp.src('path/to/dev/css')
.pipe(postcss([
complementary()
]))
.pipe(gulp.dest('path/to/build/css'));
});
npm test
This project is licensed under the MIT License.