inline-style-loader

0.0.5 • Public • Published

inline-style-loader

A webpack loader that imports a css file and converts it to be used as an inline style

Build Status Dependencies

Usage

.selector {
    color: red;
    background-color: blue;
}
element = document.createElement('div');
element.setAttribute('style', 
    require('raw!inline-style!./some-inline-style.css')['.selector']
);
<div style="color: red; background-color: blue;"></div>

Check the demo for a more complete example

Limitations

Because the css is inlined, pseudo classes (:hover, :active, ...) can't be supported.

Readme

Keywords

Package Sidebar

Install

npm i inline-style-loader

Weekly Downloads

217

Version

0.0.5

License

MIT

Last publish

Collaborators

  • jbsouvestre