{"name":"@csstools/utilities-for-private-properties","version":"1.0.0","keywords":["css","custom-property","postcss","private"],"license":"MIT-0","_id":"@csstools/utilities-for-private-properties@1.0.0","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/packages/utilities-for-private-properties#readme","bugs":{"url":"https://github.com/csstools/postcss-plugins/issues"},"dist":{"shasum":"14368b04d9ff259d43cd3bdffe82ac304344c74e","tarball":"http://registry-npm.ywwl.com/@csstools/utilities-for-private-properties/download/@csstools/utilities-for-private-properties-1.0.0.tgz","fileCount":6,"integrity":"sha512-uacTn0CW3t5DGGsX3wYbN7uD+Cx/Ab/xHi1WF8hBm6R+UeP8t5C+ivMmMk22roymoxq9tCBCa3emqxcqN2qP2g==","signatures":[{"sig":"MEUCIET3eojd5Ut2fr3jAesgwnCJyPBnx98YAytSqo0VYJHVAiEA4Qy071csfYY8oUGwfi4vMnqI+8Ttdu2KD/8D6bx7E+0=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"sig":"MEUCIAFheRgZ/4JbSMWfGGN0ur0AsfkG5hx0Zj1O/NTSJExwAiEA4MksLwwKKisTUuzEp3f0ZwFOKJXzIJWShiqYwX5fHFg=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":16725,"size":5861,"noattachment":false,"key":"/@csstools/utilities-for-private-properties/-/@csstools/utilities-for-private-properties-1.0.0.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":"ef429b42ff9fe3efd48a17d40d8377488a8930a2","scripts":{},"_npmUser":{"name":"romainmenke","email":"romainmenke@gmail.com"},"repository":{"url":"git+https://github.com/csstools/postcss-plugins.git","type":"git","directory":"packages/utilities-for-private-properties"},"_npmVersion":"11.13.0","description":"Utilities for private custom properties","directories":{},"_nodeVersion":"26.1.0","dependencies":{"@csstools/generate-idents":"^1.0.0","@csstools/utilities-for-property-registrations":"^0.0.0"},"_hasShrinkwrap":false,"peerDependencies":{"postcss":"^8.4","@csstools/css-tokenizer":"^4.0.3","@csstools/css-parser-algorithms":"^4.0.3"},"_npmOperationalInternal":{"tmp":"tmp/utilities-for-private-properties_1.0.0_1794918270582_0.14657041820898853","host":"s3://npm-registry-packages-npm-production"},"readme":"# Utilities for Private Properties <img src=\"https://postcss.github.io/postcss/logo.svg\" alt=\"for PostCSS\" width=\"90\" height=\"90\" align=\"right\">\n\n[<img alt=\"npm version\" src=\"https://img.shields.io/npm/v/@csstools/utilities-for-private-properties.svg\" height=\"20\">][npm-url]\n[<img alt=\"Build Status\" src=\"https://github.com/csstools/postcss-plugins/actions/workflows/test.yml/badge.svg?branch=main\" height=\"20\">][cli-url]\n[<img alt=\"Discord\" src=\"https://shields.io/badge/Discord-5865F2?logo=discord&logoColor=white\">][discord]\n\nTranspile `@private` rules and private custom property references.\n\n## API\n\n[Read the API docs](./docs/utilities-for-private-properties.md)\n\n## Usage\n\nAdd [Utilities for Private Properties] to your project:\n\n```bash\nnpm install @csstools/utilities-for-private-properties @csstools/css-parser-algorithms @csstools/css-tokenizer postcss --save-dev\n```\n\n```ts\nimport { createPrivatePropertyTranspiler } from '@csstools/utilities-for-private-properties';\n\nconst transpiler = createPrivatePropertyTranspiler({ namespace: 'p' });\n\nconst registrations = transpiler.transpile(root.nodes);\nroot.append(...registrations);\n```\n\nNodes that are substituted into a style rule but are not its children, for example the contents of\nan `@contents` block, can be transpiled in the scope of that style rule:\n\n```ts\ntranspiler.transpile(nodes, { scope: styleRule });\n```\n\nWith `preserve: true` the `@private` rules are kept and references inside `@apply` and `@contents`\nblocks are left alone. Transpiled declarations are still hoisted, so the original notation keeps\nworking where `@private` is supported.\n\n`@property` rules are hoisted out of `@layer`, `@media` and `@supports` group rules, and the\n`@layer`, `@media` and `@supports` conditions are kept. `@container`, `@scope` and\n`@starting-style` do not constrain name-defining at-rules, so registrations inside them are hoisted\nwithout those conditions.\n\n[cli-url]: https://github.com/csstools/postcss-plugins/actions/workflows/test.yml?query=workflow/test\n[discord]: https://discord.gg/bUadyRwkJS\n[npm-url]: https://www.npmjs.com/package/@csstools/utilities-for-private-properties\n\n[Utilities for Private Properties]: https://github.com/csstools/postcss-plugins/tree/main/packages/utilities-for-private-properties\n","publish_time":1794918270690,"_cnpm_publish_time":1794918270690,"dist-tags":{"latest":"1.0.1"}}