const styling: { name: string, value: string }[] = [
{ name: "--primary", value: "#123456" }
];
let styleElement: HTMLElement = document.createElement( 'style' );
let cssVariable: string = '';
for ( let i = 0; i < styling.length; i++ ) {
cssVariable += styling[i].name + ':' + styling[i].value + ';';
}
styleElement.innerText = ':root { ' + cssVariable + ' }';
document.getElementsByTagName( 'head' )[0].appendChild( styleElement );