{"_id":"@csstools/postcss-mixins@1.2.0","bugs":{"url":"https://github.com/csstools/postcss-plugins/issues"},"dist":{"shasum":"8e3ff4f3e2ab6529992f4ccff203ad0eba8712b6","tarball":"http://registry-npm.ywwl.com/@csstools/postcss-mixins/download/@csstools/postcss-mixins-1.2.0.tgz","fileCount":6,"integrity":"sha512-iRydljzNNJwIWlRNkF1fp+TPMQL0TXSxUyQiv+YeL4fNN+oSYDnutpCyb4n/y4NIS5xh5oGAwjkONulkvZZTKQ==","signatures":[{"sig":"MEUCIQDDxWpHSquuRF9jU91kT6+MMggtiM/YkAd+OUs9MybhfAIgVjtysB6LI98aleZ9hyq5cbH1B7VqaNd9XUHtbE2uIW0=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQD75RpMltnFZgcJzbB6BW5XWsVrXqcVYLJ0tClB7cNWJgIgeWG5fUvkS4FzQ4nHofhnQMPM4oKZ3rXmTodXKvBaahY="}],"unpackedSize":20266,"size":6922,"noattachment":false,"key":"/@csstools/postcss-mixins/-/@csstools/postcss-mixins-1.2.0.tgz"},"name":"@csstools/postcss-mixins","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":"df1367c20d68d7514df125d2ee8227ad774710fa","license":"MIT-0","scripts":{},"version":"1.2.0","_npmUser":{"name":"romainmenke","email":"romainmenke@gmail.com"},"homepage":"https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-mixins#readme","keywords":["css","mixin","postcss","postcss-plugin"],"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":{},"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-tokenizer":"^4.0.3","@csstools/generate-idents":"^1.0.0","@csstools/css-parser-algorithms":"^4.0.3","@csstools/custom-function-parser":"^2.0.0","@csstools/utilities-for-private-properties":"^1.0.1"},"_hasShrinkwrap":false,"peerDependencies":{"postcss":"^8.4"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/postcss-mixins_1.2.0_1794920053322_0.3815679791518434"},"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- conditional `@mixin` declarations\n- mixin overrides\n\nRun `@csstools/postcss-private-rule` after this plugin to transpile `@private` rules in style rules that do not apply a mixin.\n\nA mixin with an unsupported definition is left unchanged: the definition and every `@apply` of that name stay as they are.\nRules that apply such a mixin are left unchanged as well, so native support keeps working for them.\nThe same happens when private properties in a rule can not be transpiled completely, for example when a private property registration is inside an anonymous cascade layer.\n\nPrivate properties in the applying rule and in `@contents` blocks are transpiled together with the mixin.\n\nAn `@apply` with a CSS-wide keyword (`inherit`, `initial`, `unset`, `revert`, `revert-layer`) as an argument is left unchanged:\nbrowsers substitute these keywords into the property that uses the parameter, while the specification resolves them in the argument phase.\nCSS-wide keywords in parameter defaults are resolved in the argument phase.\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-mix-1gice1e-arg-0: 200;\n\t--_csstools-m-1gice1e-0--baz: var(--_csstools-mix-1gice1e-arg-0);\n\tcolor: rgb(var(--_csstools-m-1gice1e-0--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-mix-1gice1e-arg-0: 200;\n\t--_csstools-m-1gice1e-0--baz: var(--_csstools-mix-1gice1e-arg-0);\n\tcolor: rgb(var(--_csstools-m-1gice1e-0--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":1794920053413,"_cnpm_publish_time":1794920053413,"dist-tags":{"latest":"1.2.0"}}