The initial plugin replaces, normalizes and minifies initial values.
In order to replace the initial
keyword, the associated CSS property is required within context
.
yarn add bredon-plugin-initial
You may alternatively use npm i --save bredon-plugin-initial
.
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
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 |
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
Bredon is licensed under the MIT License.
Documentation is licensed under Creative Common License.
Created with ♥ by @rofrischmann and all the great contributors.