{"_id":"@csstools/postcss-trigonometric-functions@5.0.8","bugs":{"url":"https://github.com/csstools/postcss-plugins/issues"},"dist":{"shasum":"efd5bde261e9909de1f2e617e0d4f66550706c88","tarball":"http://registry-npm.ywwl.com/@csstools/postcss-trigonometric-functions/download/@csstools/postcss-trigonometric-functions-5.0.8.tgz","fileCount":6,"integrity":"sha512-LaY+77wKWw0ucY1bNKCApd+2Xl5e2f+1fp2rumu8GwtSKSBTITyQi8Tau/ePjtM1X9h6LO1lTFAkkvlsQU7C6g==","signatures":[{"sig":"MEYCIQDRlbeXcjQPQZDT26N1F+dmgRa2U0i0B1ow3Z4xzhB9WAIhAOr+87R6dQFNjxq0uMN3Ukc7o0M6HDW45Styg+b42SGh","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQDa8jPDjGE3OuMFc6hcjYUw0AeMyS1szgGllTqEdN2qawIgeEXvtagS50n0e7fNCyYLK7+/9kJDTjNKGEiMmikqWXQ="}],"unpackedSize":9106,"size":3343,"noattachment":false,"key":"/@csstools/postcss-trigonometric-functions/-/@csstools/postcss-trigonometric-functions-5.0.8.tgz"},"name":"@csstools/postcss-trigonometric-functions","type":"module","engines":{"node":">=20.19.0"},"exports":{".":{"types":"./dist/index.d.ts","default":"./dist/index.mjs"}},"funding":[{"url":"https://github.com/sponsors/csstools","type":"github"},{"url":"https://opencollective.com/csstools","type":"opencollective"}],"gitHead":"a4f91d49e564bdee1a14ea4a70919ec463c04ce1","license":"MIT-0","scripts":{},"version":"5.0.8","_npmUser":{"name":"romainmenke","email":"romainmenke@gmail.com"},"homepage":"https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-trigonometric-functions#readme","keywords":["acos","asin","atan","atan2","cos","css","function","postcss","postcss-plugin","sin","tan","trigonometric"],"repository":{"url":"git+https://github.com/csstools/postcss-plugins.git","type":"git","directory":"plugins/postcss-trigonometric-functions"},"_npmVersion":"11.13.0","description":"Use sin(), cos(), tan(), acos(), atan(), and atan2() to compute trigonometric relationships","directories":{},"maintainers":[{"name":"jonathantneal","email":"jonathantneal@hotmail.com"},{"name":"alaguna","email":"sombragriselros@gmail.com"},{"name":"romainmenke","email":"romainmenke@gmail.com"}],"_nodeVersion":"26.1.0","contributors":[{"url":"https://antonio.laguna.es","name":"Antonio Laguna","email":"antonio@laguna.es"},{"name":"Romain Menke","email":"romainmenke@gmail.com"}],"dependencies":{"@csstools/css-calc":"^3.4.2","@csstools/css-tokenizer":"^4.0.2","@csstools/css-parser-algorithms":"^4.0.2"},"_hasShrinkwrap":false,"peerDependencies":{"postcss":"^8.4"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/postcss-trigonometric-functions_5.0.8_1790835528520_0.9363689658964438"},"readme":"# PostCSS Trigonometric 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-trigonometric-functions --save-dev`\n\n[PostCSS Trigonometric Functions] lets you use `sin`, `cos`, `tan`, `asin`, `acos`, `atan` and `atan2` to be able to compute trigonometric relationships following the [CSS Values 4] specification.\n\n```css\n.trigonometry {\n\tline-height: sin(pi / 4);\n\tline-height: cos(.125turn);\n\tline-height: tan(50grad);\n\ttransform: rotate(asin(-1));\n\ttransform: rotate(asin(sin(30deg + 1.0471967rad)));\n\ttransform: rotate(acos(-1));\n\ttransform: rotate(acos(cos(0 / 2 + 1 - 1)));\n\ttransform: rotate(atan(infinity));\n\ttransform: rotate(atan(e - 2.7182818284590452354));\n\ttransform: rotate(atan2(-infinity,-infinity));\n\ttransform: rotate(atan2(-infinity,infinity));\n\ttransform: rotate(atan2(-infinity,infinity));\n\ttransform: rotate(atan2(90, 15));\n}\n\n/* becomes */\n\n.trigonometry {\n\tline-height: calc(0.70711);\n\tline-height: calc(0.70711);\n\tline-height: calc(1);\n\ttransform: rotate(calc(-90deg));\n\ttransform: rotate(calc(89.99995deg));\n\ttransform: rotate(calc(180deg));\n\ttransform: rotate(calc(0deg));\n\ttransform: rotate(calc(90deg));\n\ttransform: rotate(calc(0deg));\n\ttransform: rotate(calc(-135deg));\n\ttransform: rotate(calc(-45deg));\n\ttransform: rotate(calc(-45deg));\n\ttransform: rotate(calc(80.53768deg));\n}\n```\n\n## Usage\n\nAdd [PostCSS Trigonometric Functions] to your project:\n\n```bash\nnpm install postcss @csstools/postcss-trigonometric-functions --save-dev\n```\n\nUse it as a [PostCSS] plugin:\n\n```js\nconst postcss = require('postcss');\nconst postcssTrigonometricFunctions = require('@csstools/postcss-trigonometric-functions');\n\npostcss([\n\tpostcssTrigonometricFunctions(/* 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## Units\n\n[PostCSS Trigonometric Functions] lets you use different special units that are within the spec and computed at run time to be able to calculate the result of the trigonometric function.\n\nThe following units are supported:\n\n* `pi`: Computes to `Math.PI` which is `3.141592653589793`\n* `e`: Computes to `Math.E` which is `2.718281828459045`\n* `infinity`, `-infinity`: Compute to `Infinity` and `-Infinity` respectively. Note that the usage is case insensitive so `InFiNiTy` is a valid value.\n\nSome calculations (such as `sin(-infinity)`) might return `NaN` as per the spec. Given that `NaN` can't be replaced with a value that's useful to CSS it is left as is, as the result will be effectively ignored by the browser.\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\npostcssTrigonometricFunctions({ preserve: true })\n```\n\n```css\n.trigonometry {\n\tline-height: sin(pi / 4);\n\tline-height: cos(.125turn);\n\tline-height: tan(50grad);\n\ttransform: rotate(asin(-1));\n\ttransform: rotate(asin(sin(30deg + 1.0471967rad)));\n\ttransform: rotate(acos(-1));\n\ttransform: rotate(acos(cos(0 / 2 + 1 - 1)));\n\ttransform: rotate(atan(infinity));\n\ttransform: rotate(atan(e - 2.7182818284590452354));\n\ttransform: rotate(atan2(-infinity,-infinity));\n\ttransform: rotate(atan2(-infinity,infinity));\n\ttransform: rotate(atan2(-infinity,infinity));\n\ttransform: rotate(atan2(90, 15));\n}\n\n/* becomes */\n\n.trigonometry {\n\tline-height: calc(0.70711);\n\tline-height: sin(pi / 4);\n\tline-height: calc(0.70711);\n\tline-height: cos(.125turn);\n\tline-height: calc(1);\n\tline-height: tan(50grad);\n\ttransform: rotate(calc(-90deg));\n\ttransform: rotate(asin(-1));\n\ttransform: rotate(calc(89.99995deg));\n\ttransform: rotate(asin(sin(30deg + 1.0471967rad)));\n\ttransform: rotate(calc(180deg));\n\ttransform: rotate(acos(-1));\n\ttransform: rotate(calc(0deg));\n\ttransform: rotate(acos(cos(0 / 2 + 1 - 1)));\n\ttransform: rotate(calc(90deg));\n\ttransform: rotate(atan(infinity));\n\ttransform: rotate(calc(0deg));\n\ttransform: rotate(atan(e - 2.7182818284590452354));\n\ttransform: rotate(calc(-135deg));\n\ttransform: rotate(atan2(-infinity,-infinity));\n\ttransform: rotate(calc(-45deg));\n\ttransform: rotate(atan2(-infinity,infinity));\n\ttransform: rotate(calc(-45deg));\n\ttransform: rotate(atan2(-infinity,infinity));\n\ttransform: rotate(calc(80.53768deg));\n\ttransform: rotate(atan2(90, 15));\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/#trigonometric-functions\n[discord]: https://discord.gg/bUadyRwkJS\n[npm-url]: https://www.npmjs.com/package/@csstools/postcss-trigonometric-functions\n\n[PostCSS]: https://github.com/postcss/postcss\n[PostCSS Trigonometric Functions]: https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-trigonometric-functions\n[CSS Values 4]: https://www.w3.org/TR/css-values-4/#trig-funcs\n","publish_time":1790835528597,"_cnpm_publish_time":1790835528597,"dist-tags":{"latest":"5.0.10"}}