{"name":"insert-rule","description":"Insert rules into a stylesheet programatically with a simple API","version":"1.3.3","homepage":"https://github.com/bevacqua/insert-rule","author":{"name":"Nicolas Bevacqua","email":"ng@bevacqua.io","url":"http://bevacqua.io"},"license":"MIT","repository":{"type":"git","url":"git://github.com/bevacqua/insert-rule.git"},"main":"src/insertRule.js","devDependencies":{"browserify":"^4.1.3","gulp":"^3.6.2","gulp-bump":"^0.1.8","gulp-clean":"^0.2.4","gulp-git":"^0.4.2","gulp-header":"^1.0.2","gulp-minify-css":"^0.3.4","gulp-rename":"^1.2.0","gulp-size":"^0.3.1","gulp-streamify":"0.0.5","gulp-stylus":"^1.0.0","gulp-uglify":"^0.3.0","vinyl-source-stream":"^0.1.1"},"bugs":{"url":"https://github.com/bevacqua/insert-rule/issues"},"_id":"insert-rule@1.3.3","dist":{"shasum":"d7cadc526afe75286c20563e28da2282dd148dd4","tarball":"http://registry-npm.ywwl.com/insert-rule/download/insert-rule-1.3.3.tgz","integrity":"sha512-AwtWIG1qglL2eEsnjy8jF8lsfgsAfF8eh5WrIw1CNQXXHIAEQMuXFr4gsBQLNGxwt+IDksU0W9p2TSFkTJSLSQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCWINLTkOXh+ULAc+0+UrD90mmBkxr4P/JcT95fVyta6AIhALk1xkgbZex/VPZtItEf22wQGDwTQv4AE4ANjhpk0sQi"}],"size":7104,"noattachment":false,"key":"/insert-rule/-/insert-rule-1.3.3.tgz"},"_from":".","_npmVersion":"1.4.6","_npmUser":{"name":"bevacqua","email":"nicolasbevacqua@gmail.com"},"maintainers":[{"name":"bevacqua","email":"nicolasbevacqua@gmail.com"}],"directories":{},"readme":"# insert-rule\n\n> Insert rules into a stylesheet programatically with a simple API\n\n# Install\n\nUsing Bower\n\n```shell\nbower install -S insert-rule\n```\n\nUsing `npm`\n\n```shell\nnpm install -S insert-rule\n```\n\n# `insertRule(selector, styles)`\n\nApplies the styles to the selector. The selector can be any CSS selector. That includes `:after` and `:before`, too. Styles can either be plain text or an object. Keys in `camelCase` get converted into `css-case`.\n\n##### Example\n\n```js\ninsertRule('body:after', 'font-weight: bold;');\n```\n\n```js\ninsertRule('body:after', {\n  content: '\"Ha-ha!\"',\n  display: 'block',\n  fontSize: '16px'\n});\n```\n\nYou can also remove all of the previously inserted rules.\n\n# `insertRule.clear()`\n\nOnly those inserted by the `insert-rule` module will be affected.\n\n# `insertRule.remove(selector)`\n\nRemoves style rules that were created using exactly the provided selector.\n\n# `insertRule.context(name)`\n\nYou can create a \"context\" that's self-contained, where rules will be added to a different style element. In this case, `clear()` removes all of the rules in the given context, and `.remove(selector)` only removes those rules matching the selector from the current context.\n\n```js\nvar foo = insertRule.context('foo');\nvar bar = insertRule.context('bar');\nfoo('#foo', 'color:#f00');\nbar.remove('#foo'); // nothing happens\nfoo.remove('#foo'); // rule gets removed!\n```\n\nThis separation of concerns is most useful when using `insert-rule` in _\"small-module\"_ type environments.\n\n##### Example\n\n```js\ninsertRule.clear();\n```\n\n# License\n\nMIT\n","publish_time":1400355975493,"_cnpm_publish_time":1400355975493,"dist-tags":{"latest":"2.1.0"}}