PostHTML CSS Inliner
npm install posthtml-inline-cssPostHTML plugin for inlining CSS to style attrs
js
var posthtml = require('posthtml'),
css = 'div { color: red }';posthtml([require('posthtml-inline-css')(css)])
.process('
Hello!')
.then(function (result) {
console.log(result.html);
});//
Hello!
`
$3
`js
var posthtml = require('posthtml'),
html = 'Hello!';posthtml([require('posthtml-inline-css')()])
.process(html)
.then(function (result) {
console.log(result.html);
});
//
Hello!
`
$3
`js
var posthtml = require('posthtml'),
postcss = require('postcss'),
postcssObj = postcss(/ some PostCSS plugins /).process('div { color: white }');
posthtml([require('posthtml-inline-css')(postcssObj)])
.process('
Hello!')
.then(function (result) {
console.log(result.html);
});//
Hello!
``