{"name":"@csstools/postcss-mixins","version":"1.0.1","keywords":["postcss-plugin"],"license":"MIT-0","_id":"@csstools/postcss-mixins@1.0.1","maintainers":[{"name":"jonathantneal","email":"jonathantneal@hotmail.com"},{"name":"alaguna","email":"sombragriselros@gmail.com"},{"name":"romainmenke","email":"romainmenke@gmail.com"}],"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-mixins#readme","bugs":{"url":"https://github.com/csstools/postcss-plugins/issues"},"dist":{"shasum":"71b45daa07675924ee42374e216325bb52a3aa44","tarball":"http://registry-npm.ywwl.com/@csstools/postcss-mixins/download/@csstools/postcss-mixins-1.0.1.tgz","fileCount":6,"integrity":"sha512-yoBuCmY8zQ8b7LPTlnNeNikfNF/67qSZCOgaColQvVKSVZRqrPtwSysvhav0qXvrm7E8itm31SWrSyd2khFl7Q==","signatures":[{"sig":"MEUCIDxl2mkHEHx3ptnMJ2+uXXEg0akhpmCslPUBY/D/+uuEAiEA3DTsdozGuEP8c4/HrZiUT4oZ5ePJUQNm/hCRM+jJSQE=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"sig":"MEUCIDOjH9wUAJSVtAv+ZO+o8nZR+1BNH0qKmYs559Zr79f+AiEAhFCO23O5kd+Qq20gYVuRa+bn6YMsVI3bF2VJFAc5UOA=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":6787,"size":2996,"noattachment":false,"key":"/@csstools/postcss-mixins/-/@csstools/postcss-mixins-1.0.1.tgz"},"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":"0a77596a53525327411ed5a717f280da696e605f","scripts":{},"_npmUser":{"name":"romainmenke","email":"romainmenke@gmail.com"},"repository":{"url":"git+https://github.com/csstools/postcss-plugins.git","type":"git","directory":"plugins/postcss-mixins"},"_npmVersion":"11.13.0","description":"Use mixins in CSS","directories":{},"_nodeVersion":"26.1.0","dependencies":{"@csstools/css-tokenizer":"^4.0.2","@csstools/css-parser-algorithms":"^4.0.1"},"_hasShrinkwrap":false,"peerDependencies":{"postcss":"^8.4"},"_npmOperationalInternal":{"tmp":"tmp/postcss-mixins_1.0.1_1790347181624_0.6431629941983463","host":"s3://npm-registry-packages-npm-production"},"readme":"# PostCSS Mixins [<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-mixins --save-dev`\n\n[PostCSS Mixins] lets you use `@mixin` and `@apply` following [CSS Mixins 1].\n\nSeveral specification aspects of CSS Mixins still need to be settled.  \nThis plugin is only a partial implementation to avoid conflicts with the final specification.\n\nUnsupported:\n- typed mixin arguments\n- layered `@mixin` declarations\n- mixin overrides\n\n```css\n@mixin --foo() {\n\tcolor: green;\n}\n\n.foo {\n\t@apply --foo;\n}\n\n@mixin --bar(--baz) {\n\tcolor: rgb(var(--baz) 127 0);\n}\n\n.bar {\n\t@apply --bar(200);\n}\n\n@mixin --a {\n\tfont-weight: 500;\n}\n\n@mixin --b {\n\t@apply --a;\n\tfont-size: 2rem;\n}\n\n.c {\n\t@apply --b;\n}\n\n/* becomes */\n\n.foo {\n\tcolor: green;\n}\n\n.bar {\n\t--_csstools-p-1agle9gi-0--arg-0: 200;\n\t--_csstools-p-1agle9gi-1--baz: var(--_csstools-p-1agle9gi-0--arg-0);\n\tcolor: rgb(var(--_csstools-p-1agle9gi-1--baz) 127 0);\n}\n\n.c {\n\tfont-weight: 500;\n\tfont-size: 2rem;\n}\n```\n\n## Usage\n\nAdd [PostCSS Mixins] to your project:\n\n```bash\nnpm install postcss @csstools/postcss-mixins --save-dev\n```\n\nUse it as a [PostCSS] plugin:\n\n```js\nconst postcss = require('postcss');\nconst postcssMixins = require('@csstools/postcss-mixins');\n\npostcss([\n\tpostcssMixins(/* pluginOptions */)\n]).process(YOUR_CSS /*, processOptions */);\n```\n\n\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\npostcssMixins({ preserve: true })\n```\n\n```css\n@mixin --foo() {\n\tcolor: green;\n}\n\n.foo {\n\t@apply --foo;\n}\n\n@mixin --bar(--baz) {\n\tcolor: rgb(var(--baz) 127 0);\n}\n\n.bar {\n\t@apply --bar(200);\n}\n\n@mixin --a {\n\tfont-weight: 500;\n}\n\n@mixin --b {\n\t@apply --a;\n\tfont-size: 2rem;\n}\n\n.c {\n\t@apply --b;\n}\n\n/* becomes */\n\n@mixin --foo() {\n\tcolor: green;\n}\n\n.foo {\n\tcolor: green;\n\t@apply --foo;\n}\n\n@mixin --bar(--baz) {\n\tcolor: rgb(var(--baz) 127 0);\n}\n\n.bar {\n\t--_csstools-p-1agle9gi-0--arg-0: 200;\n\t--_csstools-p-1agle9gi-1--baz: var(--_csstools-p-1agle9gi-0--arg-0);\n\tcolor: rgb(var(--_csstools-p-1agle9gi-1--baz) 127 0);\n\t@apply --bar(200);\n}\n\n@mixin --a {\n\tfont-weight: 500;\n}\n\n@mixin --b {\n\t@apply --a;\n\tfont-size: 2rem;\n}\n\n.c {\n\tfont-weight: 500;\n\tfont-size: 2rem;\n\t@apply --b;\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/#mixins\n[discord]: https://discord.gg/bUadyRwkJS\n[npm-url]: https://www.npmjs.com/package/@csstools/postcss-mixins\n\n[PostCSS]: https://github.com/postcss/postcss\n[PostCSS Mixins]: https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-mixins\n[CSS Mixins 1]: https://drafts.csswg.org/css-mixins/#mixin-rule\n","publish_time":1790347181713,"_cnpm_publish_time":1790347181713,"dist-tags":{"latest":"1.2.0"}}