cssStyleSheet.addRule(selector, styles, 0);CSSStyleSheet: addRule() method / notebook
CSSStyleSheet: addRule() method
Runnable notebook: every JavaScript, HTML and CSS example on this page executes in a sandboxed local frame. Nothing leaves the browser.
cssStyleSheet.insertRule(`${selector} {${styles}}`, 0);