HEX
Server: Apache/2.4.61 (Ubuntu)
System: Linux hosting106 7.0.12-1-pve #1 SMP PREEMPT_DYNAMIC PMX 7.0.12-1 (2026-06-09T21:07Z) x86_64
User: clinicadentalargarate.com (1193)
PHP: 7.4.33
Disabled: pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare,
Upload Files
File: //home/cursos.ril.es/node_modules/laravel-elixir/node_modules/insert-css/readme.markdown
# insert-css

insert a string of css into the `<head>`

[![browser support](https://ci.testling.com/substack/insert-css.png)](https://ci.testling.com/substack/insert-css)

# example

suppose we've got some css:

``` css
body {
    background-color: purple;
    color: yellow;
}
```

and we want to bundle that css into a js file so that we can write an entirely
self-contained module:

``` js
var fs = require('fs');
var insertCss = require('insert-css');
var css = fs.readFileSync(__dirname + '/style.css');
insertCss(css);
document.body.appendChild(document.createTextNode('HELLO CRUEL WORLD'));
```

optionally prepend the css to the head with the `prepend` option:

``` js
insertCss(css, { prepend: true });
```

compile with [browserify](http://browserify.org) using
[brfs](https://github.com/substack/brfs) to inline the `fs.readFile()`
call:

```
$ browserify -t brfs insert.js > bundle.js
```

Now plop that bundle.js into a script tag and you'll have a self-contained js
blob with inline css!

``` html
<html>
  <head></head>
  <body>
    <script src="bundle.js"></script>
  </body>
</html>
```