UNPKG

11.4 kBSCSSView Raw
1.str-chat__message-commerce {
2 display: flex; /* inline-flex if you don't want the */
3 justify-content: flex-start;
4 align-items: flex-end;
5 padding: 0 0 0 0;
6 position: relative;
7 margin: 1px 0;
8 &-inner {
9 position: relative;
10 /* flex: 1 if you want the messagebubbles to be the same width- */
11 > .str-chat__message-commerce__actions {
12 min-height: 10px;
13 min-width: 30px;
14 float: right;
15 .str-chat__reaction-list {
16 left: unset;
17 right: 46px;
18 }
19 }
20 }
21
22 .str-chat__avatar {
23 margin-right: 8px;
24 }
25
26 .str-chat__message-attachment {
27 &-card {
28 &--content {
29 margin: 0;
30 padding: 6px 8px;
31 }
32 }
33 }
34
35 &--top,
36 &--middle {
37 margin-left: 40px;
38
39 .str-chat__message-commerce {
40 &-data {
41 display: none;
42 }
43 }
44 }
45
46 &--top {
47 .str-chat__message-commerce {
48 &-text {
49 &-inner {
50 border-radius: 16px 16px 4px 4px;
51 }
52 }
53 }
54 }
55
56 &--bottom {
57 .str-chat__message-commerce {
58 &-text {
59 &-inner {
60 border-radius: 4px 4px 16px 0;
61 }
62 }
63 }
64 }
65
66 &--single {
67 .str-chat__message-commerce {
68 &-text {
69 &-inner {
70 border-radius: 16px 16px 16px 0;
71 &--has-attachment {
72 border-radius: 4px 4px 16px 0;
73 }
74 }
75 }
76 }
77 }
78
79 &--middle {
80 .str-chat__message-commerce {
81 &-text {
82 &-inner {
83 border-radius: 4px 4px 4px 4px;
84 }
85 }
86 }
87 }
88
89 &-text {
90 display: flex;
91
92 padding: 0 0 0 0;
93 position: relative;
94
95 &-inner {
96 position: relative;
97 display: block;
98 min-height: 32px;
99 padding: 5px 10px;
100 font-size: var(--lg-font); /* variables */
101 color: black; /* variables */
102 border-radius: var(--border-radius) var(--border-radius) var(--border-radius) 0;
103 background: #fff;
104 border: 1px solid var(--border-color);
105
106 margin-left: 0;
107 max-width: 345px;
108 p {
109 margin: 0;
110 white-space: pre-line;
111 &:not(:first-of-type) {
112 margin: 16px 0 0;
113 }
114
115 /* These are technically the same, but use both */
116 overflow-wrap: break-word;
117 word-wrap: break-word;
118 -ms-word-break: break-all;
119 /* Instead use this non-standard one: */
120 word-break: break-word;
121
122 /* Adds a hyphen where the word breaks, if supported (No Blink) */
123 -ms-hyphens: auto;
124 -moz-hyphens: auto;
125 -webkit-hyphens: auto;
126 hyphens: auto;
127 }
128
129 &--has-attachment {
130 border-radius: 2px var(--border-radius) var(--border-radius) 2px;
131 }
132
133 &--is-emoji {
134 background: transparent;
135 border: 1px solid transparent;
136 font-size: 32px;
137 line-height: 48px;
138 padding-left: 0;
139 padding-right: 0;
140 }
141 }
142 }
143
144 &-attachment {
145 &--img {
146 width: 100%;
147 max-width: 480px;
148 display: block;
149 height: inherit;
150 cursor: -moz-zoom-in;
151 cursor: -webkit-zoom-in;
152 cursor: zoom-in;
153 }
154 }
155
156 &-data {
157 margin-top: 5px;
158 width: 100%;
159 font-size: var(--xs-font);
160 color: rgba(0, 0, 0, 0.5);
161 }
162
163 &-name {
164 font-weight: var(--font-weight-bold);
165 margin-right: 5px;
166 }
167
168 p {
169 margin: 0;
170 line-height: 20px;
171 }
172
173 &--with-reactions {
174 margin-top: 30px;
175 .str-chat__message-commerce__actions__action--reactions {
176 display: none;
177 }
178 }
179
180 &-link {
181 color: var(--primary-color);
182 font-weight: var(--font-weight-bold);
183 text-decoration: none;
184 }
185
186 &--inner {
187 display: flex;
188 flex-direction: column;
189 align-items: flex-start;
190 }
191
192 /* deleted messages */
193 &--deleted {
194 background: var(--grey);
195 float: left;
196 padding: 8px 16px;
197 border-radius: var(--border-radius);
198 font-size: var(--sm-font);
199 color: var(--darken-grey);
200 margin: 0 0 0 42px;
201 }
202
203 /* error messages */
204 &--error {
205 margin: 0 0 32px 0;
206 font-size: var(--sm-font);
207
208 .str-chat__message-text-inner {
209 background: rgba(208, 2, 27, 0.1);
210 border: 1px solid rgba(208, 2, 27, 0.1);
211 }
212 }
213
214 &--right {
215 &.str-chat__message-commerce {
216 justify-content: flex-end;
217 margin-left: 0;
218 .str-chat__message-commerce__actions {
219 justify-content: flex-end;
220 }
221 .str-chat__message-commerce {
222 &-inner {
223 > .str-chat__message-commerce__actions {
224 float: left;
225 .str-chat__reaction-list {
226 left: 46px;
227 }
228 }
229 > .str-chat__message-commerce-reply-button {
230 display: flex;
231 justify-content: flex-end;
232 .str-chat__message-replies-count-button {
233 display: flex;
234 flex-direction: row-reverse;
235 svg {
236 transform: scaleX(-1);
237 margin-left: 5px;
238 margin-bottom: 4px;
239 margin-right: 0;
240 }
241 }
242 }
243 }
244 }
245
246 .str-chat__message-commerce-text-inner {
247 background: #ebebeb;
248 border-width: 0px;
249 margin-top: 2px;
250 border-color: transparent;
251 p {
252 text-align: right;
253 }
254 }
255 > .str-chat__avatar {
256 display: none;
257 }
258
259 .str-chat__message-attachment {
260 margin: 0 auto 0 30px;
261 &--img {
262 border-radius: var(--border-radius) var(--border-radius) 2px var(--border-radius);
263 }
264 }
265 .str-chat__message-attachment-card {
266 border-radius: 16px 16px 4px 16px;
267 }
268
269 &--bottom,
270 &--single {
271 margin-right: 0;
272 }
273 &--single {
274 .str-chat__message-commerce {
275 &-text {
276 &-inner {
277 border-radius: 16px 16px 4px 16px;
278 &--has-attachment {
279 border-radius: 16px 4px 4px 16px;
280 }
281 }
282 }
283 }
284 }
285 &--bottom {
286 .str-chat__message-commerce {
287 &-text {
288 &-inner {
289 border-radius: 4px 4px 4px 16px;
290 }
291 }
292 }
293 }
294 .str-chat__avatar {
295 order: 1;
296 }
297 .str-chat__message-commerce-text {
298 flex-direction: row-reverse;
299 justify-content: flex-start;
300 &-inner {
301 flex: unset;
302 }
303 }
304 .str-chat__message-commerce-data {
305 text-align: right;
306 }
307 }
308 }
309
310 &--has-text {
311 .str-chat__message-commerce {
312 &-inner {
313 .str-chat__message-attachment {
314 width: 100%;
315 height: auto;
316 margin: 4px auto;
317 }
318 }
319 }
320 }
321}
322
323.str-chat {
324 &__message-commerce {
325 font-family: var(--second-font);
326 &__actions {
327 display: flex;
328 margin-top: 5px;
329 align-items: flex-start;
330 justify-content: flex-start;
331 min-width: 30px;
332
333 &__action {
334 margin: 5px;
335 display: flex;
336 align-items: center;
337 height: 10px;
338 cursor: pointer;
339 svg {
340 fill: #000;
341 opacity: 0.5;
342 }
343 &:hover {
344 svg {
345 opacity: 1;
346 }
347 }
348 &--thread,
349 &--reactions {
350 display: none;
351 }
352 &--options {
353 position: relative;
354 display: none;
355 .str-chat__message-actions-box {
356 bottom: 10px;
357 left: unset;
358 right: 100%;
359 width: 120px;
360 border-radius: 16px 16px 2px 16px;
361 }
362 }
363 }
364 }
365
366 &:hover {
367 .str-chat__message-commerce__actions__action--thread {
368 display: flex;
369 }
370 .str-chat__message-commerce__actions__action--reactions {
371 display: flex;
372 }
373 }
374
375 &-text {
376 display: flex;
377 padding: 0 0 0 0;
378 position: relative;
379 }
380
381 &-text-inner {
382 text-align: left;
383
384 &.str-chat__message-commerce-text-inner--is-emoji {
385 margin: 5px 0;
386 background: transparent;
387 }
388
389 p {
390 text-align: left;
391 }
392 a {
393 color: var(--secondary-color);
394 font-weight: var(--font-weight-bold);
395 text-decoration: none;
396 }
397 blockquote {
398 margin: 0 0 0 5px;
399 font-style: italic;
400 padding-left: 20px;
401 position: relative;
402
403 &::before {
404 font-size: var(--xxl-font);
405 content: '\201C';
406 font-style: italic;
407 position: absolute;
408 opacity: 0.5;
409 top: 2px;
410 left: -5px;
411 }
412 }
413 }
414
415 &:hover {
416 .str-chat__message-commerce__actions__action--options {
417 display: flex;
418 }
419 .str-chat__message-commerce__actions__action--reactions {
420 display: flex;
421 }
422 .str-chat__message-commerce__actions__action--thread {
423 display: flex;
424 }
425 }
426 }
427}
428
429.str-chat__commerce-message--error-message {
430 text-align: left;
431 text-transform: uppercase;
432 font-size: var(--xs-font);
433 opacity: 0.5;
434}
435
436.str-chat__message-commerce-status {
437 margin: 10px 0px 10px 10px;
438 order: 3;
439 position: absolute;
440 left: 100%;
441 bottom: 0;
442 line-height: 1;
443 display: flex;
444 justify-content: flex-end;
445 align-items: center;
446 z-index: 11;
447 &-number {
448 font-size: var(--xs-font);
449 margin-left: 4px;
450 position: absolute;
451 left: 100%;
452 color: rgba(0, 0, 0, 0.6);
453 }
454
455 > .str-chat__avatar {
456 align-self: flex-end;
457 margin-right: 0;
458 }
459
460 > .str-chat__tooltip {
461 display: none;
462 max-width: 300px;
463 min-width: 100px;
464 text-align: center;
465 }
466
467 &:hover {
468 > .str-chat__tooltip {
469 display: block;
470 }
471 }
472
473 &::after {
474 position: absolute;
475 bottom: 100%;
476 right: 0;
477 content: ' ';
478 width: 15px;
479 height: 15px;
480 }
481}
482
483.str-chat__message-commerce {
484 .str-chat__message-attachment {
485 width: calc(100% - 30px);
486 max-width: unset;
487 border-radius: unset;
488 margin: 0 auto 0 0;
489 }
490 .str-chat__message-attachment-card {
491 margin: 0;
492 border-radius: 4px var(--border-radius) 4px 4px;
493 background: #fff;
494 border: 1px solid rgba(0, 0, 0, 0.08);
495
496 &--content {
497 background: #ebebeb;
498 }
499
500 &--text {
501 display: none;
502 }
503 }
504}
505
506.str-chat__list--thread {
507 .str-chat__message-commerce {
508 &__actions {
509 width: 30px;
510 }
511 &__actions__action--options {
512 .str-chat__message-actions-box {
513 right: unset;
514 left: 100%;
515 border-radius: var(--border-radius) var(--border-radius) var(--border-radius) 2px;
516 }
517 }
518 }
519}
520
521.str-chat.dark {
522 .str-chat__message-commerce {
523 &-data {
524 color: white;
525 opacity: 0.5;
526 }
527 &-text-inner {
528 background: rgba(255, 255, 255, 0.05);
529 color: white;
530 }
531 &__actions {
532 svg {
533 fill: white;
534 }
535 }
536
537 .str-chat__message-attachment-card {
538 background: rgba(0, 0, 0, 0.2);
539 &--content {
540 background: rgba(0, 0, 0, 0.2);
541 }
542 &--title {
543 color: white;
544 }
545 &--url {
546 color: rgba(255, 255, 255, 0.5);
547 }
548 }
549
550 &--right {
551 .str-chat__message-commerce {
552 &-text-inner {
553 background: rgba(0, 0, 0, 0.2);
554 }
555 .str-chat__message-attachment-card {
556 background: rgba(0, 0, 0, 0.2);
557 &--content {
558 background: rgba(0, 0, 0, 0.2);
559 }
560 }
561 }
562 }
563 }
564}