diff --git a/app/javascript/widget/App.vue b/app/javascript/widget/App.vue index 379b2bc53..19a33b8a4 100755 --- a/app/javascript/widget/App.vue +++ b/app/javascript/widget/App.vue @@ -82,6 +82,7 @@ export default { const { websiteToken, locale, widgetColor } = window.chatwootWebChannel; this.setLocale(locale); this.setWidgetColor(widgetColor); + this.setWidgetColorVariable(widgetColor); setHeader(window.authToken); if (this.isIFrame) { this.registerListeners(); @@ -114,6 +115,14 @@ export default { 'resetCampaign', ]), ...mapActions('agent', ['fetchAvailableAgents']), + setWidgetColorVariable(widgetColor) { + if (widgetColor) { + document.documentElement.style.setProperty( + '--widget-color', + widgetColor + ); + } + }, scrollConversationToBottom() { const container = this.$el.querySelector('.conversation-wrap'); container.scrollTop = container.scrollHeight; diff --git a/app/javascript/widget/components/ChatInputWrap.vue b/app/javascript/widget/components/ChatInputWrap.vue index ce8d17455..a298237f3 100755 --- a/app/javascript/widget/components/ChatInputWrap.vue +++ b/app/javascript/widget/components/ChatInputWrap.vue @@ -130,7 +130,7 @@ export default {