postcss-color-invert
v0.0.1
Published
A PostCSS plugin to invert colors
Downloads
14
Maintainers
Readme
postcss-color-invert
A PostCSS plugin to invert colors
- Supports inverting colors specified in hex, RGB, RGBA, HSL, and HSLA formats
Usage
const fs = require('fs')
const path = require('path')
const postcss = require('postcss')
const postcssColorInvert = require('postcss-color-invert')
const inputFile = path.join(__dirname, 'input.css')
const input = fs.readFileSync(inputFile, 'utf8')
console.log(input) // => 'a { color: #ff0000; }'
postcss([postcssColorInvert()])
.process(input, { from: inputFile })
.then(function (result) {
console.log(result.css) // => 'a { color: #00ffff; }'
})
Installation
$ yarn add --dev postcss-color-invert