style loader for webpack
Usage
Simple API
require("style!raw!./file.css");
It's recommended to combine it with the css-loader
: require("style!css!./file.css")
.
It also possible to add a URL instead of a css string:
require("style/url!file!./file.css");
Reference-counted API
var style = require("style/useable!css!./file.css");
style.use();
style.unuse();
Styles are not added on require, but instead on call to use
/ref
. Styles are removed from page if unuse
/unref
is called exactly as often as use
/ref
.
Note: Behavior is undefined when unuse
/unref
is called more often than use
/ref
. Don't do that.
License
MIT (http://www.opensource.org/licenses/mit-license.php)