chore: Use widget color for chat input focus state (#13214)

This commit is contained in:
Sivin Varghese
2026-01-14 14:33:56 +05:30
committed by GitHub
parent bddf06907b
commit daaa18b18a
2 changed files with 10 additions and 1 deletions

View File

@@ -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;

View File

@@ -130,7 +130,7 @@ export default {
<div
class="items-center flex ltr:pl-3 rtl:pr-3 ltr:pr-2 rtl:pl-2 rounded-[7px] transition-all duration-200 bg-n-background !shadow-[0_0_0_1px,0_0_2px_3px]"
:class="{
'!shadow-n-brand dark:!shadow-n-brand': isFocused,
'!shadow-[var(--widget-color,#2781f6)]': isFocused,
'!shadow-n-strong dark:!shadow-n-strong': !isFocused,
}"
@keydown.esc="hideEmojiPicker"