{"name":"@csstools/postcss-stepped-value-functions","version":"4.0.6","keywords":["css","modulus","postcss-plugin","remainder","round","stepped"],"license":"MIT-0","_id":"@csstools/postcss-stepped-value-functions@4.0.6","contributors":[{"url":"https://antonio.laguna.es","name":"Antonio Laguna","email":"antonio@laguna.es"},{"name":"Romain Menke","email":"romainmenke@gmail.com"}],"homepage":"https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-stepped-value-functions#readme","bugs":{"url":"https://github.com/csstools/postcss-plugins/issues"},"dist":{"shasum":"ee88c6122daf58a1b8641f462e8e33427c60b1f1","tarball":"http://registry-npm.ywwl.com/@csstools/postcss-stepped-value-functions/download/@csstools/postcss-stepped-value-functions-4.0.6.tgz","fileCount":7,"integrity":"sha512-/dwlO9w8vfKgiADxpxUbZOWlL5zKoRIsCymYoh1IPuBsXODKanKnfuZRr32DEqT0//3Av1VjfNZU9yhxtEfIeA==","signatures":[{"sig":"MEUCIE8gE5+4vPqDsLLzz1Q/yONTHl9+jWIi2KKsh+MtkjMXAiEAh4drlppzl1h7bZGBR0Ewa6uqwuj+TymN3cU0NYs1l1o=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":6975,"size":2912,"noattachment":false,"key":"/@csstools/postcss-stepped-value-functions/-/@csstools/postcss-stepped-value-functions-4.0.6.tgz"},"main":"dist/index.cjs","type":"module","types":"./dist/index.d.ts","module":"dist/index.mjs","engines":{"node":">=18"},"exports":{".":{"import":{"types":"./dist/index.d.ts","default":"./dist/index.mjs"},"require":{"default":"./dist/index.cjs"}}},"funding":[{"url":"https://github.com/sponsors/csstools","type":"github"},{"url":"https://opencollective.com/csstools","type":"opencollective"}],"gitHead":"a5b4a9c502478eac0f23e82f55fbf4fd0ba6e47c","scripts":{},"_npmUser":{"name":"romainmenke","email":"romainmenke@gmail.com"},"repository":{"url":"git+https://github.com/csstools/postcss-plugins.git","type":"git","directory":"plugins/postcss-stepped-value-functions"},"_npmVersion":"10.9.0","description":"Use round, rem and mod functions in CSS","directories":{},"_nodeVersion":"22.12.0","dependencies":{"@csstools/css-calc":"^2.1.1","@csstools/css-tokenizer":"^3.0.3","@csstools/css-parser-algorithms":"^3.0.4"},"_hasShrinkwrap":false,"peerDependencies":{"postcss":"^8.4"},"_npmOperationalInternal":{"tmp":"tmp/postcss-stepped-value-functions_4.0.6_1735321417846_0.7626496287310123","host":"s3://npm-registry-packages-npm-production"},"readme":"# PostCSS Stepped Value Functions [<img src=\"https://postcss.github.io/postcss/logo.svg\" alt=\"PostCSS Logo\" width=\"90\" height=\"90\" align=\"right\">][PostCSS]\n\n`npm install @csstools/postcss-stepped-value-functions --save-dev`\n\n[PostCSS Stepped Value Functions] lets you use `round`, `rem` and `mod` stepped value functions, following the [CSS Values 4] specification.\n\n```css\n.test-functions {\n\tpadding: 8px mod(18px, 5px) 1px calc(rem(15px, 6px) + 50%);\n\ttransform: rotate(mod(-140deg, -90deg));\n\ttop: round(15px, 4px);\n\tright: round(nearest, 15px, 4px);\n\tbottom: round(up, 15px, 7px);\n\tleft: round(down, 15px, 4px);\n\twidth: round(to-zero, 15px, 4px);\n}\n\n/* becomes */\n\n.test-functions {\n\tpadding: 8px 3px 1px calc(3px + 50%);\n\ttransform: rotate(-50deg);\n\ttop: 16px;\n\tright: 16px;\n\tbottom: 21px;\n\tleft: 12px;\n\twidth: 12px;\n}\n```\n\n## Usage\n\nAdd [PostCSS Stepped Value Functions] to your project:\n\n```bash\nnpm install postcss @csstools/postcss-stepped-value-functions --save-dev\n```\n\nUse it as a [PostCSS] plugin:\n\n```js\nconst postcss = require('postcss');\nconst postcssSteppedValueFunctions = require('@csstools/postcss-stepped-value-functions');\n\npostcss([\n\tpostcssSteppedValueFunctions(/* pluginOptions */)\n]).process(YOUR_CSS /*, processOptions */);\n```\n\n\n\n## ⚠️ About custom properties\n\nGiven the dynamic nature of custom properties it's impossible to know what the variable value is, which means the plugin can't compute a final value for the stylesheet. \n\nBecause of that, any usage that contains a `var` is skipped.\n\n## Options\n\n### preserve\n\nThe `preserve` option determines whether the original notation\nis preserved. By default, it is not preserved.\n\n```js\npostcssSteppedValueFunctions({ preserve: true })\n```\n\n```css\n.test-functions {\n\tpadding: 8px mod(18px, 5px) 1px calc(rem(15px, 6px) + 50%);\n\ttransform: rotate(mod(-140deg, -90deg));\n\ttop: round(15px, 4px);\n\tright: round(nearest, 15px, 4px);\n\tbottom: round(up, 15px, 7px);\n\tleft: round(down, 15px, 4px);\n\twidth: round(to-zero, 15px, 4px);\n}\n\n/* becomes */\n\n.test-functions {\n\tpadding: 8px 3px 1px calc(3px + 50%);\n\tpadding: 8px mod(18px, 5px) 1px calc(rem(15px, 6px) + 50%);\n\ttransform: rotate(-50deg);\n\ttransform: rotate(mod(-140deg, -90deg));\n\ttop: 16px;\n\ttop: round(15px, 4px);\n\tright: 16px;\n\tright: round(nearest, 15px, 4px);\n\tbottom: 21px;\n\tbottom: round(up, 15px, 7px);\n\tleft: 12px;\n\tleft: round(down, 15px, 4px);\n\twidth: 12px;\n\twidth: round(to-zero, 15px, 4px);\n}\n```\n\n[cli-url]: https://github.com/csstools/postcss-plugins/actions/workflows/test.yml?query=workflow/test\n[css-url]: https://cssdb.org/#stepped-value-functions\n[discord]: https://discord.gg/bUadyRwkJS\n[npm-url]: https://www.npmjs.com/package/@csstools/postcss-stepped-value-functions\n\n[PostCSS]: https://github.com/postcss/postcss\n[PostCSS Stepped Value Functions]: https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-stepped-value-functions\n[CSS Values 4]: https://www.w3.org/TR/css-values-4/#round-func\n","publish_time":1735321418054,"maintainers":[{"name":"jonathantneal","email":"jonathantneal@hotmail.com"},{"name":"alaguna","email":"sombragriselros@gmail.com"},{"name":"romainmenke","email":"romainmenke@gmail.com"}],"_cnpm_publish_time":1735321418054,"dist-tags":{"latest":"5.0.10"}}