JSFiddle - React, Tailwind, and code Playground
by David Thomas
HTML
<p>Some content in a 'p' within the 'body'.</p>
CSS
body {
color: #000;
}
div {
color: #f90;
}
JavaScript
var sheets = document.styleSheets[2].rules,
classString = 'body',
propsTo = {
'color': '#0f0'
};
for (var i = 0, len = sheets.length; i < len; i++) {
if (sheets[i].selectorText == classString) {
for (var prop in propsTo) {
if (propsTo.hasOwnProperty(prop)) {
sheets[i].style[prop] = propsTo[prop];
}
}
}
}