# postcss-custom-prop-fallbacks

> Provides fallbacks for custom properties set in :root.

Latest version **1.0.4** (published 2018-04-29) · ISC license · 0 weekly downloads

## Install

```sh
npm install postcss-custom-prop-fallbacks
pnpm add postcss-custom-prop-fallbacks
yarn add postcss-custom-prop-fallbacks
bun add postcss-custom-prop-fallbacks
```

## 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 | 2018-04-29 |
| First published | 2017-09-04 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 141.9 KB |
| Known vulnerabilities | 0 (+6 in 1 direct dependencies) |
| Install scripts | no |
| Author | John Watkins |
| Maintainers | johnwatkins0 |
| Keywords | postcss, custom-properties |

## Links

- npm: https://www.npmjs.com/package/postcss-custom-prop-fallbacks
- Repository: https://github.com/johnwatkins0/postcss-custom-prop-fallbacks
- Homepage: https://github.com/johnwatkins0/postcss-custom-prop-fallbacks#readme
- Issues: https://github.com/johnwatkins0/postcss-custom-prop-fallbacks/issues
- npm.io page: https://npm.io/package/postcss-custom-prop-fallbacks

## Dependencies (1)

- [postcss](https://npm.io/package/postcss.md) ^6.0.10

## Recent versions

- 1.0.4 (latest) — 2018-04-29
- 1.0.3 — 2017-12-29
- 1.0.2 — 2017-09-04
- 1.0.1 — 2017-09-04
- 1.0.0 — 2017-09-04

## README

# postcss-custom-prop-fallbacks

Provides fallbacks for custom properties set in :root. The plugin **does not** remove the original rule that uses the custom property, but rather places a fallback on the line above for browsers that don't recognize the feature. See the example below.

## Install

```
npm install --save-dev postcss-custom-prop-fallbacks
```

## Usage

### Postcss.config.js

```Javascript
const customPropFallbacks = require('postcss-custom-prop-fallbacks');

module.exports = {
  plugins: [customPropFallbacks],
};
```

The following input:

```CSS
:root {
  --gutter: 1.5rem;
  --brand-primary: #002878;
}

.some-element {
  background-color: var(--brand-primary);
  margin-right: calc(var(--gutter) * 1.3333);
}
```

Will produce the following:

```CSS
:root {
  --gutter: 1.5rem;
  --brand-primary: #002878;
}

.some-element {
  background-color: #002878;
  background-color: var(--brand-primary);
  margin-right: calc(1.5rem * 1.3333);
  margin-right: calc(var(--gutter) * 1.3333);
}
```

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