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',
    props = ['color'],
    to = ['#0f0'];

for (var i = 0, len = sheets.length; i < len; i++) {
    if (sheets[i].selectorText == classString) {
        for (var c = 0, leng = props.length; c < leng; c++) {
            sheets[i].style[props[c]] = to[c];
        }
    }
}