function propagateStyles(rootStyles, parent) { if (parent == null && window.frameElement == null) return; const wfParent = parent ?? window.frameElement.parentElement; wfParent.style.setProperty( "--base-color", rootStyles.getPropertyValue("--base-color") ); } window.addEventListener("DOMContentLoaded", () => { propagateStyles(getComputedStyle(document.documentElement)); });