chat.scss 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165
  1. :root {
  2. --chat-bg: var(--neutral-80);
  3. --chat-color: var(--white);
  4. --chat-instructions-color: var(--neutral-20);
  5. --chat-new-message-bg: var(--neutral-70);
  6. --chat-new-message-textarea-color: var(--neutral-90);
  7. --chat-new-message-textarea-bg: var(--neutral-20);
  8. --chat-message-date-color: var(--neutral-40);
  9. --chat-message-name-color: var(--white);
  10. }
  11. @include theme('light') {
  12. --chat-bg: var(--white);
  13. --chat-color: var(--neutral-70);
  14. --chat-instructions-color: var(--neutral-70);
  15. --chat-new-message-bg: var(--neutral-10);
  16. --chat-new-message-textarea-color: var(--neutral-90);
  17. --chat-new-message-textarea-bg: var(--white);
  18. --chat-message-date-color: var(--neutral-70);
  19. --chat-message-name-color: var(--neutral-70);
  20. }
  21. .chat {
  22. $new-message-height: 80px;
  23. color: var(--chat-color);
  24. .no-messages {
  25. padding: calc(var(--line-height-03) / 2);
  26. color: var(--chat-instructions-color);
  27. }
  28. .first-message {
  29. position: absolute;
  30. bottom: 0;
  31. width: 100%;
  32. padding: calc(var(--line-height-03) / 2);
  33. color: var(--chat-instructions-color);
  34. }
  35. .chat-error {
  36. position: absolute;
  37. top: 0;
  38. bottom: 0;
  39. background-color: var(--chat-bg);
  40. padding: calc(var(--line-height-03) / 2);
  41. text-align: center;
  42. }
  43. .messages {
  44. position: absolute;
  45. inset: 0;
  46. bottom: $new-message-height;
  47. overflow-x: hidden;
  48. background-color: var(--chat-bg);
  49. li.message {
  50. margin: calc(var(--line-height-03) / 2);
  51. .date {
  52. font-size: var(--font-size-01);
  53. color: var(--chat-message-date-color);
  54. margin-bottom: calc(var(--line-height-03) / 2);
  55. text-align: right;
  56. }
  57. .message-wrapper {
  58. .name {
  59. font-size: var(--font-size-01);
  60. color: var(--chat-message-name-color);
  61. margin-bottom: var(--spacing-02);
  62. min-height: 16px;
  63. }
  64. .message {
  65. border-left: 3px solid transparent;
  66. font-size: var(--font-size-02);
  67. box-shadow: none;
  68. border-radius: var(--border-radius-base);
  69. position: relative;
  70. .message-content {
  71. padding: var(--spacing-03) var(--spacing-05);
  72. overflow-x: auto;
  73. color: var(--white);
  74. font-weight: bold;
  75. a {
  76. color: var(--white);
  77. }
  78. }
  79. .arrow {
  80. transform: rotate(90deg);
  81. right: 90%;
  82. top: -15px;
  83. border: solid;
  84. content: ' ';
  85. height: 0;
  86. width: 0;
  87. position: absolute;
  88. pointer-events: none;
  89. border-top-color: transparent !important;
  90. border-bottom-color: transparent !important;
  91. border-width: 10px;
  92. }
  93. }
  94. p {
  95. margin-bottom: calc(var(--line-height-03) / 4);
  96. &:last-child {
  97. margin-bottom: 0;
  98. }
  99. }
  100. }
  101. &:not(.self) {
  102. .message {
  103. .arrow {
  104. border-left-color: transparent !important;
  105. }
  106. }
  107. }
  108. &.self {
  109. margin-top: var(--line-height-03);
  110. .message-wrapper .message {
  111. border-left: none;
  112. border-right: 3px solid transparent;
  113. .arrow {
  114. left: 100%;
  115. right: auto;
  116. border-right-color: transparent !important;
  117. }
  118. }
  119. }
  120. }
  121. }
  122. .new-message {
  123. @extend .full-size;
  124. top: auto;
  125. height: $new-message-height;
  126. background-color: var(--chat-new-message-bg);
  127. padding: calc(var(--line-height-03) / 4);
  128. border-top: 1px solid var(--editor-border-color);
  129. textarea {
  130. overflow: auto;
  131. resize: none;
  132. border-radius: var(--border-radius-base);
  133. border: 1px solid var(--editor-border-color);
  134. height: 100%;
  135. width: 100%;
  136. color: var(--chat-new-message-textarea-color);
  137. font-size: var(--font-size-02);
  138. padding: calc(var(--line-height-03) / 4);
  139. background-color: var(--chat-new-message-textarea-bg);
  140. }
  141. }
  142. }