Inject a CSS file in the DOM.
Useful for loading a simple CSS file without embedding both css-loader
and style-loader
in your script.
npm install --save-dev simple-css-loader
With this style.css
:
a {
color: red;
}
a:hover {
color: blue;
}
,
require('simple-css!./style.css');
will append this Dom node to <head>
:
<style type="text/css" >
a {
color: red;
}
a:hover {
color: blue;
}
</style>