{"name":"postcss-apply","version":"0.11.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","files":["dist","CHANGELOG.md","index.js","README.md","UNLICENSE"],"engines":{"node":">=6.0.0"},"scripts":{"lint":"eslint src/ test/","typecheck":"flow check src/","typecheck:coverage":"flow-coverage-report -t text -t html -i 'src/**/*.js'","validate":"run-s lint typecheck","test":"jest","test:cover":"run-s 'test --coverage'","test:cover:browse":"run-s test:cover && opn coverage/lcov-report/index.html","test:ci":"run-s lint test:cover","develop":"babel-node develop/","clean":"rm -rf dist/","build:js":"babel src/ -d dist/","build":"run-s clean build:*","prepublishOnly":"run-s validate test:cover","prepare":"run-s build"},"jest":{"testEnvironment":"node","collectCoverageFrom":["src/*.js"]},"dependencies":{"babel-runtime":"^6.26.0","balanced-match":"^1.0.0","postcss":"^7.0.2"},"devDependencies":{"babel-cli":"^6.26.0","babel-eslint":"^8.2.6","babel-plugin-transform-class-properties":"^6.24.1","babel-plugin-transform-object-entries":"^1.0.0","babel-plugin-transform-object-rest-spread":"^6.26.0","babel-preset-env":"^1.7.0","babel-preset-flow":"^6.23.0","common-tags":"^1.8.0","eslint":"^5.3.0","eslint-config-airbnb-base":"^13.0.0","eslint-config-prettier":"^2.9.0","eslint-plugin-flowtype":"^2.50.0","eslint-plugin-import":"^2.13.0","eslint-plugin-jest":"^21.20.2","flow-bin":"^0.78.0","flow-coverage-report":"^0.5.0","jest-cli":"^23.5.0","npm-run-all":"^4.1.3","opn-cli":"^3.1.0","postcss-custom-properties":"^7.0.0","postcss-reporter":"^5.0.0"},"gitHead":"80493748b2a98bfcd85438ec2999977916e90b47","_id":"postcss-apply@0.11.0","_npmVersion":"6.3.0","_nodeVersion":"10.8.0","_npmUser":{"name":"pascalduez","email":"public@pascalduez.me"},"dist":{"integrity":"sha512-Y/uBl3p0H3jby+N3kvSNyuyLKZaCElCMMFWXSfEL9llEeCKupJ9Wit5Ms7TsAXFINexkWWwjiYfqPZ1nedi1Jw==","shasum":"4bef9b443e4bfeeec5b094c7008bfe25dca5f40d","tarball":"http://registry-npm.ywwl.com/postcss-apply/download/postcss-apply-0.11.0.tgz","fileCount":8,"unpackedSize":17287,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbbormCRA9TVsSAnZWagAA9AsP/0uOi8jO2H9PYuFLPBmE\nblki4DU8gtc99FFKrYBMSl+IpLhXoP8eHPguAMoVLkZhwKAMdRHOXD5y/Bmh\nxst2K6VKiUs/4v5q2bl2j96TfNNWdIqNRFrhs4NUFnrGF96iqPQ8/AxLrWk6\njWezMboxpL2Q/vfBchZJ1cDTxgEwe/b1sMsjeCWjpYxMlwmS5Tk76k43Y1Tv\nxwFVDFGx65wSxv/t4qPZfIDpd47aXVor06AkrWsq2Xav3xv11pE6Hfe+QjNi\n+1bkvxJGWsHyZm7eBMp4uAVCN6H76G7UnVS+JctCjNoLshaVUqNBnVNgaspL\n03dudyb1SidYFJ0JXTSWsJetXFByMnYkq+i6gfQrkPRzf5iyfuIEF4Ul3NEU\nLkni58zafsqSMuprCUoYR2+4SxvOZdQGZJBHz/XYrHcjy8rpyD63qLMS5lFz\nQpVdV7umrhY746olNEudzOqDicj1Wp7gRpehPDAcroVRzGrq7NjRFLsYOctz\nEpwF+9dmMP4H9ZF0yW//jke48q3GWxvq3j2fC9RyF3dJUCTcwfoeKoSOknq4\nTPZmm5i9QMWrJDLSaP7kqYr/+Eh1Dx6XW+vCj88erhSkpaGpjN2BU7lKiOA4\nXHo/eC7Fq99wboKpce//rcLa//ZCF1OXksbOSnhkWdxQvzBfNKGbavWh6qWT\nnND5\r\n=qz93\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIA5AcBTMx/Kz93Kh4DOVF3a78hV7pAliS/4+B7c651kAAiEA3ptMfQZIH1ciGQQLOO1iMgrNE3TlI3gAE1RKKiNqOZw="}],"size":6363,"noattachment":false,"key":"/postcss-apply/-/postcss-apply-0.11.0.tgz"},"maintainers":[{"name":"pascalduez","email":"public@pascalduez.me"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/postcss-apply_0.11.0_1533971174199_0.8462776375844139"},"_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":1533971174254,"_cnpm_publish_time":1533971174254,"dist-tags":{"latest":"0.12.0"}}