I have the following code which uses the index to get stylesheet and also css class inside that stylesheet.
for (var s = document.styleSheets.length - 1; s
If I understands correctly, you want to change CSS. Precisely you want to change CSS rules for a class.
To do so, and to be the most performance efficient, I would create a stylesheet with your selectors, it might be just .selector>div{} for example or just .selector{}.
I used this a while ago to make my table cells square (while my cells was all equal).
Then I used this code to change parameters of the class in the stylesheet.
document.styleSheets[0].cssRules[numberOfSelector].style.height=document.querySelector('.squerify td').offsetWidht+"px";
This was the best way I could think of, but if you want, you could use a loop to search for the classes.
Send a comment if misunderstood your question.