{"_id":"postcss-simple-extend","_rev":"322320","name":"postcss-simple-extend","description":"Simple extends for PostCSS","dist-tags":{"latest":"1.0.0"},"maintainers":[{"name":"davidtheclark","email":"david.dave.clark@gmail.com"}],"time":{"modified":"2021-06-04T01:28:32.000Z","created":"2015-01-24T15:09:29.566Z","1.0.0":"2015-08-27T00:27:30.820Z","0.3.2":"2015-07-11T19:57:16.443Z","0.3.1":"2015-04-12T22:55:23.974Z","0.3.0":"2015-04-08T02:14:33.798Z","0.2.0":"2015-03-15T00:53:18.130Z","0.1.1":"2015-01-27T00:45:55.882Z","0.1.0":"2015-01-24T15:09:29.566Z"},"users":{},"author":{"name":"David Clark","email":"david.dave.clark@gmail.com","url":"http://davidtheclark.com"},"repository":{"type":"git","url":"git+https://github.com/davidtheclark/postcss-simple-extend.git"},"versions":{"1.0.0":{"name":"postcss-simple-extend","author":{"name":"David Clark","email":"david.dave.clark@gmail.com","url":"http://davidtheclark.com"},"license":"MIT","version":"1.0.0","description":"Simple extends for PostCSS","homepage":"https://github.com/davidtheclark/postcss-simple-extend","repository":{"type":"git","url":"git+https://github.com/davidtheclark/postcss-simple-extend.git"},"keywords":["css","postcss","postcss-plugin","mixin","clone","extend"],"files":["index.js","LICENSE","README.md","CHANGELOG.md"],"main":"index.js","scripts":{"lint":"eslint index.js test/index.js","test":"npm run lint && tape test"},"dependencies":{"postcss":"^5.0.0"},"devDependencies":{"eslint":"1.2.1","tape":"4.2.0"},"gitHead":"4b8a07e6e7f4f0a30ac6d1d611f05de7dff6ab05","bugs":{"url":"https://github.com/davidtheclark/postcss-simple-extend/issues"},"_id":"postcss-simple-extend@1.0.0","_shasum":"7d369c4ee1c0df752c252f4a3d82aab81309c29e","_from":".","_npmVersion":"2.13.2","_nodeVersion":"0.12.7","_npmUser":{"name":"davidtheclark","email":"david.dave.clark@gmail.com"},"dist":{"shasum":"7d369c4ee1c0df752c252f4a3d82aab81309c29e","size":4396,"noattachment":false,"key":"/postcss-simple-extend/-/postcss-simple-extend-1.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/postcss-simple-extend/download/postcss-simple-extend-1.0.0.tgz"},"maintainers":[{"name":"davidtheclark","email":"david.dave.clark@gmail.com"}],"directories":{},"publish_time":1440635250820,"_cnpm_publish_time":1440635250820,"_hasShrinkwrap":false},"0.3.2":{"name":"postcss-simple-extend","author":{"name":"David Clark","email":"david.dave.clark@gmail.com","url":"http://davidtheclark.com"},"license":"MIT","version":"0.3.2","description":"Simple extends for PostCSS","homepage":"https://github.com/davidtheclark/postcss-simple-extend","repository":{"type":"git","url":"git+https://github.com/davidtheclark/postcss-simple-extend.git"},"keywords":["css","postcss","postcss-plugin","mixin","clone","extend"],"files":["index.js","LICENSE","README.md","CHANGELOG.md"],"main":"index.js","scripts":{"lint":"eslint index.js test/index.js","test":"npm run lint && tape test"},"dependencies":{"postcss":"^4.1.0"},"devDependencies":{"eslint":"0.24.1","tape":"4.0.0"},"gitHead":"060c11bee26dbc4b2bc1594b944f22cda994b472","bugs":{"url":"https://github.com/davidtheclark/postcss-simple-extend/issues"},"_id":"postcss-simple-extend@0.3.2","_shasum":"5fc852f15747de5c5907d0c896550d8a2401ffc0","_from":".","_npmVersion":"2.12.1","_nodeVersion":"0.12.6","_npmUser":{"name":"davidtheclark","email":"david.dave.clark@gmail.com"},"maintainers":[{"name":"davidtheclark","email":"david.dave.clark@gmail.com"}],"dist":{"shasum":"5fc852f15747de5c5907d0c896550d8a2401ffc0","size":4375,"noattachment":false,"key":"/postcss-simple-extend/-/postcss-simple-extend-0.3.2.tgz","tarball":"http://registry.cnpm.dingdandao.com/postcss-simple-extend/download/postcss-simple-extend-0.3.2.tgz"},"directories":{},"publish_time":1436644636443,"_cnpm_publish_time":1436644636443,"_hasShrinkwrap":false},"0.3.1":{"name":"postcss-simple-extend","author":{"name":"David Clark","email":"david.dave.clark@gmail.com","url":"http://davidtheclark.com"},"license":"MIT","version":"0.3.1","description":"Simple extends for PostCSS","homepage":"https://github.com/davidtheclark/postcss-simple-extend","repository":{"type":"git","url":"https://github.com/davidtheclark/postcss-simple-extend.git"},"keywords":["css","postcss","postcss-plugin","mixin","clone","extend"],"files":["index.js","LICENSE","README.md","CHANGELOG.md"],"main":"index.js","scripts":{"lint":"eslint index.js test/index.js","test":"npm run lint && tape test"},"dependencies":{"postcss":"^4.1.0"},"devDependencies":{"eslint":"0.18.0","tape":"4.0.0"},"gitHead":"90fe7f85ce02312cf31d015c860c99dd8cf8b72f","bugs":{"url":"https://github.com/davidtheclark/postcss-simple-extend/issues"},"_id":"postcss-simple-extend@0.3.1","_shasum":"b8773a416bf0ea6455891405de1f4e40f70d68d8","_from":".","_npmVersion":"2.7.6","_nodeVersion":"0.12.2","_npmUser":{"name":"davidtheclark","email":"david.dave.clark@gmail.com"},"maintainers":[{"name":"davidtheclark","email":"david.dave.clark@gmail.com"}],"dist":{"shasum":"b8773a416bf0ea6455891405de1f4e40f70d68d8","size":4147,"noattachment":false,"key":"/postcss-simple-extend/-/postcss-simple-extend-0.3.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/postcss-simple-extend/download/postcss-simple-extend-0.3.1.tgz"},"directories":{},"publish_time":1428879323974,"_cnpm_publish_time":1428879323974,"_hasShrinkwrap":false},"0.3.0":{"name":"postcss-simple-extend","author":{"name":"David Clark","email":"david.dave.clark@gmail.com","url":"http://davidtheclark.com"},"license":"MIT","version":"0.3.0","description":"Simple extends for PostCSS","homepage":"https://github.com/davidtheclark/postcss-simple-extend","repository":{"type":"git","url":"https://github.com/davidtheclark/postcss-simple-extend.git"},"keywords":["css","postcss","postcss-plugin","mixin","clone","extend"],"files":["index.js","LICENSE","README.md","CHANGELOG.md"],"main":"index.js","scripts":{"lint":"eslint index.js test/index.js","test":"npm run lint && tape test"},"dependencies":{"postcss":"^4.1.0"},"devDependencies":{"eslint":"0.18.0","tape":"4.0.0"},"gitHead":"d277d9c3a815d392900c17f7ec5bfc665e5a4890","bugs":{"url":"https://github.com/davidtheclark/postcss-simple-extend/issues"},"_id":"postcss-simple-extend@0.3.0","_shasum":"5b117e4958a153a044db889a52090dc2b6b8ebd6","_from":".","_npmVersion":"2.7.4","_nodeVersion":"0.12.1","_npmUser":{"name":"davidtheclark","email":"david.dave.clark@gmail.com"},"maintainers":[{"name":"davidtheclark","email":"david.dave.clark@gmail.com"}],"dist":{"shasum":"5b117e4958a153a044db889a52090dc2b6b8ebd6","size":3956,"noattachment":false,"key":"/postcss-simple-extend/-/postcss-simple-extend-0.3.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/postcss-simple-extend/download/postcss-simple-extend-0.3.0.tgz"},"directories":{},"publish_time":1428459273798,"_cnpm_publish_time":1428459273798,"_hasShrinkwrap":false},"0.2.0":{"name":"postcss-simple-extend","author":{"name":"David Clark","email":"david.dave.clark@gmail.com","url":"http://davidtheclark.com"},"license":"MIT","version":"0.2.0","description":"Simple extends for PostCSS","homepage":"https://github.com/davidtheclark/postcss-simple-extend","repository":{"type":"git","url":"https://github.com/davidtheclark/postcss-simple-extend.git"},"keywords":["css","postcss","postcss-plugin","mixin","clone","extend"],"files":["index.js","LICENSE","README.md","CHANGELOG.md"],"main":"index.js","scripts":{"lint":"eslint index.js test/index.js","test":"npm run lint && tape test"},"dependencies":{"postcss":"^4.0.0"},"devDependencies":{"eslint":"0.17.0","tape":"3.5.0"},"gitHead":"f4122523e1a157daa963ef5a840401095ba5ea44","bugs":{"url":"https://github.com/davidtheclark/postcss-simple-extend/issues"},"_id":"postcss-simple-extend@0.2.0","_shasum":"fc4e8a5102beb931190437b0eafff619d24be75a","_from":".","_npmVersion":"2.7.1","_nodeVersion":"0.12.0","_npmUser":{"name":"davidtheclark","email":"david.dave.clark@gmail.com"},"maintainers":[{"name":"davidtheclark","email":"david.dave.clark@gmail.com"}],"dist":{"shasum":"fc4e8a5102beb931190437b0eafff619d24be75a","size":3962,"noattachment":false,"key":"/postcss-simple-extend/-/postcss-simple-extend-0.2.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/postcss-simple-extend/download/postcss-simple-extend-0.2.0.tgz"},"directories":{},"publish_time":1426380798130,"_cnpm_publish_time":1426380798130,"_hasShrinkwrap":false},"0.1.1":{"name":"postcss-simple-extend","author":{"name":"David Clark","email":"david.dave.clark@gmail.com","url":"http://davidtheclark.com"},"license":"MIT","version":"0.1.1","description":"Simple extends for PostCSS","homepage":"https://github.com/davidtheclark/postcss-simple-extend","repository":{"type":"git","url":"https://github.com/davidtheclark/postcss-simple-extend.git"},"keywords":["css","postcss","postcss-plugin","mixin","clone","extend"],"files":["index.js","LICENSE","README.md","CHANGELOG.md"],"main":"index.js","scripts":{"lint":"eslint index.js test/index.js","test":"npm run lint && tape test"},"dependencies":{"postcss":"^4.0.0"},"devDependencies":{"eslint":"^0.12.0","tape":"^3.4.0"},"gitHead":"23b87e73c14ab358e42eef5924a1c4ecf15c326e","bugs":{"url":"https://github.com/davidtheclark/postcss-simple-extend/issues"},"_id":"postcss-simple-extend@0.1.1","_shasum":"26b6a0f5fe3235f882368d8211022823ce5a6dbe","_from":".","_npmVersion":"2.3.0","_nodeVersion":"0.10.35","_npmUser":{"name":"davidtheclark","email":"david.dave.clark@gmail.com"},"maintainers":[{"name":"davidtheclark","email":"david.dave.clark@gmail.com"}],"dist":{"shasum":"26b6a0f5fe3235f882368d8211022823ce5a6dbe","size":3487,"noattachment":false,"key":"/postcss-simple-extend/-/postcss-simple-extend-0.1.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/postcss-simple-extend/download/postcss-simple-extend-0.1.1.tgz"},"directories":{},"publish_time":1422319555882,"_cnpm_publish_time":1422319555882,"_hasShrinkwrap":false},"0.1.0":{"name":"postcss-simple-extend","author":{"name":"David Clark","email":"david.dave.clark@gmail.com","url":"http://davidtheclark.com"},"license":"MIT","version":"0.1.0","description":"Simple extends for PostCSS","homepage":"https://github.com/davidtheclark/postcss-simple-extend","repository":{"type":"git","url":"https://github.com/davidtheclark/postcss-simple-extend.git"},"keywords":["css","postcss","postcss-plugin","mixin","clone","extend"],"files":["index.js","LICENSE","README.md","CHANGELOG.md"],"main":"index.js","scripts":{"lint":"eslint index.js test/index.js","test":"npm run lint && tape test"},"dependencies":{"postcss":"^4.0.0"},"devDependencies":{"eslint":"^0.12.0","tape":"^3.4.0"},"gitHead":"95c100bcf02e3fde189b7e69133c7734073c9528","bugs":{"url":"https://github.com/davidtheclark/postcss-simple-extend/issues"},"_id":"postcss-simple-extend@0.1.0","_shasum":"fd515d1939acc3bd4a796084ed2f021ab0b75614","_from":".","_npmVersion":"2.2.0","_nodeVersion":"0.10.35","_npmUser":{"name":"davidtheclark","email":"david.dave.clark@gmail.com"},"maintainers":[{"name":"davidtheclark","email":"david.dave.clark@gmail.com"}],"dist":{"shasum":"fd515d1939acc3bd4a796084ed2f021ab0b75614","size":3231,"noattachment":false,"key":"/postcss-simple-extend/-/postcss-simple-extend-0.1.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/postcss-simple-extend/download/postcss-simple-extend-0.1.0.tgz"},"directories":{},"publish_time":1422112169566,"_cnpm_publish_time":1422112169566,"_hasShrinkwrap":false}},"readme":"# postcss-simple-extend [![Build Status](https://travis-ci.org/davidtheclark/postcss-simple-extend.svg?branch=master)](https://travis-ci.org/davidtheclark/postcss-simple-extend)\n\n**A [PostCSS](https://github.com/postcss/postcss) plugin that enables you to extend placeholder selectors in CSS.**\n\nUse this plugin to define a rule set with an abstract, extendable selector — a \"placeholder selector\" — to which you can, later on, add concrete selectors from other rule sets.\n\nThe functionality should mirror Sass's `@extend` with `%` placeholders (a.k.a. \"silent classes\").\nUnlike Sass's `@extend`, however, *this plugin does not enable you to extend real selectors*: i.e. you cannot `@extend .classname` or `@extend ul > li + li > span a`.\nThat key difference makes this plugin *much* more simple, and arguably much less dangerous.\nMany of the potential problems with Sass's `@extend` simply do not apply to this limited, more *simple* version. Smart Sass users often recommend to only ever `@extend` placeholders (cf. [Harry Robert](http://csswizardry.com/2014/01/extending-silent-classes-in-sass/) and [Hugo Giraudel](http://sass-guidelin.es/#extend)): *with this plugin, that recommendation is enforced*.\n\nIf you are looking for a more full-featured `@extend`, check out [`postcss-extend`](https://github.com/travco/postcss-extend).\n\n> **A Note on \"mixins\" & \"extends\"**: Mixins copy declarations from an abstract definition into a concrete rule set. The simple extend supported by this plugin clones a concrete rule set's selector and adds it to an abstract placeholder selector. If you would like to use mixins, as well — or instead — have a look at [`postcss-mixins`](https://github.com/postcss/postcss-mixins).\n>\n> Also think about this: *Should* you use an `@extend` instead of a `@mixin`? The answer: *maybe not*. Given the fact that [`@extend`s don't actually reduce generated file size (after gzip)](https://tech.bellycard.com/blog/sass-mixins-vs-extends-the-data/), and the CSS generated by mixins is easier to read and understand, *you might not want to introduce `@extend`s to your codebase*. Just consider.\n\n## Installation\n\n```\nnpm install postcss-simple-extend --save\n```\n\nThis plugin is compatible with PostCSS v4.1+.\n\n## Example Input-Output\n\nInput:\n```css\n@define-placeholder gigantic {\n  font-size: 40em;\n}\n\n.foo {\n  @extend gigantic;\n  color: red;\n}\n\n.bar {\n  @extend gigantic;\n  color: orange;\n}\n```\n\nOutput:\n```css\n.foo,\n.bar {\n  font-size: 40em;\n}\n\n.foo {\n  color: red;\n}\n\n.bar {\n  color: orange;\n}\n```\n\n## Usage\n\n### Define Your Placeholder\n\nWith `@define-placeholder`, you associate a rule set with a placeholder selector, which you will later extend with concrete selectors.\n\nYou can also use `@define-extend` or `@simple-extend-define`, if either of those better fits your mind and situation.\n\n```css\n@define-placeholder simple-list {\n  list-style-type: none;\n  margin: 0;\n  padding: 0;\n}\n/* or @define-extend simple-list {...} */\n/* or @simple-extend-define simple-list {...} */\n```\n\n`@define-placeholder` at-rules, and the placeholder names (e.g. `simple-list`, above), will be removed entirely from the generated CSS, replaced by the selectors you've added via `@extend` (see example above).\n\nThere are some defining guidelines to obey (violations should log warnings):\n- Definitions must occur at the root level (i.e. not inside statements, such as rule sets or `@media` blocks).\n- Definitions should only contain declarations and comments: no statements.\n\n### Extend a Placeholder (Add Selectors to It)\n\nUse the at-rule `@extend` within a rule set to add that rule set's selector(s) to a placeholder (which was defined via `@define-placeholder`).\n\nYou can also use `@simple-extend-addto`, if that better fits your mind and situation.\n\n```css\n.list-i-want-to-be-simple {\n  @extend simple-list;\n  /* or @simple-extend-addto simple-list; */\n  font-size: 40em;\n}\n```\n\nAnd there are some `@extend` guidelines to obey (violations should log warnings):\n- `@extend` must *not* occur at the root level: only inside rule sets.\n- `@extend` must *not* occur within `@media` statements. (The generated code almost certainly would not match your intention.)\n- The placeholder must be defined *before* `@extend` can refer to it.\n\n### Plug it in to PostCSS\n\nPlug it in just like any other PostCSS plugin. There are no frills and no options, so integration should be straightforward. For example (as a node script):\n\n```js\nvar fs = require('fs');\nvar postcss = require('postcss');\nvar simpleExtend = require('postcss-simple-extend');\n\nvar inputCss = fs.readFileSync('input.css', 'utf8');\n\nvar outputCss = postcss()\n  .use(simpleExtend())\n  // or .use(simpleExtend)\n  .process(inputCss)\n  .css;\n\nconsole.log(outputCss);\n```\n\nOr take advantage of [any of the myriad other ways to consume PostCSS](https://github.com/postcss/postcss#usage), and follow the plugin instructions they provide.\n","_attachments":{},"homepage":"https://github.com/davidtheclark/postcss-simple-extend","bugs":{"url":"https://github.com/davidtheclark/postcss-simple-extend/issues"},"license":"MIT"}