varcolor1=window.getComputedStyle(document.documentElement).getPropertyValue('--my-color1');variframe=document.getElementById("testIframe");iframe.contentDocument.getElementById("contentBlock").style.backgroundColor=color1; 如此,通过该段代码就可以实现将CSS Root Variable的值传给iframe并且应用到对应的组...