-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add preserve
option
#3
Conversation
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). I’ve refactored the code a little bit to make it easier to use the `preserve` in the main function (& also use rework-visit which is more bullet proof) like rework-vars. 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 also add some error reporting like we have in rework-vars. Btw, maybe we can expand the use of balanced-match to rewrite other parts of the plugin. I hope it’s ok. FWI, I did this since I’m more seeing rework-vars & rework-calc as fallback than replacement. See reworkcss/rework-vars#28 reworkcss/rework-vars#29 & segmentio/myth#64
Who maintain this repo ? It seems I'm the only one watching it. I can take care of it but not sure to be able to publish something... poke @joakimbeng @reworkcss/owners |
take control! |
@jonathanong I'll need access to npm (be added as a user at least) right (my npm login is |
hmmm i don't have publishing rights either. added you to all the repos i ahve access to |
Thanks @jonathanong. It seems you are listed here https://www.npmjs.org/package/rework-calc |
god damn that's not the account i use. fuck you npm! |
There's not really any benefit to preserving |
The idea is to keep custom properties in the dev tools. It's just the same thing as for rework-vars (see screenshot in the PR desc) |
Surely they will be there if you've set rework-vars to |
There are some good consistency changes in this PR though :) |
I just copy your work @necolas. I'm not the smart guy here. |
Sorry for the late response, been traveling.. |
yeah. seeing if i can just delete it or transfer or it or something. switching users on npm is a pain in the ass. |
Just a PR following my stupid #3 I’ve refactored the code a little bit (& also use rework-visit which is more bullet proof) like rework-vars. I quickly refactor tests to make it more understandable. I add some error reporting like we have in rework-vars. Btw, maybe we can expand the use of balanced-match to rewrite other parts of the plugin.
Just a PR following my stupid #3 I’ve refactored the code a little bit (& also use rework-visit which is more bullet proof) like rework-vars. I quickly refactor tests to make it more understandable. I add some error reporting like we have in rework-vars. Btw, maybe we can expand the use of balanced-match to rewrite other parts of the plugin.
Can someone add me as a owner on rework-calc so I can ship 1.0.0 ? I think it's time to (checkout latest commits) :) |
@MoOx there you go :) |
Great, thanks. v1.0.0 has been published ! |
Setting
preserve
totrue
will preservecalc()
in the output, sothat 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.
I’ve refactored the code a little bit to make it easier to use the
preserve
in the main function (& also use rework-visit whichis more bullet proof) like rework-vars.
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 also add some error reporting like we have in rework-vars. Btw, maybe we can
expand the use of balanced-match to rewrite other parts of the plugin.
I hope it’s ok.
FWI, I did this since I’m more seeing rework-vars & rework-calc as
fallback than replacement.
See reworkcss/rework-vars#28
reworkcss/rework-vars#29 &
segmentio/myth#64