_messages.scss 7.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294
  1. #conversejs {
  2. .message {
  3. .mention {
  4. font-weight: bold;
  5. }
  6. .mention--self {
  7. font-weight: normal;
  8. }
  9. &.date-separator {
  10. height: 2em;
  11. margin: 0;
  12. position: relative;
  13. text-align: center;
  14. z-index: 0;
  15. .separator {
  16. border: 0.5px solid $chat-head-color;
  17. margin: 0 1em;
  18. position: relative;
  19. top: 1em;
  20. z-index: 5;
  21. }
  22. .separator-text {
  23. background: white;
  24. bottom: 1px; // Offset needed due to .separator border size
  25. color: $message-text-color;
  26. display: inline-block;
  27. line-height: 2em;
  28. padding: 0 1em;
  29. position: relative;
  30. z-index: 5;
  31. }
  32. }
  33. &.chat-info {
  34. color: $chat-head-color;
  35. font-size: $message-font-size;
  36. line-height: $line-height-small;
  37. padding: 0.35rem 1rem;
  38. &.badge {
  39. color: $chat-head-text-color;
  40. }
  41. &.chat-state-notification {
  42. font-style: italic;
  43. }
  44. &.chat-event {
  45. clear: left;
  46. font-style: italic;
  47. }
  48. &.chat-error {
  49. color: $warning-color;
  50. font-weight: bold;
  51. }
  52. }
  53. .chat-image {
  54. height: auto;
  55. width: auto;
  56. max-height: 15em;
  57. max-width: 100%;
  58. }
  59. &.chat-msg--action {
  60. font-style: italic;
  61. }
  62. &.chat-msg {
  63. display: flex;
  64. flex-direction: row;
  65. overflow: auto; // Ensures that content stays inside
  66. padding: 0.25rem 1rem;
  67. &.onload {
  68. animation: colorchange-chatmessage 1s;
  69. -webkit-animation: colorchange-chatmessage 1s;
  70. }
  71. &:hover {
  72. background-color: rgba(0, 0, 0, 0.035);
  73. .chat-msg__actions {
  74. .chat-msg__action {
  75. opacity: 1;
  76. }
  77. }
  78. }
  79. &.correcting {
  80. &.groupchat {
  81. background-color: lighten($chatroom-head-color, 30%);
  82. }
  83. &:not(.groupchat) {
  84. background-color: lighten($chat-head-color, 50%);
  85. }
  86. }
  87. .spoiler {
  88. margin-top: 0.5em;
  89. }
  90. .spoiler-hint {
  91. margin-bottom: 0.5em;
  92. }
  93. .spoiler-toggle {
  94. color: white;
  95. i {
  96. color: white;
  97. padding-right: 0.5em;
  98. }
  99. &:before {
  100. padding-right: 0.25em;
  101. whitespace: nowrap;
  102. }
  103. }
  104. .chat-msg__content {
  105. display: flex;
  106. flex-direction: column;
  107. justify-content: space-between;
  108. align-items: stretch;
  109. margin-left: 0.5rem;
  110. width: 100%;
  111. }
  112. .chat-msg__content--action {
  113. margin-left: 0;
  114. }
  115. .chat-msg__body {
  116. display: flex;
  117. flex-direction: row;
  118. justify-content: space-between;
  119. width: 100%;
  120. }
  121. .chat-msg__message {
  122. display: flex;
  123. flex-direction: column;
  124. width: 100%;
  125. }
  126. .chat-msg__edit-modal {
  127. cursor: pointer;
  128. padding-right: 0.5em;
  129. }
  130. &.headline {
  131. .chat-msg__body {
  132. margin-left: 0;
  133. }
  134. }
  135. .chat-msg__text {
  136. padding: 0;
  137. color: $message-text-color;
  138. width: 100%;
  139. white-space: pre-wrap;
  140. a {
  141. word-wrap: break-word;
  142. word-break: break-all;
  143. display: inline-block;
  144. }
  145. img {
  146. &.emoji {
  147. height: 1.5em;
  148. width: 1.5em;
  149. margin: 0 .05em 0 .1em;
  150. vertical-align: -0.1em;
  151. }
  152. }
  153. .emojione {
  154. margin-bottom: -6px;
  155. }
  156. }
  157. .chat-msg__media {
  158. margin-top: 0.25rem;
  159. word-break: break-all;
  160. a {
  161. word-wrap: break-word;
  162. }
  163. audio {
  164. width: 100%;
  165. }
  166. }
  167. .chat-msg__actions {
  168. .chat-msg__action {
  169. height: $message-font-size;
  170. font-size: $message-font-size;
  171. padding: 0;
  172. border: none;
  173. opacity: 0;
  174. background: transparent;
  175. cursor: pointer;
  176. &:focus {
  177. display: block;
  178. }
  179. }
  180. }
  181. .chat-msg__avatar {
  182. margin-top: 0.5em;
  183. height: 36px;
  184. vertical-align: middle;
  185. width: 36px;
  186. }
  187. .chat-msg__heading {
  188. width: 100%;
  189. margin-top: 0.5em;
  190. padding-right: 0.25rem;
  191. padding-bottom: 0.25rem;
  192. display: block;
  193. .chat-msg__author {
  194. overflow: hidden;
  195. text-overflow: ellipsis;
  196. white-space: nowrap;
  197. font-family: $heading-font;
  198. font-size: 115%;
  199. .badge {
  200. font-size: 80%;
  201. font-family: $normal_font;
  202. }
  203. }
  204. .chat-msg__time {
  205. padding-left: 0.25em;
  206. color: lighten($text-color, 15%);
  207. }
  208. }
  209. &.chat-msg--action {
  210. .chat-msg__content {
  211. flex-wrap: wrap;
  212. flex-direction: row;
  213. justify-content: flex-start;
  214. }
  215. .chat-msg__text {
  216. width: auto;
  217. }
  218. .chat-msg__heading {
  219. margin-top: 0;
  220. padding-bottom: 0;
  221. width: auto;
  222. }
  223. .chat-msg__author {
  224. font-size: $message-font-size;
  225. }
  226. .chat-msg__time {
  227. margin-left: 0;
  228. }
  229. }
  230. &.chat-msg--followup {
  231. .chat-msg__heading,
  232. .chat-msg__avatar {
  233. display: none;
  234. }
  235. .chat-msg__content {
  236. margin-left: 2.75rem;
  237. }
  238. }
  239. }
  240. }
  241. .chatroom-body .message {
  242. &.onload {
  243. animation: colorchange-chatmessage-muc 1s;
  244. -webkit-animation: colorchange-chatmessage-muc 1s;
  245. }
  246. .separator {
  247. border: 0.5px solid $chatroom-head-color;
  248. }
  249. }
  250. }
  251. #conversejs.converse-overlayed {
  252. .message {
  253. &.chat-msg {
  254. &.chat-msg--followup {
  255. .chat-msg__content {
  256. margin-left: 0;
  257. }
  258. }
  259. }
  260. }
  261. }
  262. @media screen and (max-width: 767px) {
  263. #conversejs:not(.converse-embedded) {
  264. .message {
  265. &.chat-msg {
  266. .chat-msg__author {
  267. white-space: normal;
  268. }
  269. }
  270. }
  271. }
  272. }