Work-in-progress!
PostCSS plugin for making calculations with math.js.
This plug-in supports:
- Plain-old maths, as per math.js built-in functionality
px
units- CSS-friendly rendering (
10cm
not10 cm
) - Unit stripping e.g.
strip(25px)
becomes25
Contributions are very welcome!
Usage
See PostCSS docs for examples for your environment.
postcss-calc
?
How does this differ to They're (deliberately) trying to work towards the calc(...) standard, so for instance it doesn't support things like exponentials at the moment. This wraps up math.js so you have a wider range of things you can do.