Bredon plugin to transform initial values
npm install bredon-plugin-initial
The initial plugin replaces, normalizes and minifies initial values.
In order to replace the initial keyword, the associated CSS property is required within context.
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
`$3
By default the plugin replaces all initial keywords.
Using the useShorter, it will the one that's shorter in length.
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
``