# fela-plugin-fallback-value

> Fela plugin to resolve fallback values

Latest version **12.2.1** (published 2022-11-16) · MIT license · 0 weekly downloads

## Install

```sh
npm install fela-plugin-fallback-value
pnpm add fela-plugin-fallback-value
yarn add fela-plugin-fallback-value
bun add fela-plugin-fallback-value
```

## Health

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

Positive: has types; esm support; no vulnerabilities; high quality score.

Warnings: low downloads.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 12.2.1 |
| Published | 2022-11-16 |
| First published | 2016-05-22 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 2 |
| Unpacked size | 6.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 2281 |
| Author | Robin Weser |
| Maintainers | rofrischmann, txhawks |
| Keywords | fela, fela-plugin, fallback value, cssinjs |

## Links

- npm: https://www.npmjs.com/package/fela-plugin-fallback-value
- Repository: https://github.com/robinweser/fela
- Homepage: https://github.com/robinweser/fela#readme
- Issues: https://github.com/robinweser/fela/issues
- npm.io page: https://npm.io/package/fela-plugin-fallback-value

## Dependencies (2)

- [isobject](https://npm.io/package/isobject.md) ^4.0.0
- [css-in-js-utils](https://npm.io/package/css-in-js-utils.md) ^3.0.0

## Recent versions

- 12.2.1 (latest) — 2022-11-16
- 12.0.0-rc.3.0 (next) — 2022-02-22
- 12.2.0 — 2022-07-06
- 12.1.2 — 2022-05-04
- 12.1.1 — 2022-04-07
- 12.1.0 — 2022-04-06
- 12.0.2 — 2022-02-23
- 12.0.1 — 2022-02-23
- 12.0.0 — 2022-02-23
- 12.0.0-y.0 — 2022-02-22
- 12.0.0-rc.2 — 2022-02-21
- 12.0.0-rc.1 — 2022-02-18
- 12.0.0-rc.0 — 2022-02-16
- 11.7.0 — 2021-09-24
- 11.6.1 — 2021-03-25
- … 97 more at https://npm.io/package/fela-plugin-fallback-value/versions

## README

# fela-plugin-fallback-value

<img alt="npm version" src="https://badge.fury.io/js/fela-plugin-fallback-value.svg"> <img alt="npm downloads" src="https://img.shields.io/npm/dm/fela-plugin-fallback-value.svg"> <a href="https://bundlephobia.com/result?p=fela-plugin-fallback-value@latest"><img alt="Bundlephobia" src="https://img.shields.io/bundlephobia/minzip/fela-plugin-fallback-value.svg"></a>

Sometimes you want to provide alternative values also know as _fallback values_. <br>
For example in Internet Explorer 8 there is no `rgba` compatibility for colors which means just passing _e.g. `color: rgba(0, 0, 0, 0.5)`_ would not be applied correctly.
By passing an array of values you can provide fallback values.

## Installation

```sh
yarn add fela-plugin-fallback-value
```

You may alternatively use `npm i --save fela-plugin-fallback-value`.

## Usage

Make sure to read the documentation on [how to use plugins](https://fela.js.org/docs/latest/advanced/plugins#using-plugins).

```javascript
import { createRenderer } from 'fela'
import fallbackValue from 'fela-plugin-fallback-value'

const renderer = createRenderer({
  plugins: [fallbackValue()],
})
```

## Example

#### Input

```javascript
{
  color: ['#ccc', 'rgba(0, 0, 0, 0.5)']
}
```

#### Output

```javascript
{
  color: '#ccc;rgba(0, 0, 0, 0.5);'
}
```

which is similar to the following CSS code:

```CSS
{
	color: #ccc;
	color: rgba(0, 0, 0, 0.5);
}
```

## License

Fela is licensed under the [MIT License](http://opensource.org/licenses/MIT).<br>
Documentation is licensed under [Creative Commons License](http://creativecommons.org/licenses/by/4.0/).<br>
Created with ♥ by [@robinweser](http://weser.io) and all the great contributors.

---
_Source: https://npm.io/package/fela-plugin-fallback-value · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
