bredon-plugin-initial

1.0.0 • Public • Published

bredon-plugin-initial

npm version npm downloads

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.

Package Sidebar

Install

npm i bredon-plugin-initial

Weekly Downloads

1

Version

1.0.0

License

MIT

Last publish

Collaborators

  • rofrischmann