PostCSS plugin that performs math operations on all numbers with a certain property.
$ npm install postcss-modify-numbers
postcss([
require('postcss-modify-numbers')({
property: "width",
operation: "multiply",
number: 1.3
})
])
/* Input example */
.foo {
width: 50px;
height: 30px;
}
.bar {
width: 100px;
height: 60px;
}
/* Output example */
.foo {
width: 65px; /* Multiplied by 1.3 */
height: 30px;
}
.bar {
width: 130px; /* Multiplied by 1.3 */
height: 60px;
}
What CSS property you would like to affect, currently only supports one.
What operation you would like to perform ('add','subtract','divide','multiple')
The number you would like modify the number by
The number of decimal places to round to (default is 3)
See PostCSS docs for examples for your environment.