# easy-css-variables

> __CDN:__

Latest version **1.0.0** (published 2019-10-09) · MIT license · 0 weekly downloads

## Install

```sh
npm install easy-css-variables
pnpm add easy-css-variables
yarn add easy-css-variables
bun add easy-css-variables
```

## 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.0 |
| Published | 2019-10-09 |
| First published | 2019-10-09 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Olian04 |
| Maintainers | olian04 |

## Links

- npm: https://www.npmjs.com/package/easy-css-variables
- Repository: https://github.com/Olian04/easy-css-variables
- Homepage: https://github.com/Olian04/easy-css-variables#readme
- Issues: https://github.com/Olian04/easy-css-variables/issues
- npm.io page: https://npm.io/package/easy-css-variables

## Recent versions

- 1.0.0 (latest) — 2019-10-09

## README

# easy-css-variables

__CDN:__ <br>

```html
<script src="https://cdn.jsdelivr.net/gh/olian04/easy-css-variables/src/index.js"></script>
```

__Demo:__ <br>

https://jsfiddle.net/olian04/rxLfmgeq/41/

## Global

```js
const ecv = require('easy-css-variables');

ecv.backgroundColor = 'blue';
```

```css
.greet {
  background: var(--backgroundColor);
}
```

```html
<div class="greet">Hello!</div>
```


## Target element

```js
const ecv = require('easy-css-variables');

const seGreet = document.querySelector('.greet.se');

ecv('.greeter.en').backgroundColor = 'blue';
ecv(seGreet).backgroundColor = 'pink';
```

_Note: The selector passed to `ecv(selectorOrElement)` needs to only match a single element, or the first one will be selected._

```css
.greet {
  background: var(--backgroundColor);
}
```

```html
<div class="greet en">Hello!</div>
<div class="greet se">Hej!</div>
```

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