postcss-google-color

2.0.1 • Public • Published

PostCSS Google Color PostCSS Logo

NPM Version Build Status BGitter Chat

A PostCSS for easily invoking the colors on the Google Material design color palette

Installation

npm install postcss-google-color

Examples

Simple use

/* input */
div { color: google-color(teal) }
/* output */
div { color: #009688 } /* this is shade level 500 (default) */

Select shade level

/* input */
div { color: google-color(teal800) }
/* output */
div { color: #00695c }

Get contrasting text color

/* input */
div { background: google-color(red); color: google-color(contrast red) }
/* output */
div { background: #f44336; color: #ffffff }

Usage

Postcss JS API

postcss([require('postcss-google-color')]).process(yourCSS);

Gulp

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'));
});

Tests

npm test

License

This project is licensed under the MIT License.

Package Sidebar

Install

npm i postcss-google-color

Weekly Downloads

75

Version

2.0.1

License

MIT

Unpacked Size

23.1 kB

Total Files

10

Last publish

Collaborators

  • arpadhegedus