{"_id":"rework-calc","_rev":"4539078","name":"rework-calc","description":"calc() support for Rework","dist-tags":{"latest":"1.1.0"},"maintainers":[{"name":"conradz","email":"me@conradz.com"},{"name":"joakimbeng","email":"joakim@klei.se"},{"name":"jonathanong","email":""},{"name":"jongleberry","email":"jonathanrichardong@gmail.com"},{"name":"lydell","email":""},{"name":"moox","email":""},{"name":"necolas","email":"nicolasgallagher@gmail.com"},{"name":"slexaxton","email":"alexsexton@gmail.com"}],"time":{"modified":"2026-04-09T15:07:23.000Z","created":"2013-12-13T08:55:49.726Z","1.1.0":"2014-07-06T05:11:02.357Z","1.0.0":"2014-06-25T05:16:50.697Z","0.2.2":"2014-05-03T17:18:29.820Z","0.2.1":"2013-12-13T08:55:49.726Z"},"users":{},"repository":{"type":"git","url":"https://github.com/reworkcss/rework-calc.git"},"versions":{"1.1.0":{"name":"rework-calc","version":"1.1.0","description":"calc() support for Rework","dependencies":{"balanced-match":"~0.1.0","rework-visit":"^1.0.0"},"devDependencies":{"mocha":"~1.15.1","rework":"^1.0.0","rework-vars":"^3.1.1"},"files":["index.js"],"scripts":{"test":"mocha --no-colors","watch":"mocha --slow 30 --reporter spec --watch"},"repository":{"type":"git","url":"https://github.com/reworkcss/rework-calc.git"},"license":"MIT","keywords":["css","rework","rework-plugins","calculation","calc"],"gitHead":"ebd8a9b41ce7e5a52be46a77f255f5a9fa9526ab","bugs":{"url":"https://github.com/reworkcss/rework-calc/issues"},"homepage":"https://github.com/reworkcss/rework-calc","_id":"rework-calc@1.1.0","_shasum":"39a148ff3fc7cc782062dbfd67ec47d1fe24718c","_from":".","_npmVersion":"1.5.0-alpha-1","_npmUser":{"name":"moox","email":"m@moox.io"},"maintainers":[{"name":"conradz","email":"me@conradz.com"},{"name":"joakimbeng","email":"joakim@klei.se"},{"name":"jonathanong","email":""},{"name":"jongleberry","email":"jonathanrichardong@gmail.com"},{"name":"lydell","email":""},{"name":"moox","email":""},{"name":"necolas","email":"nicolasgallagher@gmail.com"},{"name":"slexaxton","email":"alexsexton@gmail.com"}],"dist":{"shasum":"39a148ff3fc7cc782062dbfd67ec47d1fe24718c","size":2455,"noattachment":false,"key":"/rework-calc/-/rework-calc-1.1.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/rework-calc/download/rework-calc-1.1.0.tgz"},"directories":{},"publish_time":1404623462357,"_hasShrinkwrap":false,"_cnpm_publish_time":1404623462357,"_cnpmcore_publish_time":"2021-12-18T19:39:19.322Z"},"1.0.0":{"name":"rework-calc","version":"1.0.0","description":"calc() support for Rework","dependencies":{"balanced-match":"~0.1.0","rework-visit":"^1.0.0"},"devDependencies":{"mocha":"~1.15.1","rework":"^1.0.0"},"files":["index.js"],"scripts":{"test":"mocha --no-colors","watch":"mocha --slow 30 --reporter spec --watch"},"repository":{"type":"git","url":"https://github.com/reworkcss/rework-calc.git"},"license":"MIT","keywords":["css","rework","rework-plugins","calculation","calc"],"gitHead":"2f2c1beb9c83cfb314210d1d223b84d12bd097cf","bugs":{"url":"https://github.com/reworkcss/rework-calc/issues"},"homepage":"https://github.com/reworkcss/rework-calc","_id":"rework-calc@1.0.0","_shasum":"ac3ac30870f5d32e476e1ab746014f90073c8bb5","_from":".","_npmVersion":"1.4.16","_npmUser":{"name":"moox","email":"m@moox.io"},"maintainers":[{"name":"conradz","email":"me@conradz.com"},{"name":"joakimbeng","email":"joakim@klei.se"},{"name":"jonathanong","email":""},{"name":"jongleberry","email":"jonathanrichardong@gmail.com"},{"name":"lydell","email":""},{"name":"moox","email":""},{"name":"necolas","email":"nicolasgallagher@gmail.com"},{"name":"slexaxton","email":"alexsexton@gmail.com"}],"dist":{"shasum":"ac3ac30870f5d32e476e1ab746014f90073c8bb5","size":2678,"noattachment":false,"key":"/rework-calc/-/rework-calc-1.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/rework-calc/download/rework-calc-1.0.0.tgz"},"directories":{},"publish_time":1403673410697,"_hasShrinkwrap":false,"_cnpm_publish_time":1403673410697,"_cnpmcore_publish_time":"2021-12-18T19:39:19.525Z"},"0.2.2":{"name":"rework-calc","version":"0.2.2","description":"Adding calc() support to rework","main":"index.js","scripts":{"test":"./node_modules/.bin/mocha -R spec"},"repository":{"type":"git","url":"git://github.com/rework/rework-calc.git"},"keywords":["rework","rework-plugins","css","calc"],"author":{"name":"Joakim Bengtson","email":"joakim@klei.se"},"license":"MIT","devDependencies":{"mocha":"~1.15.1","rework":"~0.18.3","chai":"~1.8.1"},"bugs":{"url":"https://github.com/rework/rework-calc/issues"},"homepage":"https://github.com/rework/rework-calc","_id":"rework-calc@0.2.2","dist":{"shasum":"b2eb293c8c82b5db35c5aacec9fcd4c86c7c71fb","size":4191,"noattachment":false,"key":"/rework-calc/-/rework-calc-0.2.2.tgz","tarball":"http://registry.cnpm.dingdandao.com/rework-calc/download/rework-calc-0.2.2.tgz"},"_from":".","_npmVersion":"1.3.17","_npmUser":{"name":"joakimbeng","email":"joakim@klei.se"},"maintainers":[{"name":"conradz","email":"me@conradz.com"},{"name":"joakimbeng","email":"joakim@klei.se"},{"name":"jonathanong","email":""},{"name":"jongleberry","email":"jonathanrichardong@gmail.com"},{"name":"lydell","email":""},{"name":"moox","email":""},{"name":"necolas","email":"nicolasgallagher@gmail.com"},{"name":"slexaxton","email":"alexsexton@gmail.com"}],"directories":{},"publish_time":1399137509820,"_hasShrinkwrap":false,"_cnpm_publish_time":1399137509820,"_cnpmcore_publish_time":"2021-12-18T19:39:19.876Z"},"0.2.1":{"name":"rework-calc","version":"0.2.1","description":"Adding calc() support to rework","main":"index.js","scripts":{"test":"./node_modules/.bin/mocha -R spec"},"repository":{"type":"git","url":"git://github.com/klei-dev/rework-calc.git"},"keywords":["rework","rework-plugins","css","calc"],"author":{"name":"Joakim Bengtson","email":"joakim@klei.se"},"license":"MIT","devDependencies":{"mocha":"~1.15.1","rework":"~0.18.3","chai":"~1.8.1"},"readmeFilename":"README.md","bugs":{"url":"https://github.com/klei-dev/rework-calc/issues"},"_id":"rework-calc@0.2.1","dist":{"shasum":"8f24ecf495fc3093492ffa8e911406aad5a0dfbc","size":3637,"noattachment":false,"key":"/rework-calc/-/rework-calc-0.2.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/rework-calc/download/rework-calc-0.2.1.tgz"},"_from":".","_npmVersion":"1.3.11","_npmUser":{"name":"joakimbeng","email":"joakim@klei.se"},"maintainers":[{"name":"conradz","email":"me@conradz.com"},{"name":"joakimbeng","email":"joakim@klei.se"},{"name":"jonathanong","email":""},{"name":"jongleberry","email":"jonathanrichardong@gmail.com"},{"name":"lydell","email":""},{"name":"moox","email":""},{"name":"necolas","email":"nicolasgallagher@gmail.com"},{"name":"slexaxton","email":"alexsexton@gmail.com"}],"directories":{},"publish_time":1386924949726,"_hasShrinkwrap":false,"_cnpm_publish_time":1386924949726,"_cnpmcore_publish_time":"2021-12-18T19:39:20.066Z"}},"readme":"# rework-calc [![Build Status](https://travis-ci.org/reworkcss/rework-calc.png)](https://travis-ci.org/reworkcss/rework-calc)\n\nA [Rework](https://github.com/reworkcss/rework) plugin to support `calc()`.\nParticularly useful with the [rework-vars](https://github.com/reworkcss/rework-vars)\n\n## Installation\n\n```bash\nnpm install rework-calc\n```\n\n## Use\n\nAs a Rework plugin:\n\n```javascript\nvar rework = require('rework');\nvar calc = require('rework-calc');\n\nvar css = rework(cssString).use(calc).toString();\n```\n\n## Supported feature\n\nThis simply add `calc()` support, a feature to do simple calculations.  This\ncan be particularly useful with the [rework-vars](https://github.com/reworkcss/rework-vars) plugin.\n\n**Note:** When multiple units are mixed together in the same expression, the\n`calc()` statement is left as is, to fallback to the CSS3 calc feature.\n\n**Example** (with [rework-vars](https://github.com/reworkcss/rework-vars)\nenabled as well):\n\n```css\n:root {\n  --main-font-size: 16px;\n}\n\nbody {\n  font-size: var(--main-font-size);\n}\n\nh1 {\n  font-size: calc(var(--main-font-size) * 2);\n  height: calc(100px - 2em);\n}\n```\n\nyields:\n\n```css\nbody {\n  font-size: 16px\n}\n\nh1 {\n  font-size: 32px;\n  height: calc(100px - 2em)\n}\n```\n\nSee unit tests for another example.\n\n## Unit tests\n\nMake sure the dev-dependencies are installed, and then run:\n\n```bash\nnpm test\n```\n\n## License\n\nMIT\n","_attachments":{},"homepage":"https://github.com/reworkcss/rework-calc","bugs":{"url":"https://github.com/reworkcss/rework-calc/issues"},"license":"MIT"}