JSFiddle - React, Tailwind, and code Playground
HTML
<div class="select">Hi there. These are inline styles</div>
CSS
.select {
background-color:black;
color:white;
}
JavaScript
(function ($) {
$.extend($.fn, {
makeCssInline: function () {
this.each(function (idx, el) {
var style = el.style;
var properties = [];
for (var property in style) {
if ($(this).css(property)) {
properties.push(property + ':' + $(this).css(property));
}
}
this.style.cssText = properties.join(';');
$(this).children().makeCssInline();
});
}
});
}(jQuery));
$('.select').makeCssInline();