Sha256: ab1faafd887f8b8c01a4f4836b7cadd21f64a41800d4ca1454f3b0844ae690bc
Contents?: true
Size: 723 Bytes
Versions: 4
Compression:
Stored size: 723 Bytes
Contents
/* MIT License http://www.opensource.org/licenses/mit-license.php Author Tobias Koppers @sokra */ module.exports = function addStyleUrl(cssUrl) { if(typeof DEBUG !== "undefined" && DEBUG) { if(typeof document !== "object") throw new Error("The style-loader cannot be used in a non-browser environment"); } var styleElement = document.createElement("link"); styleElement.rel = "stylesheet"; styleElement.type = "text/css"; styleElement.href = cssUrl; var head = document.getElementsByTagName("head")[0]; head.appendChild(styleElement); if(module.hot) { return function(cssUrl) { if(typeof cssUrl === "string") { styleElement.href = cssUrl; } else { head.removeChild(styleElement); } }; } }
Version data entries
4 entries across 4 versions & 2 rubygems