# postcss-simple-vars

> PostCSS plugin for Sass-like variables

Latest version **7.0.1** (published 2022-11-10) · MIT license · 0 weekly downloads

## Install

```sh
npm install postcss-simple-vars
pnpm add postcss-simple-vars
yarn add postcss-simple-vars
bun add postcss-simple-vars
```

## Health

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

Positive: has types; no vulnerabilities.

Warnings: low downloads; no esm support.

Negative: abandoned.

## Facts

| | |
|---|---|
| Version | 7.0.1 |
| Published | 2022-11-10 |
| First published | 2015-02-01 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Node | >=14.0 |
| Dependencies | 0 |
| Unpacked size | 10.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 428 |
| Author | Andrey Sitnik |
| Maintainers | ai |
| Keywords | postcss, css, postcss-plugin, sass, variables, vars |

## Links

- npm: https://www.npmjs.com/package/postcss-simple-vars
- Repository: https://github.com/postcss/postcss-simple-vars
- Homepage: https://github.com/postcss/postcss-simple-vars#readme
- Issues: https://github.com/postcss/postcss-simple-vars/issues
- Funding: https://opencollective.com/postcss/
- npm.io page: https://npm.io/package/postcss-simple-vars

## 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

- 7.0.1 (latest) — 2022-11-10
- 7.0.0 — 2022-09-03
- 6.0.3 — 2021-02-03
- 6.0.2 — 2020-12-10
- 6.0.1 — 2020-09-27
- 6.0.0 — 2020-09-15
- 5.0.2 — 2019-02-18
- 5.0.1 — 2018-09-07
- 5.0.0 — 2018-09-07
- 4.1.0 — 2017-08-19
- 4.0.0 — 2017-05-08
- 3.1.0 — 2017-03-24
- 3.0.0 — 2016-06-27
- 2.0.0 — 2016-05-17
- 1.2.0 — 2015-12-22
- … 10 more at https://npm.io/package/postcss-simple-vars/versions

## README

# PostCSS Simple Variables

<img align="right" width="135" height="95"
     title="Philosopher’s stone, logo of PostCSS"
     src="https://postcss.org/logo-leftp.svg">

[PostCSS] plugin for Sass-like variables.

You can use variables inside values, selectors and at-rule parameters.

```pcss
$dir:    top;
$blue:   #056ef0;
$column: 200px;

.menu_link {
  background: $blue;
  width: $column;
}
.menu {
  width: calc(4 * $column);
  margin-$(dir): 10px;
}
```

```css
.menu_link {
  background: #056ef0;
  width: 200px;
}
.menu {
  width: calc(4 * 200px);
  margin-top: 10px;
}
```

If you want be closer to W3C spec,
you should use [postcss-custom-properties] and [postcss-at-rules-variables] plugins.

Look at [postcss-map] for big complicated configs.

[postcss-at-rules-variables]: https://github.com/GitScrum/postcss-at-rules-variables
[postcss-custom-properties]:  https://github.com/postcss/postcss-custom-properties
[postcss-map]:                https://github.com/pascalduez/postcss-map
[PostCSS]:                    https://github.com/postcss/postcss

<a href="https://evilmartians.com/?utm_source=postcss-simple-vars">
  <img src="https://evilmartians.com/badges/sponsored-by-evil-martians.svg"
       alt="Sponsored by Evil Martians" width="236" height="54">
</a>


## Docs
Read **[full docs](https://github.com/postcss/postcss-simple-vars#readme)** on GitHub.

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