JSPM

postcss-complementary

1.1.0
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 4
  • Score
    100M100P100Q28795F
  • License MIT

A PostCSS plugin to get the complementary of a color

Package Exports

  • postcss-complementary

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-complementary) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

PostCSS Complementary PostCSS Logo

NPM Version Build Status BGitter Chat

A PostCSS plugin to get the complementary of a color

Installation

npm install postcss-complementary

Examples

Get uniform complementary or a color

/* input */
div { color: complementary(#34bbed) }
/* output */
div { color: #e6a12d }

Get a perfect complementary of a color

/* input */
div { color: complementary(#34bbed, false) }
/* output */
div { color: #ed6634 }

Options

Option Type Default Description
uniform Boolean true Whether or not to use the uniform complementary (meaning the complementary color that also has the same apparent lightness) of the color

Usage

Postcss JS API

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

Gulp

const gulp = require('gulp');
const postcss = require('gulp-postcss');
const complementary = require('postcss-complementary');
gulp.task('css', () => {
    gulp.src('path/to/dev/css')
        .pipe(postcss([
            complementary()
        ]))
        .pipe(gulp.dest('path/to/build/css'));
});

Tests

npm test

License

This project is licensed under the MIT License.