1.0.4 • Published 3 years ago

postcss-plugin-cssvar-mod v1.0.4

Weekly downloads
-
License
ISC
Repository
github
Last release
3 years ago

postcss-plugin-cssvar-mod

English | 简体中文

Add a suffix to the value of the css variable in the rgb(a) function.

Start

  1. Install

    npm i postcss-plugin-cssvar-mod
  2. 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

OptionsDescription
suffixThe suffix value of the variable value, the default is -rgb
functionsThe regular string of the function name, the default is rgba?
includeArray of file paths
basePathBase path of files
onFinishThe 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' }]