{"versions":{"1.0.0":{"name":"@weapp-tailwindcss/postcss-calc","version":"1.0.0","description":"PostCSS plugin to reduce calc()","keywords":["css","postcss","postcss-plugin","calculation","calc"],"homepage":"https://github.com/postcss/postcss-calc","repository":{"type":"git","url":"git+https://github.com/postcss/postcss-calc.git"},"main":"src/index.js","types":"types/index.d.ts","author":{"name":"Andy Jansson"},"license":"MIT","engines":{"node":"^18.12 || ^20.9 || >=22.0"},"devDependencies":{"@types/node":"^22.15.17","eslint":"^9.25.1","eslint-config-prettier":"^10.1.5","jison-gho":"0.6.1-216","postcss":"^8.5.3","prettier":"^3.5.3","typescript":"~5.8.3"},"dependencies":{"postcss-selector-parser":"^7.1.0","postcss-value-parser":"^4.2.0"},"peerDependencies":{"postcss":"^8.4.38"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org"},"scripts":{"build":"jison ./parser.jison -o src/parser.js","lint":"eslint . && tsc","test":"node --test","publish-packages":"pnpm publish --no-git-checks"},"_id":"@weapp-tailwindcss/postcss-calc@1.0.0","bugs":{"url":"https://github.com/postcss/postcss-calc/issues"},"_integrity":"sha512-dPqVfhVsj48ii0AGhkIDh9ox1KusYx4UBGe82TNxUJYc3uIJXziOZt2RWw0VeYB29+GmHOb5WwJX2dVLNoab6A==","_resolved":"/private/var/folders/nr/32wg8vz116s2xv58c3b_frx80000gn/T/163407604cf560178d6aa38c63e64b4d/weapp-tailwindcss-postcss-calc-1.0.0.tgz","_from":"file:weapp-tailwindcss-postcss-calc-1.0.0.tgz","_nodeVersion":"22.17.1","_npmVersion":"10.9.2","dist":{"integrity":"sha512-dPqVfhVsj48ii0AGhkIDh9ox1KusYx4UBGe82TNxUJYc3uIJXziOZt2RWw0VeYB29+GmHOb5WwJX2dVLNoab6A==","shasum":"8386ea653316580f7b35187601a415004968d144","tarball":"http://123.232.10.234:8212/nexus/content/groups/npm-public/@weapp-tailwindcss/postcss-calc/-/postcss-calc-1.0.0.tgz","fileCount":15,"unpackedSize":163612,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQC28kx/+TaW5rc2Ntusnzsv/57YrpMzD+zZGY/+9YIuiAIgGXH+DnuI5nW3548yTxv7TJPme2AbRP/7ZHOVfiF+wTI="}],"size":40537},"_npmUser":{"name":"anonymous","email":"1324318532@qq.com"},"directories":{},"maintainers":[{"name":"anonymous","email":"1324318532@qq.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/postcss-calc_1.0.0_1757604812734_0.9106002214569389"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2025-09-11T15:33:32.960Z","publish_time":1757604812960,"_source_registry_name":"default","contributors":[]}},"dist-tags":{"latest":"1.0.0"},"name":"@weapp-tailwindcss/postcss-calc","time":{"created":"2025-09-11T15:33:48.430Z","modified":"2025-09-11T15:33:49.019Z","1.0.0":"2025-09-11T15:33:32.960Z"},"readme":"# PostCSS Calc [<img src=\"https://postcss.github.io/postcss/logo.svg\" alt=\"PostCSS\" width=\"90\" height=\"90\" align=\"right\">][PostCSS]\n\n[![NPM Version][npm-img]][npm-url]\n[![Support Chat][git-img]][git-url]\n\nFork from [postcss-calc@10.1.1](https://github.com/postcss/postcss-calc)\n\n[PostCSS Calc] lets you reduce `calc()` references whenever it's possible.\nWhen multiple units are mixed together in the same expression, the `calc()`\nstatement is left as is, to fallback to the [W3C calc() implementation].\n\n## Installation\n\n```bash\nnpm install postcss-calc\n```\n\n## Usage\n\n```js\n// dependencies\nvar fs = require(\"fs\")\nvar postcss = require(\"postcss\")\nvar calc = require(\"postcss-calc\")\n\n// css to be processed\nvar css = fs.readFileSync(\"input.css\", \"utf8\")\n\n// process css\nvar output = postcss()\n  .use(calc())\n  .process(css)\n  .css\n```\n\nUsing this `input.css`:\n\n```css\nh1 {\n  font-size: calc(16px * 2);\n  height: calc(100px - 2em);\n  width: calc(2*var(--base-width));\n  margin-bottom: calc(16px * 1.5);\n}\n```\n\nyou will get:\n\n```css\nh1 {\n  font-size: 32px;\n  height: calc(100px - 2em);\n  width: calc(2*var(--base-width));\n  margin-bottom: 24px\n}\n```\nCheckout [tests] for more examples.\n\n### Options\n\n#### `precision` (default: `5`)\n\nAllow you to define the precision for decimal numbers.\n\n```js\nvar out = postcss()\n  .use(calc({precision: 10}))\n  .process(css)\n  .css\n```\n\n#### `preserve` (default: `false`)\n\nAllow you to preserve calc() usage in output so browsers will handle decimal\nprecision themselves.\n\n```js\nvar out = postcss()\n  .use(calc({preserve: true}))\n  .process(css)\n  .css\n```\n\n#### `warnWhenCannotResolve` (default: `false`)\n\nAdds warnings when calc() are not reduced to a single value.\n\n```js\nvar out = postcss()\n  .use(calc({warnWhenCannotResolve: true}))\n  .process(css)\n  .css\n```\n\n#### `mediaQueries` (default: `false`)\n\nAllows calc() usage as part of media query declarations.\n\n```js\nvar out = postcss()\n  .use(calc({mediaQueries: true}))\n  .process(css)\n  .css\n```\n\n#### `selectors` (default: `false`)\n\nAllows calc() usage as part of selectors.\n\n```js\nvar out = postcss()\n  .use(calc({selectors: true}))\n  .process(css)\n  .css\n```\n\nExample:\n\n```css\ndiv[data-size=\"calc(3*3)\"] {\n  width: 100px;\n}\n```\n\n---\n\n## Related PostCSS plugins\nTo replace the value of CSS custom properties at build time, try [PostCSS Custom Properties].\n\n## Contributing\n\nWork on a branch, install dev-dependencies, respect coding style & run tests\nbefore submitting a bug fix or a feature.\n\n```bash\ngit clone git@github.com:postcss/postcss-calc.git\ngit checkout -b patch-1\nnpm install\nnpm test\n```\n\n## [Changelog](CHANGELOG.md)\n\n## [License](LICENSE)\n\n[git-img]: https://img.shields.io/badge/support-chat-blue.svg\n[git-url]: https://gitter.im/postcss/postcss\n[npm-img]: https://img.shields.io/npm/v/postcss-calc.svg\n[npm-url]: https://www.npmjs.com/package/postcss-calc\n\n[PostCSS]: https://github.com/postcss\n[PostCSS Calc]: https://github.com/postcss/postcss-calc\n[PostCSS Custom Properties]: https://github.com/postcss/postcss-custom-properties\n[tests]: src/__tests__/index.js\n[W3C calc() implementation]: https://www.w3.org/TR/css3-values/#calc-notation","users":{}}