{"name":"postcss-apply","version":"0.12.0","description":"PostCSS plugin enabling custom properties sets references","keywords":["css","apply","postcss","postcss-plugin"],"author":{"name":"Pascal Duez","url":"https://github.com/pascalduez"},"homepage":"https://github.com/pascalduez/postcss-apply","bugs":{"url":"https://github.com/pascalduez/postcss-apply/issues"},"repository":{"type":"git","url":"git://github.com/pascalduez/postcss-apply.git"},"license":"Unlicense","main":"dist/index.js","module":"dist/index.m.js","scripts":{"lint":"eslint src/ test/","validate":"run-s lint","test":"jest","test:ci":"run-s validate test","develop":"babel-node develop/","prebuild":"rm -rf dist/","build":"rollup -c","prepare":"run-s build","prepublishOnly":"run-s validate test"},"dependencies":{"balanced-match":"^1.0.0","postcss":"^7.0.14"},"devDependencies":{"@babel/cli":"^7.2.3","@babel/core":"^7.3.4","@babel/plugin-proposal-class-properties":"^7.3.4","@babel/plugin-proposal-do-expressions":"^7.2.0","@babel/preset-env":"^7.3.4","babel-eslint":"^10.0.1","common-tags":"^1.8.0","eslint":"^5.14.1","eslint-config-airbnb-base":"^13.1.0","eslint-config-prettier":"^4.1.0","eslint-plugin-import":"^2.16.0","eslint-plugin-jest":"^22.3.0","jest":"^24.1.0","npm-run-all":"^4.1.5","opn-cli":"^4.0.0","postcss-custom-properties":"^8.0.9","postcss-reporter":"^6.0.1","rollup":"^1.3.1","rollup-plugin-babel":"^4.3.2","rollup-plugin-commonjs":"^9.2.1","rollup-plugin-json":"^3.1.0","rollup-plugin-node-resolve":"^4.0.1"},"gitHead":"92acfadd09e03447013b19e5e5d35b3778f1ee72","_id":"postcss-apply@0.12.0","_nodeVersion":"10.12.0","_npmVersion":"6.7.0","dist":{"integrity":"sha512-u8qZLyA9P86cD08IhqjSVV8tf1eGiKQ4fPvjcG3Ic/eOU65EAkDQClp8We7d15TG+RIWRVPSy9v7cJ2D9OReqw==","shasum":"11a47b271b14d81db97ed7f51a6c409d025a9c34","tarball":"http://registry-npm.ywwl.com/postcss-apply/download/postcss-apply-0.12.0.tgz","fileCount":6,"unpackedSize":22878,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcdp36CRA9TVsSAnZWagAAPVIP/A7QJQy5OiG+v7jOf3xq\njM6W14jG1bNKOOYYoFz/Oy1uQfp+YuZxjvMcu/MpVJD0QQmw/q6KGEUTCnKN\nD9qKiPrsEXMzuihaGTk6VNiIGUNjUCaEu+9gKeQ/JDiCZqMlS/Q5NqCNf+nb\n9p7prUjnc3/Cp7nwsgZ1V8OkHsYYUA6z7BQn97jHJ97YbhlkM6PhLLd8Tb6I\nWb6BLGaxIif7zaKdBnLF8PRDyW9KLaoTZq3QIqp+2dPP4Q3jACLrIvMmApOz\nMb5QtqGxMESsUxzMfXDV3ERIHoc4hB7VbbfE87f93wAvTwKtENsnWM9zvwlA\nOylHE/oo7icb867JjpNFe+aJJwIO6WXepunZo6QD6iI9lsdrUjpbuQELoomv\nIO/mYcMBWipmwNVjIyKZ0qcHUTPwPKC8dmzqsr+rdntCcRQ3abBFvOb7bfSt\n6rWGayVE2oaPrXbrxA80erlAoQokljxuOYmnjpU7fC0KjoCkzwwODElAbnlQ\nH73LqZa2W0qgTCbBAmIfXaEQPdHuiyp9aCx/P7u/D24+QmvjNsllrfHIxVze\nndtdJ4ZRRPtQGF0HbJACK8jgwcptMmIGAF4WDpxxw0ACUFah2MgKViF9/M0k\noqLnZLBtrSa/XZjKvvf9vN73kqTN8RX1TQX9ryw4aPiY5CRtaPOeVlMs3EAU\nO8yh\r\n=QSoE\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDxuUWZeI2T+YnNWRtulLHpXO1bENXpOiujLRIkfmapTQIhAJGEyUZOy4hQxQoEHeVL3603Cq8wozZMJAkLGANn/WK+"}],"size":6216,"noattachment":false,"key":"/postcss-apply/-/postcss-apply-0.12.0.tgz"},"maintainers":[{"name":"pascalduez","email":"public@pascalduez.me"}],"_npmUser":{"name":"pascalduez","email":"public@pascalduez.me"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/postcss-apply_0.12.0_1551277561977_0.9916061146483774"},"_hasShrinkwrap":false,"readme":"# postcss-apply\n\n[![CSS Standard Status][css-image]][css-url]\n[![npm version][npm-image]][npm-url]\n[![Build Status][travis-image]][travis-url]\n[![Coverage Status][codecov-image]][codecov-url]\n\n\n> [PostCSS] plugin enabling custom property sets references\n\nRefer to [`postcss-custom-properties`](https://github.com/postcss/postcss-custom-properties#postcss-custom-properties-) for DOMless limitations.\n\n\n## Web Platform status\n\nSpec (editor's draft): https://tabatkins.github.io/specs/css-apply-rule  \nBrowser support: https://www.chromestatus.com/feature/5753701012602880  \n\n:warning: The `@apply` rule and custom property sets most likely won't get any more support from browser vendors as the spec is yet considered deprecated and [alternative solutions](https://tabatkins.github.io/specs/css-shadow-parts) are being discussed.  \nRefer to following links for more infos:\n  * https://discourse.wicg.io/t/needed-new-champion-for-css-apply-rule/2012\n  * https://github.com/w3c/webcomponents/issues/300#issuecomment-276210974  \n  * http://www.xanthir.com/b4o00\n  * https://github.com/w3c/csswg-drafts/issues/1047\n\n\n## Installation\n\n```\nnpm install postcss-apply --save-dev\n```\n\n\n## Usage\n\n```js\nconst fs = require('fs');\nconst postcss = require('postcss');\nconst apply = require('postcss-apply');\n\nconst input = fs.readFileSync('input.css', 'utf8');\n\npostcss()\n  .use(apply)\n  .process(input)\n  .then((result) => {\n    fs.writeFileSync('output.css', result.css);\n  });\n```\n\n## Examples\n\n### In CSS declared sets\n\n```css\n/* input */\n\n:root {\n  --toolbar-theme: {\n    background-color: rebeccapurple;\n    color: white;\n    border: 1px solid green;\n  };\n}\n\n.Toolbar {\n  @apply --toolbar-theme;\n}\n```\n\n```css\n/* output */\n\n.Toolbar {\n  background-color: rebeccapurple;\n  color: white;\n  border: 1px solid green;\n}\n```\n\n### In JS declared sets\n\n```js\nconst themes = {\n  /* Set names won't be transformed, just `--` will be prepended. */\n  'toolbar-theme': {\n    /* Declaration properties can either be camel or kebab case. */\n    backgroundColor: 'rebeccapurple',\n    color: 'white',\n    border: '1px solid green',\n  },\n};\n\n[...]\npostcss().use(apply({ sets: themes }))\n[...]\n```\n\n```css\n/* input */\n\n.Toolbar {\n  @apply --toolbar-theme;\n}\n```\n\n```css\n/* output */\n\n.Toolbar {\n  background-color: rebeccapurple;\n  color: white;\n  border: 1px solid green;\n}\n```\n\n## options\n\n### `preserve`\ntype: `Boolean`  \ndefault: `false`  \nAllows for keeping resolved declarations and `@apply` rules alongside.\n\n### `sets`  \ntype: `{ [customPropertyName: string]: Object | string }`  \ndefault: `{}`  \nAllows you to pass an object or string of custom property sets for `:root`.\nThese definitions will be prepended, in such overridden by the one declared in CSS if they share the same name.\nThe keys are automatically prefixed with the CSS `--` to make it easier to share sets in your codebase.\n\n\n## Credits\n\n* [Pascal Duez](https://github.com/pascalduez)\n\n\n## Licence\n\npostcss-apply is [unlicensed](http://unlicense.org/).\n\n\n\n[PostCSS]: https://github.com/postcss/postcss\n\n[css-url]: https://cssdb.org#rejected\n[css-image]: https://img.shields.io/badge/cssdb-rejected-red.svg?style=flat-square\n[npm-url]: https://www.npmjs.org/package/postcss-apply\n[npm-image]: http://img.shields.io/npm/v/postcss-apply.svg?style=flat-square\n[travis-url]: https://travis-ci.org/pascalduez/postcss-apply?branch=master\n[travis-image]: http://img.shields.io/travis/pascalduez/postcss-apply.svg?style=flat-square\n[codecov-url]: https://codecov.io/gh/pascalduez/postcss-apply\n[codecov-image]: https://img.shields.io/codecov/c/github/pascalduez/postcss-apply.svg?style=flat-square\n[depstat-url]: https://david-dm.org/pascalduez/postcss-apply\n[depstat-image]: https://david-dm.org/pascalduez/postcss-apply.svg?style=flat-square\n[license-image]: http://img.shields.io/npm/l/postcss-apply.svg?style=flat-square\n[license-url]: UNLICENSE\n[spec]: https://tabatkins.github.io/specs/css-apply-rule\n","publish_time":1551277562091,"_cnpm_publish_time":1551277562091,"dist-tags":{"latest":"0.12.0"}}