Send primary color to ember UI

This commit is contained in:
Neil MacDougall 2021-05-25 10:24:20 +01:00
parent 9909ed9c97
commit 10bf88a0ed
1 changed files with 10 additions and 0 deletions

View File

@ -366,6 +366,16 @@ export default {
if (this.loaded) {
if (this.iframeEl) {
this.iframeEl.classList.remove(EMBER_FRAME_HIDE_CLASS);
// Notify the embedded UI of the primary and primary text colors
const primary = window.getComputedStyle(document.body).getPropertyValue('--primary');
const primaryText = window.getComputedStyle(document.body).getPropertyValue('--primary-text');
this.iframeEl.contentWindow.postMessage({
action: 'colors',
primary,
primaryText,
});
}
}
},