Skip to content

Instantly share code, notes, and snippets.

@ice6
Last active April 18, 2024 08:57
Show Gist options
  • Save ice6/b1977b11e68686974d737ea082ec278b to your computer and use it in GitHub Desktop.
Save ice6/b1977b11e68686974d737ea082ec278b to your computer and use it in GitHub Desktop.
Different color and alignment for sent versus received messages (Chat Bubbles UX)
.messages-box ul {
background-color: #F5F5F2;
}
.message {
display: flex;
}
.message:hover {
background-color:transparent;
}
.message .message-body-wrapper {
margin-right: 10px;
max-width: 70%;
}
.message.own {
flex-direction: row-reverse;
}
.message.own .thumb {
left: auto;
right: 16px;
}
.message.own .message-body-wrapper .title {
flex-direction: row-reverse;
}
.message .message-body-wrapper .body {
background-color: #fff;
padding: 6px;
border: 1px solid #E7E7E5;
border-radius: 1px;
}
.message .message-body-wrapper .body:hover {
background-color: #F6F6F3;
}
.message.own .message-body-wrapper .body {
background-color: #60E171;
}
.message.system.uj {
justify-content: center;
}
.message.system.uj .thumb {
visibility: hidden;
}
.message .message-body-wrapper .title .message-alias {
display: none;
}
@ice6
Copy link
Author

ice6 commented Oct 15, 2021

under version 4.0.1.

it looks like this:

image

@ankar84
Copy link

ankar84 commented Oct 15, 2021

Looks good! Nice work!

@eltrentin
Copy link

Wow!!!! I m going to test!!!!

@budakovda
Copy link

budakovda commented Oct 15, 2021

Not bad!!! How can i check .message .rcx-box to hide .body and fix the empty color line.
Аnd also move attachments from the header line.
Screenshot from 2021-10-15 13-32-09

@clearcincom
Copy link

Where to place the file in order to benefit from the styling?

@andys448
Copy link

Looks good, but how it works in 6.2.* versions? Any luck?

@lawipac
Copy link

lawipac commented Jul 13, 2023

@andys448 It didn't work in 6.2.*. At least it points out a great possibility to change the layout. I dig into the css code using chrome inspector, hardly find any clue on differentiating 'own-message' vs 'other user message'. it's all unfied under rc-box css tags.

@ZsiGiT
Copy link

ZsiGiT commented Apr 18, 2024

Hello!

Would it be possible to make it work from version >6.7.*?

I would really like to have a skype/messenger/viber style chat.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment