new CSSStyleDeclaration
you may create a temporary DOM element and use its style
property:
const rules = document.createElement('span').style;
rules.backgroundColor = 'red';
rules.cursor = 'pointer';
rules.color = 'white';
document.getElementById('style_string').innerHTML = rules.cssText;
document.getElementById('obj').style = rules.cssText;
<pre id="style_string"></pre>
<div id="obj">TEST</div>