reworkcss/rework-calc — pull request #3 by MoOx (2014-05-26 06:17:16+00:00)
Title: Add `preserve` option

Setting `preserve` to `true` will preserve `calc()` in the output, so
that they can be used by supporting browsers.
Useful now that browsers are starting to implement vars (eg Firefox
31+) & it’s even better for debug to see real rules.

![](http://cl.ly/image/3W3O0E41173X/Screen%20Shot%202014-05-26%20at%2008.08.55.png)

I’ve refactored the code a little bit to make it easier to use the
`options.preserve` in the main function (& also use rework-visit which
is more bullet proof).

This should be a major update since now calc need to be called as a
function (like rework-vars for example) to be able to pass options. So
this should be tagged as 0.3 (or maybe it’s time to ship 1.0 :) ?)

I also quickly refactor tests to make it more understandable
(plugins.js near preserve.css was confusing imo).

I hope it’s ok.

FWI, I did this since I’m more seeing rework-vars & rework-calc as
fallback than replacement.
See https://github.com/reworkcss/rework-vars/issues/28
https://github.com/reworkcss/rework-vars/issues/29 &
https://github.com/segmentio/myth/issues/64