postcss-functions
PostCSS plugin for exposing JavaScript functions.
Installation
npm install --save-dev postcss postcss-functions
Usage
;;; const options = //options; const css = fs; ;
Example of a function call:
Options
functions
Type: Object
An object containing functions. The function name will correspond with the object key.
Example:
;;
{ const darken = 1 - ; const rgba = ; const r = rgba0 * darken; const g = rgba1 * darken; const b = rgba2 * darken; return ;}
;
glob
?
Hey, what happened to Versions prior to 4.0.0 had a globbing feature built in, but I've since decided to remove this feature from postcss-functions
. This means one less dependency and a smaller package size. For people still interested in this feature, you are free to pair postcss-functions
with the globbing library of your choice and pass the import
ed JavaScript files to the functions
option as described above.