JSFiddle - React, Tailwind, and code Playground

HTML

<h2>Foo is red</h2>
<h3>Bar is green</h3>

JavaScript

var styles = [
    "h2 { color: red; }",
    "h3 { color: green; }"
];

// get the last stylesheet
var sheet = document.styleSheets[document.styleSheets.length-1];
// get a reference to the insertRule function
var insertRule = sheet[sheet.insertRule ? "insertRule" : "addRule"];
// reuse the styles-array from the jQuery snippet
while (styles.length) {
    insertRule.call(sheet, styles.splice(0,1));
}