CSSStyleSheet.insertRule()

CSSStyleSheet.insertRule(".red::before { color: lightgray;content:"测试" }",0)

CSSStyleSheet.addRule()

已经移除废弃

stylesheet.deleteRule(index)
CSSStyleSheet.replace()

详情见官网 https://developer.mozilla.org/