The number of rules that can be applied at one time with cssText is 4095.
Be careful to invoke the property on the styleSheet object itself, not the HTMLElement returned by getElementById or createElement. For newly created stylesheet objects, you must first append the element to the document before you can set cssText.
var ss = document.createElement('STYLE');
document.documentElement.firstChild.appendChild(ss);
ss.styleSheet.cssText = " ... style rules go here ... ";