0.1.5 • Published 9 years ago

postcss-colors.css v0.1.5

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

PostCSS Colors.css plugin

What is this?

This a plugin for the awesome CSS preprocessor PostCSS. PostCSS is a really simple preprocessor that allows you to write plugins for it that allow you define how your CSS gets processed.

Colors.css is a new set of default colors for the web by the Adam Morse. It gives new, prettier defaults for colors.

This plugin lets you write color: red or color: green and have it reflect this new color palette instead of the default browser colors.

Example

.some-class {
  color: red;
  border: 3px solid orange;
}

becomes

.some-class {
  color: #FF4136;
  border: 3px solid #FF851B;
}

Basic setup example

var postcss = require('postcss');
var colorsCss = require('./index');
var fs = require('fs');

var css = fs.readFileSync('./input.css');

var output = postcss()
  .use(colorsCss())
  .process(css)
  .css;

fs.writeFileSync('./output.css', output);

Alternatively, something like Gulp, Webpack, or Grunt would help too.

Author

:heart: Brian Holt