0.0.1 • Published 9 years ago

postcss-shades-of-gray v0.0.1

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

PostCSS Shades Of Gray Build Status

PostCSS Plugin to replace grayscale color to the closest one in a provided set of grays. It helps making the CSS more consistent to design guidelines.

.foo {
    color: #ACACAC;
}
.foo {
  color: #BBBBBB;
}

Usage

var gulp = require('gulp');
var postcss = require('postcss');
var post    = require('gulp-postcss');
var shades    = require('postcss-shades-of-gray');

postcss().use(shades);

gulp.task('default', function() {
  var postcss = require('gulp-postcss');
  return gulp.src('src/css/*.css')
    .pipe(post([shades({
      shades: ['#FFFFFF', '#BBBBBB', '#444444', '#000000'],
      normalizeHexaTo6: true
    })]))
    .pipe(gulp.dest('build/'));
});

See PostCSS docs for examples for your environment.