🚨 Active Supply Chain Attack:node-ipc Package Compromised.Learn More
Socket
Book a DemoSign in
Socket

postcss-plugin-cssvar-mod

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

postcss-plugin-cssvar-mod

Change css variable name with suffix in rgba and rgb function.

latest
Source
npmnpm
Version
1.0.4
Version published
Maintainers
1
Created
Source

postcss-plugin-cssvar-mod

简体中文 | English

给 rgb(a)函数中的 css 变量值加入后缀。

使用

  • 安装

    npm i postcss-plugin-cssvar-mod
    
  • 调用

    const postcss = require("postcss");
    const plugin = require("postcss-plugin-cssvar-mod");
    
    const options = {};
    postcss().use(plugin(options));
    

    调用前

    .test1 {
      color: rgb(var(--theme-color));
    }
    

    调用后

    .test1 {
      color: rgb(var(--theme-color-rgb));
    }
    

选项说明

选项说明
suffix变量值的后缀值,默认是-rgb
functions函数名的正则字符串,默认是rgba?
include文件路径数组
basePath文件的基准目录
onFinish处理完成后的回调,参数是处理的 css 变量值的去重数组。如[{ oldValue: '--theme-color', newValue: '--theme-color-rgb' }]

Keywords

postcss

FAQs

Package last updated on 04 Sep 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts