1.0.0 • Published 6 years ago

bredon-plugin-calc v1.0.0

Weekly downloads
2
License
MIT
Repository
github
Last release
6 years ago

bredon-plugin-calc

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.