postcss-plugin-color-functions
PostCSS plugin to implement commonly used color functions, including ant-design's colorPalette function and SASS/compass color functions.
Inspired, and modified from, postcss-color-function,postcss-sass-color-functions.
Installation
npm install postcss-plugin-color-functions
Usage
// dependenciesvar fs = var postcss = var sassColorFunctions = // css to be processedvar css = fs // process cssvar output = css
Using this input.css
:
you will get:
Checkout tests.js for examples.
Currently Supported functions
colorPalette(color, index)
mix(one, two, weight)
rgba(color, alpha)
darken(color, amount)
lighten(color, amount)
tint(color, amount)
shade(color, amount)