Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/soakit/postcss-plugin-cssvar-mod
https://github.com/soakit/postcss-plugin-cssvar-mod
Last synced: 11 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/soakit/postcss-plugin-cssvar-mod
- Owner: soakit
- Created: 2021-08-18T01:52:55.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2021-09-04T05:44:36.000Z (over 3 years ago)
- Last Synced: 2024-03-23T15:02:36.438Z (10 months ago)
- Language: JavaScript
- Size: 25.4 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.en.md
Awesome Lists containing this project
README
# postcss-plugin-cssvar-mod
English | [简体中文](README.md)
Add a suffix to the value of the css variable in the rgb(a) function.
## Start
1. Install
```shell
npm i postcss-plugin-cssvar-mod
```2. Call
```js
const postcss = require("postcss");
const plugin = require("postcss-plugin-cssvar-mod");const options = {};
postcss().use(plugin(options));
```before
```css
.test1 {
color: rgb(var(--theme-color));
}
```after
```css
.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' }]` |