{"name":"insert-rule","description":"Insert rules into a stylesheet programatically with a simple API","version":"1.0.0","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.0.0","dist":{"shasum":"3b7f33e78c933c2b55608f386552a1a99ad18508","tarball":"http://registry-npm.ywwl.com/insert-rule/download/insert-rule-1.0.0.tgz","integrity":"sha512-fVYo8QkE7MNtqGSWbYFyRU6Nc+Mw9G5f/IHrEgdzz/zaTHZJKhrdMBxnRoFKXlLfIVTMgWu6j58MXlqI1MpCKw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHd4/EzOZvmhReX+3pelhO2KzhKlepaDbcN/M9MJHzMUAiBLQwCa1fA9gQeh3ZNwMzDarNIk6F6Cne50ZENVgAkZ9g=="}],"size":3715,"noattachment":false,"key":"/insert-rule/-/insert-rule-1.0.0.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":1400355281692,"_cnpm_publish_time":1400355281692,"dist-tags":{"latest":"2.1.0"}}