postcss-colour-functions
PostCSS plugin for Sass-like colour functions.
..
Install
npm install postcss-colour-functions --save
Then just require it in whatever task runner you prefer like so:
var colourFunctions = ;
..
Colour Functions
The plugin expects colours to be entered in either RGB/A or hexidecimal format. No HSL is usable as yet. It does also accept some basic CSS colour codes, but the list is by no means exhaustive.
darken
Darkens a colour by a specific amount, specified either as a decimal or percentage:
/* so this */ /* becomes this */
lighten
The same as darken
, except it tints the colour as opposed to shading it:
/* so this */ /* becomes this */
opacity
Specify an opacity for a given colour. This returns an rgba
value:
/* so this */ /* becomes this */
..
License
MIT
If you have any improvements I'm super keen to pull them in.