The remove-unit plugin will remove unnecessary units from dimensions.
It works for all units, not only pixel or length units.
yarn add bredon-plugin-remove-unit
You may alternatively use npm i --save bredon-plugin-remove-unit
.
import { compile } from 'bredon'
import removeUnitPlugin from 'bredon-plugin-remove-unit'
const input = '15px 0px 5px 0px'
const output = compile(input, {
plugins: [
removeUnitPlugin()
]
})
console.log(output)
// => 15px 0 5px 0
Bredon is licensed under the MIT License.
Documentation is licensed under Creative Common License.
Created with ♥ by @rofrischmann and all the great contributors.