From 10bf88a0edb1ae3a8f53d950da06b6483dc35655 Mon Sep 17 00:00:00 2001 From: Neil MacDougall Date: Tue, 25 May 2021 10:24:20 +0100 Subject: [PATCH] Send primary color to ember UI --- components/EmberPage.vue | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/components/EmberPage.vue b/components/EmberPage.vue index 9c98d7eaf7..8c8e329dfa 100644 --- a/components/EmberPage.vue +++ b/components/EmberPage.vue @@ -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, + }); } } },