/*.chat-messages { position: relative; padding: 16px 40px; .message-row { position: relative; display: flex; flex-direction: column; align-items: flex-start; justify-content: flex-end; padding: 0 16px 4px 16px; .avatar { position: absolute; left: -32px; margin: 0; } .bubble { position: relative; display: flex; align-items: center; justify-content: center; padding: 12px; max-width: 100%; .message { white-space: pre-wrap; line-height: 1.2; } .time { position: absolute; display: none; width: 100%; font-size: 11px; margin-top: 8px; top: 100%; left: 0; white-space: nowrap; } } &.contact { .bubble { border-top-left-radius: 5px; border-bottom-left-radius: 5px; border-top-right-radius: 20px; border-bottom-right-radius: 20px; .time { margin-left: 12px; } } &.first-of-group { .bubble { border-top-left-radius: 20px; } } &.last-of-group { .bubble { border-bottom-left-radius: 20px; } } } &.me { padding-left: 40px; .avatar { order: 2; margin: 0 0 0 16px; } .bubble { margin-left: auto; border-top-left-radius: 20px; border-bottom-left-radius: 20px; border-top-right-radius: 5px; border-bottom-right-radius: 5px; .time { justify-content: flex-end; right: 0; margin-right: 12px; } } &.first-of-group { .bubble { border-top-right-radius: 20px; } } &.last-of-group { .bubble { border-bottom-right-radius: 20px; } } } &.contact + .me, &.me + .contact { padding-top: 20px; margin-top: 20px; } &.first-of-group { .bubble { border-top-left-radius: 20px; padding-top: 13px; } } &.last-of-group { .bubble { border-bottom-left-radius: 20px; padding-bottom: 13px; .time { display: flex; } } } } } */ $otherBox-line: #cccccc; $otherBox-bg: #ffffff; $meBox-line: #cccccc; $meBox-bg: #ffffff; .chat-messages { padding: 30px 40px; display: flex; flex-direction: column; } .information-msg { width: 100%; height: 100%; text-align: center; background-color: #dddddd; padding: 10px; margin: 10px 0; } .message-row { margin-bottom: 20px; .date-splitter { display: block; width: 100%; margin-bottom: 10px; } .chat-row { position: relative; display: flex; flex-direction: row; .profile-img { flex: 0 0 auto; img{ border-radius: 50%; } } } &.me { .chat-row { flex-direction: row-reverse; .profile-info { flex-direction: row-reverse; display: flex; justify-content: flex-end; } } } .message-main { margin-left: 20px; margin-right: 10px; .chat-name { font-size: 12px; color: #333333; margin-bottom: 6px; } .bubble { border: 1px solid $otherBox-line; font-weight: 900; position: relative; background-color: $otherBox-bg; border-radius: 4px; box-shadow: 0 1px 1px rgba(0, 0, 0, 0.15); &:before { content: ''; width: 0px; height: 0px; position: absolute; border-left: 6px solid transparent; border-right: 6px solid $otherBox-line; border-top: 6px solid $otherBox-line; border-bottom: 6px solid transparent; left: -12px; top: 4px; } &:after { content: ''; width: 0px; height: 0px; position: absolute; border-left: 6px solid transparent; border-right: 6px solid $otherBox-bg; border-top: 6px solid $otherBox-bg; border-bottom: 6px solid transparent; left: -10px; top: 5px; } } } .secondary-text { align-self: flex-end; font-size: 11px; color: #666666; word-wrap: break-word; white-space: nowrap; } &.me { .secondary-text { text-align: end; } } } .message-row.me > .bubble { border: 1px solid $meBox-line; background-color: $meBox-bg; } .message-row.me { .profile-img { display: none; } .chat-name { display: none; } .message-main { text-align: right; margin-left: 10px; margin-right: 20px; & .bubble:before { content: ''; width: 0px; height: 0px; position: absolute; border-left: 6px solid $meBox-line; border-right: 6px solid transparent; border-top: 6px solid $meBox-line; border-bottom: 6px solid transparent; left: initial; right: -12px; top: 4px; } & .bubble:after { content: ''; width: 0px; height: 0px; position: absolute; border-left: 6px solid $meBox-bg; border-right: 6px solid transparent; border-top: 6px solid $meBox-bg; border-bottom: 6px solid transparent; left: initial; right: -10px; top: 5px; } } }