# postcss-plugin-cssvar-mod

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

Latest version **1.0.4** (published 2021-09-04) · ISC license · 0 weekly downloads

## Install

```sh
npm install postcss-plugin-cssvar-mod
pnpm add postcss-plugin-cssvar-mod
yarn add postcss-plugin-cssvar-mod
bun add postcss-plugin-cssvar-mod
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.4 |
| Published | 2021-09-04 |
| First published | 2021-08-19 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Node | ^10 \|\| ^12 \|\| >=14 |
| Dependencies | 3 |
| Unpacked size | 7.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | liuchang2024@gmail.com |
| Maintainers | soakit |
| Keywords | postcss, plugin, css, variable, rgba |

## Links

- npm: https://www.npmjs.com/package/postcss-plugin-cssvar-mod
- Repository: https://github.com/soakit/postcss-plugin-cssvar-mod
- Homepage: https://github.com/soakit/postcss-plugin-cssvar-mod#readme
- Issues: https://github.com/soakit/postcss-plugin-cssvar-mod/issues
- npm.io page: https://npm.io/package/postcss-plugin-cssvar-mod

## Dependencies (3)

- [postcss](https://npm.io/package/postcss.md) ^8.3.6
- [postcss-value-parser](https://npm.io/package/postcss-value-parser.md) ^4.1.0
- [postcss-message-helpers](https://npm.io/package/postcss-message-helpers.md) ^2.0.0

## Alternatives

- [style-dictionary](https://npm.io/package/style-dictionary.md) — 2.0M weekly downloads
- [postcss-merge-idents](https://npm.io/package/postcss-merge-idents.md) — 1.7M weekly downloads
- [@fontsource/noto-sans](https://npm.io/package/@fontsource/noto-sans.md) — 93.0K weekly downloads
- [uglifycss](https://npm.io/package/uglifycss.md) — 71.6K weekly downloads
- [mat4-interpolate](https://npm.io/package/mat4-interpolate.md) — 23.3K weekly downloads

## Recent versions

- 1.0.4 (latest) — 2021-09-04
- 1.0.3 — 2021-08-19
- 1.0.2 — 2021-08-19
- 1.0.1 — 2021-08-19
- 1.0.0 — 2021-08-19

## README

# postcss-plugin-cssvar-mod

简体中文 | [English](README.en.md)

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

## 使用

1. 安装

   ```shell
   npm i postcss-plugin-cssvar-mod
   ```

2. 调用

   ```js
   const postcss = require("postcss");
   const plugin = require("postcss-plugin-cssvar-mod");

   const options = {};
   postcss().use(plugin(options));
   ```

   调用前

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

   调用后

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

## 选项说明

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

---
_Source: https://npm.io/package/postcss-plugin-cssvar-mod · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
