# postcss-for-css-vars

> PostCSS plugin that enables @for loop syntax in your CSS with css variables

Latest version **1.2.2** (published 2023-11-24) · MIT license · 0 weekly downloads

## Install

```sh
npm install postcss-for-css-vars
pnpm add postcss-for-css-vars
yarn add postcss-for-css-vars
bun add postcss-for-css-vars
```

## 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.2.2 |
| Published | 2023-11-24 |
| First published | 2023-07-07 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 4.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Ivan Kushchenko |
| Maintainers | ivan_kushchenko |
| Keywords | postcss, css, postcss-plugin, postcss-for-css-vars, for, loop, iterate, sass |

## Links

- npm: https://www.npmjs.com/package/postcss-for-css-vars
- Repository: https://github.com/IvanKushchenko/postcss-for-css-vars
- Homepage: https://github.com/IvanKushchenko/postcss-for-css-vars#readme
- Issues: https://github.com/IvanKushchenko/postcss-for-css-vars/issues
- npm.io page: https://npm.io/package/postcss-for-css-vars

## Alternatives

- [mobx-react](https://npm.io/package/mobx-react.md) — 2.8M weekly downloads
- [rc-tree](https://npm.io/package/rc-tree.md) — 2.6M weekly downloads
- [@react-oauth/google](https://npm.io/package/@react-oauth/google.md) — 1.3M weekly downloads
- [@wagmi/connectors](https://npm.io/package/@wagmi/connectors.md) — 877.0K weekly downloads
- [vee-validate](https://npm.io/package/vee-validate.md) — 836.4K weekly downloads

## Recent versions

- 1.2.2 (latest) — 2023-11-24
- 1.2.1 — 2023-11-23
- 1.2.0 — 2023-11-22
- 1.1.1 — 2023-08-03
- 1.1.0 — 2023-08-03
- 1.0.0 — 2023-07-07

## README

# PostCSS For Var Plugin

[PostCSS] plugin that enables `@for` loop syntax in your CSS with var.

## Usage

```js
postcss([ require('postcss-for-css-vars') ])
```

```css
@for --i from 1 to 3 {
    .col-var(--i) { width: var(--i)px; }
}
```

```css
.col-1 {
    width: 1px
}
.col-2 {
    width: 2px
}
.col-3 {
    width: 3px
}
```

This plugin must be set after [postcss-nested] and before [postcss-css-variables]/[postcss-custom-properties].

See PostCSS docs for examples for your environment.

[postcss-nested]: https://github.com/postcss/postcss-nested
[postcss-css-variables]: https://github.com/MadLittleMods/postcss-css-variables
[postcss-custom-properties]: https://github.com/postcss/postcss-custom-properties

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