Noiseless Peaceful Morning
Share your code. npm Orgs help your team discover, share, and reuse code. Create a free org »

postcss-short-color

3.0.0 • Public • Published

Color Shorthand PostCSS Logo

NPM Version Build Status Windows Build Status Gitter Chat

Color Shorthand lets you define background-color within the color property in CSS.

/* before */
 
header {
  color: #abccfc #212231;
}
 
/* after */
 
header {
  color: #abccfc;
  background-color: #212231;
}

Options

prefix

Type: String
Default: ""

Adds an optional prefix to the color property (e.g. "x" for -x-color). Wrapping dashes (-) are automatically applied.

skip

Type: String
Default: "*"

Specifies the skip token used to ignore a length.

Usage

Add Color Shorthand to your build tool:

npm install postcss-short-color --save-dev

Node

require('postcss-short-color').process(YOUR_CSS, { /* options */ });

PostCSS

Add PostCSS to your build tool:

npm install postcss --save-dev

Load Color Shorthand as a PostCSS plugin:

postcss([
  require('postcss-short-color')({ /* options */ })
]).process(YOUR_CSS, /* options */);

Gulp

Add Gulp PostCSS to your build tool:

npm install gulp-postcss --save-dev

Enable Color Shorthand within your Gulpfile:

var postcss = require('gulp-postcss');
 
gulp.task('css', function () {
  return gulp.src('./src/*.css').pipe(
    postcss([
      require('postcss-short-color')({ /* options */ })
    ])
  ).pipe(
    gulp.dest('.')
  );
});

Grunt

Add Grunt PostCSS to your build tool:

npm install grunt-postcss --save-dev

Enable Color Shorthand within your Gruntfile:

grunt.loadNpmTasks('grunt-postcss');
 
grunt.initConfig({
  postcss: {
    options: {
      use: [
        require('postcss-short-color')({ /* options */ })
      ]
    },
    dist: {
      src: '*.css'
    }
  }
});

install

npm i postcss-short-color

Downloadsweekly downloads

1,998

version

3.0.0

license

CC0-1.0

repository

githubgithub

last publish

collaborators

  • avatar