JSPM

postcss-short-color

3.0.0
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 4443
  • Score
    100M100P100Q129307F
  • License CC0-1.0

Define background-color within the color property in CSS

Package Exports

  • postcss-short-color

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (postcss-short-color) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

Color Shorthand PostCSS Logo

NPM Version Build Status Windows Build Status ![Gitter Chat][git-img]

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