1.0.0 • Published 6 years ago
bredon-plugin-initial v1.0.0
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
.
Installation
yarn add bredon-plugin-initial
You may alternatively use npm i --save bredon-plugin-initial
.
Usage
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.
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
License
Bredon is licensed under the MIT License. Documentation is licensed under Creative Common License. Created with ♥ by @rofrischmann and all the great contributors.
1.0.0
6 years ago