0.2.0 • Published 8 years ago

fis-inline-style-loader v0.2.0

Weekly downloads
-
License
MIT
Repository
-
Last release
8 years ago

fis-inline-style-loader

npm i fis-inline-style-loader -D

webpack.config.js

module: {
    preLoaders: [
        {
            test: /\.js$/,
            loaders: ['fis-inline-style']
        }
    ]
}

a.css

body {font-size:12px;}

a.js

__css("./a.css");

output: a.js

;(function (content) {
  var head = document.getElementsByTagName("head")[0] || document.documentElement;
  var sty = document.createElement("style");
  sty.type = "text/css";
  // IE
  if (sty.styleSheet) {
    sty.styleSheet.cssText = content;
  } else {
    sty.innerHTML = content;
  }
  head.appendChild(sty);
})("body {font-size:12px;}");
0.2.0

8 years ago

0.1.0

8 years ago

0.0.1

8 years ago