2
0

_messages.scss 9.0 KB

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