The CSSStyleSheet.insertRule() method inserts a new CSS rule into the current style sheet.
CSSStyleSheet.insertRule()
MDN Reference