_chats.scss 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  1. /* ------------------------------------------------------------------------------
  2. *
  3. * # Chat layouts
  4. *
  5. * Conversation chat styles - layouts, chat elements, colors, options
  6. *
  7. * ---------------------------------------------------------------------------- */
  8. // Check if component is enabled
  9. @if $enable-chat {
  10. // Set scrollbar to the long chat list
  11. .media-chat-scrollable {
  12. max-height: $chat-list-max-height;
  13. overflow: auto;
  14. }
  15. // Message list
  16. .media-chat {
  17. // Set side spacing for message bodies
  18. @include media-breakpoint-up(sm) {
  19. .media {
  20. margin-right: 20%;
  21. // Reversed item
  22. &.media-chat-item-reverse {
  23. margin-right: 0;
  24. margin-left: 20%;
  25. }
  26. }
  27. }
  28. }
  29. // Message body
  30. .media-chat-item {
  31. position: relative;
  32. padding: $chat-message-padding-y $chat-message-padding-x;
  33. width: auto;
  34. display: inline-block;
  35. color: $chat-message-color;
  36. @include border-radius($chat-message-border-radius);
  37. // Set default bg color
  38. &:not([class*=bg-]) {
  39. background-color: $chat-message-bg;
  40. border-color: $chat-message-bg;
  41. }
  42. // Arrow base
  43. &:before {
  44. content: '';
  45. left: -($chat-message-arrow-size);
  46. top: ($chat-message-padding-y + ($line-height-computed / 2) - rem-calc($chat-message-arrow-size));
  47. position: absolute;
  48. margin-left: 0;
  49. border-top: $chat-message-arrow-size solid transparent;
  50. border-right: $chat-message-arrow-size solid;
  51. border-right-color: inherit;
  52. border-bottom: $chat-message-arrow-size solid transparent;
  53. // Reversed arrow
  54. .media-chat-item-reverse & {
  55. left: auto;
  56. right: -($chat-message-arrow-size);
  57. border-right: 0;
  58. border-left: $chat-message-arrow-size solid;
  59. border-left-color: inherit;
  60. }
  61. }
  62. }
  63. // Reversed message body
  64. .media-chat-item-reverse {
  65. // Message
  66. .media-chat-item {
  67. text-align: left;
  68. color: $chat-message-reversed-color;
  69. // Set default bg color
  70. &:not([class*=bg-]) {
  71. background-color: $chat-message-reversed-bg;
  72. border-color: $chat-message-reversed-bg;
  73. }
  74. }
  75. // Change text alignment
  76. .media-body {
  77. text-align: right;
  78. }
  79. }
  80. // Inversed message list
  81. .media-chat-inverse {
  82. .media-chat-item {
  83. color: $chat-message-reversed-color;
  84. // Colors
  85. &:not([class*=bg-]) {
  86. background-color: $chat-message-reversed-bg;
  87. border-color: $chat-message-reversed-bg;
  88. }
  89. }
  90. // Reversed message
  91. .media-chat-item-reverse {
  92. .media-chat-item {
  93. color: $chat-message-color;
  94. // Colors
  95. &:not([class*=bg-]) {
  96. background-color: $chat-message-bg;
  97. border-color: $chat-message-bg;
  98. }
  99. }
  100. }
  101. }
  102. }