bredon-plugin-calc

1.0.0 • Public • Published

bredon-plugin-calc

npm version npm downloads

The calc plugin will precalculate all calc() expression within CSS values as much as possible.

Note: It cannot resolve mixed units e.g. % and px.

Installation

yarn add bredon-plugin-calc

You may alternatively use npm i --save bredon-plugin-calc.

Usage

import { compile } from 'bredon'
import calcPlugin from 'bredon-plugin-calc'
 
const input = 'calc(100% - 2*30%) calc(100% - 50px)'
 
const output = compile(input, {
  plugins: [ 
    calcPlugin()
  ]
})
 
console.log(output)
// => 40% calc(100% - 50px)

License

Bredon is licensed under the MIT License.
Documentation is licensed under Creative Common License.
Created with ♥ by @rofrischmann and all the great contributors.

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 1.0.0
    1
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 1.0.0
    1

Package Sidebar

Install

npm i bredon-plugin-calc

Weekly Downloads

1

Version

1.0.0

License

MIT

Last publish

Collaborators

  • rofrischmann