postcss-plugin-cssvar-mod
v1.0.4
Published
Change css variable name with suffix in rgba and rgb function.
Downloads
8
Readme
postcss-plugin-cssvar-mod
English | 简体中文
Add a suffix to the value of the css variable in the rgb(a) function.
Start
Install
npm i postcss-plugin-cssvar-mod
Call
const postcss = require("postcss"); const plugin = require("postcss-plugin-cssvar-mod"); const options = {}; postcss().use(plugin(options));
before
.test1 { color: rgb(var(--theme-color)); }
after
.test1 { color: rgb(var(--theme-color-rgb)); }
Options API
| Options | Description |
| --------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| suffix | The suffix value of the variable value, the default is -rgb
|
| functions | The regular string of the function name, the default is rgba?
|
| include | Array of file paths |
| basePath | Base path of files |
| onFinish | The callback after the processing is completed, the parameter is the de-duplication array of the processed css variable value. like[{ oldValue: '--theme-color', newValue: '--theme-color-rgb' }]
|