{"_id":"vueify-insert-css","_rev":"1214179","name":"vueify-insert-css","description":"insert a string of css into the <head>","dist-tags":{"latest":"1.0.0"},"maintainers":[{"name":"yyx990803","email":""}],"time":{"modified":"2021-10-13T05:47:10.000Z","created":"2015-10-23T20:12:26.993Z","1.0.0":"2015-10-23T20:12:26.993Z"},"users":{},"author":{"name":"James Halliday","email":"mail@substack.net","url":"http://substack.net"},"repository":{"type":"git","url":"git://github.com/substack/insert-css.git"},"versions":{"1.0.0":{"name":"vueify-insert-css","version":"1.0.0","description":"insert a string of css into the <head>","main":"index.js","dependencies":{},"devDependencies":{"tape":"^2.13.3","computed-style":"~0.1.3"},"repository":{"type":"git","url":"git://github.com/substack/insert-css.git"},"testling":{"files":"test/*.js","browsers":["ie/6..latest","chrome/20..latest","firefox/10..latest","safari/latest","opera/11.0..latest","iphone/6","ipad/6"]},"homepage":"https://github.com/substack/insert-css","keywords":["css","insert","dom","browser","browserify"],"author":{"name":"James Halliday","email":"mail@substack.net","url":"http://substack.net"},"license":"MIT","gitHead":"c365e204a4b2cadc5601ab995a0a01fd895bbaf8","bugs":{"url":"https://github.com/substack/insert-css/issues"},"_id":"vueify-insert-css@1.0.0","scripts":{},"_shasum":"57e5d791907e8c9d87ae6de099a2174bd0a7f990","_from":".","_npmVersion":"2.11.3","_nodeVersion":"0.12.7","_npmUser":{"name":"yyx990803","email":"yyx990803@gmail.com"},"maintainers":[{"name":"yyx990803","email":""}],"dist":{"shasum":"57e5d791907e8c9d87ae6de099a2174bd0a7f990","size":2461,"noattachment":false,"key":"/vueify-insert-css/-/vueify-insert-css-1.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/vueify-insert-css/download/vueify-insert-css-1.0.0.tgz"},"directories":{},"publish_time":1445631146993,"_cnpm_publish_time":1445631146993,"_hasShrinkwrap":false}},"readme":"# insert-css\n\ninsert a string of css into the `<head>`\n\n[![browser support](https://ci.testling.com/substack/insert-css.png)](https://ci.testling.com/substack/insert-css)\n\n# example\n\nsuppose we've got some css:\n\n``` css\nbody {\n    background-color: purple;\n    color: yellow;\n}\n```\n\nand we want to bundle that css into a js file so that we can write an entirely\nself-contained module:\n\n``` js\nvar fs = require('fs');\nvar insertCss = require('insert-css');\nvar css = fs.readFileSync(__dirname + '/style.css');\ninsertCss(css);\ndocument.body.appendChild(document.createTextNode('HELLO CRUEL WORLD'));\n```\n\noptionally prepend the css to the head with the `prepend` option:\n\n``` js\ninsertCss(css, { prepend: true });\n```\n\ncompile with [browserify](http://browserify.org) using\n[brfs](https://github.com/substack/brfs) to inline the `fs.readFile()`\ncall:\n\n```\n$ browserify -t brfs insert.js > bundle.js\n```\n\nNow plop that bundle.js into a script tag and you'll have a self-contained js\nblob with inline css!\n\n``` html\n<html>\n  <head></head>\n  <body>\n    <script src=\"bundle.js\"></script>\n  </body>\n</html>\n```\n","_attachments":{},"homepage":"https://github.com/substack/insert-css","bugs":{"url":"https://github.com/substack/insert-css/issues"},"license":"MIT"}