A PostCSS plugin to get the greyscale equivalent of a color
npm install postcss-greyscale
/* input */
div { color: greyscale(#34bbed) }
/* output */
div { color: #9f9f9f }
postcss([require('postcss-greyscale')]).process(yourCSS);
const gulp = require('gulp');
const postcss = require('gulp-postcss');
const greyscale = require('postcss-greyscale');
gulp.task('css', () => {
gulp.src('path/to/dev/css')
.pipe(postcss([
greyscale()
]))
.pipe(gulp.dest('path/to/build/css'));
});
npm test
This project is licensed under the MIT License.