A PostCSS for easily invoking the colors on the Google Material design color palette
npm install postcss-google-color
/* input */
div { color: google-color(teal) }/* output */
div { color: #009688 } /* this is shade level 500 (default) *//* input */
div { color: google-color(teal, 800) }/* output */
div { color: #00695c }/* input */
div { background: google-color(red); color: google-color(contrast red) }/* output */
div { background: #f44336; color: #ffffff }postcss([require('postcss-google-color')]).process(yourCSS);const gulp = require('gulp');
const postcss = require('gulp-postcss');
const gc = require('postcss-google-color');
gulp.task('css', () => {
gulp.src('path/to/dev/css')
.pipe(postcss([
gc()
]))
.pipe(gulp.dest('path/to/build/css'));
});npm test
This project is licensed under the MIT License.