Customize color of user's messages

[class*=“dialog-message__Background-sc”] changes only the chatbot bubbles.
How can the user’s bubble background be changed?
Just tell the class name.
Thanks

2 Likes

Greetings and welcome aboard, @Giorgio_Fiorini :wave:

This code should do the trick:

[class*="ButtonBase__ButtonContainer-sc"] {
  background-color: red!important;
}

Test it out and let me know if it helped :slightly_smiling_face:

1 Like

You got it ALL wrong.
I was mentioning the background of user’s dialog message.

2 Likes

Oh, sorry for misunderstanding!

The thing is that the container of the user’s and bot’s message have the same static class, so the only solution is to use dynamic classes, which will be different for each widget. Here is the code for your Chatbot milanolinfedema.it:

.jSXuMJ [class*="dialog-message__Background-sc"] {
    background-color: red !important;
}

.jSXuMJ [class*="dialog-message__Background-sc"] svg {
    fill: red !important;
}

If you’d like to apply this code to another widgets, you should replace the dynamic class at the beginning of the codes:

To find the needed dynamic class, right-click the widget and choose Inspect. After that, press Ctrl+F and type dialog-message into the Search field:

You’ll see 2 elements with the dialog-message__Container class. You should choose the 2nd one and copy the part before user-render-messages.

Please let me know if it helped or if you have any questions left :slightly_smiling_face:

1 Like

Thank you, but how can I change the font color?
Using the command color #something doesn’t work

2 Likes

This code will work:

.jSXuMJ [class*="dialog-message__Background-sc"] p {
    color: red;
}
1 Like

It works like a charm, thank you very much.
Is there a method to change che left or right position of the [class^=‘FloatingButton__FloatingButtonContainer-sc’], according to @media query?
I have a respionsive layout and I’d like to change the margin position of the AI button according to my @media queries.
Thanks again

2 Likes

You’re always welcome :wink:

Sure, this code will help you adjust the position of the bubble based on @media query

@media screen and (max-width: 768px) {
  [class*="FloatingButton__FloatingButtonContainer-sc"] {
    left: 100px;
  }
}
1 Like

Thanks a bunch Max, works like a charm :slight_smile:

1 Like

One last question if I can ask: what’s the class for the footer, cause I’d like to change the b or strong color. Thanks again.

1 Like

Found it: you forato to mention a user message has to be sent in the dialog box, or the dialog-message related to the user won’t show up.
All solved, thanks.

2 Likes

Great, you’re welcome :wink:

1 Like

One last question: can I change the color of the for of the footer? Thanks

2 Likes

Here is the code to change the footer background color and the color of the footer text:

  [class*="footer__Container-sc"] {
    background-color: red;
    color: white;
  }
1 Like

Perfect, thank you again!

2 Likes

No sweat :wink:

1 Like

Thanks weird: suddenly all the dynamic classes changed, in all of the scripts.
I had to replace them manually, one by one.

Was it normal, and will it happen again?

2 Likes

Hi @Giorgio_Fiorini :wave:

Yeah, since these are the dynamic classes, they can be changed sometimes. Unfortunately, the elements you’ve customized don’t have constant classes and the only solution is to use the dynamic classes.

2 Likes

Thank you max

2 Likes

You’re always welcome!

In the meantime, we’d like to invite you to join our new challenge, where you can win 3 FREE months for your subscription. Check the details and participate :wink: - March Challenge: Share your results with Elfsight & win 3 FREE months!:rocket:

2 Likes