# bredon-plugin-initial

> Bredon plugin to transform initial values

Latest version **1.0.0** (published 2017-11-15) · MIT license · 0 weekly downloads

## Install

```sh
npm install bredon-plugin-initial
pnpm add bredon-plugin-initial
yarn add bredon-plugin-initial
bun add bredon-plugin-initial
```

## Health

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

Positive: esm support; no vulnerabilities.

Warnings: low downloads; no types.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.0 |
| Published | 2017-11-15 |
| First published | 2017-11-15 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 42 |
| Author | Robin Frischmann |
| Maintainers | rofrischmann |
| Keywords | css, parser, css-parser, css-value-parser, ast, lexer, tokenizer, cssinjs, bredon |

## Links

- npm: https://www.npmjs.com/package/bredon-plugin-initial
- Repository: https://github.com/rofrischmann/bredon
- Homepage: https://github.com/rofrischmann/bredon#readme
- Issues: https://github.com/rofrischmann/bredon/issues
- npm.io page: https://npm.io/package/bredon-plugin-initial

## Alternatives

- [babylon](https://npm.io/package/babylon.md) — 5.1M weekly downloads
- [csscolorparser](https://npm.io/package/csscolorparser.md) — 3.7M weekly downloads
- [expr-eval-fork](https://npm.io/package/expr-eval-fork.md) — 1.5M weekly downloads
- [@leeoniya/ufuzzy](https://npm.io/package/@leeoniya/ufuzzy.md) — 247.7K weekly downloads
- [xml-parser](https://npm.io/package/xml-parser.md) — 78.4K weekly downloads

## Recent versions

- 1.0.0 (latest) — 2017-11-15

## README

# bredon-plugin-initial

<img alt="npm version" src="https://badge.fury.io/js/bredon-plugin-initial.svg"> <img alt="npm downloads" src="https://img.shields.io/npm/dm/bredon-plugin-initial.svg">

The initial plugin replaces, normalizes and minifies initial values.
In order to replace the `initial` keyword, the associated CSS property is required within `context`.

## Installation
```sh
yarn add bredon-plugin-initial
```
You may alternatively use `npm i --save bredon-plugin-initial`.

## Usage

```javascript
import { compile } from 'bredon'
import initialPlugin from 'bredon-plugin-initial'

const input = 'initial'

const output = compile(input, {
  plugins: [ 
    initialPlugin()
  ],
  context: {
    property: 'paddingLeft'
  }
})

console.log(output)
// => 0
```

### Configuration
By default the plugin replaces all `initial` keywords.<br>
Using the `useShorter`, it will the one that's shorter in length.<br>
It may also replace values with the `initial` keyword if `useShorter` is used.

| Options | Value | Default | Description |
| ------- | ----- | ------- | ----------- |
| useShorter | *(boolean)* | `false` | If the shorter value should be used |

```javascript
import { compile } from 'bredon'
import colorPlugin from 'bredon-plugin-initial'

const input = 'initial'

const output = compile(input, {
  plugins: [ 
    initialPlugin({
      useShorter: true
    })
   ],
   context: {
     property: 'overflowClipBox'
   }
})

console.log(output)
// => initial
```

## License
Bredon is licensed under the [MIT License](http://opensource.org/licenses/MIT).<br>
Documentation is licensed under [Creative Common License](http://creativecommons.org/licenses/by/4.0/).<br>
Created with ♥ by [@rofrischmann](http://rofrischmann.de) and all the great contributors.

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