package
insert a string of css into the <head>
npm install insert-cssGitHub-flavored package documentation.
Across all versions, last 30 days.
1,208,220 in 30 days
Runtime metadata.
Tagged topics.
insert a string of css into the <head>
var insertCss = require('insert-css');
var styleElement = insertCss('body { background:blue; }'); var insertCss = require('insert-css');Insert some CSS into the page.
opts.container - Which HTMLElement to use as the base mounting point, defaults to
document.querySelector('head').
opts.prepend - Add the CSS at the top level of the container instead of at the bottom level (default).
This is particullary useful for library creators where you may want your default CSS to be prepended so it can be easily overriden by user styles.
npm run examplenpm test