Skip to content

Commit dd10e01

Browse files
committed
(refactor) move menu css in separate file
1 parent c3a8a21 commit dd10e01

File tree

4 files changed

+65
-125
lines changed

4 files changed

+65
-125
lines changed

src/ChatWindow/ChatMessage.vue

Lines changed: 1 addition & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,7 @@ export default {
267267
const optionsTopPosition =
268268
roomFooterTop - actionIconTop > menuOptionsHeight + 50
269269
270-
if (optionsTopPosition) this.menuOptionsHeight = 28
270+
if (optionsTopPosition) this.menuOptionsHeight = 30
271271
else this.menuOptionsHeight = -menuOptionsHeight
272272
}, 0)
273273
},
@@ -495,73 +495,13 @@ export default {
495495
}
496496
497497
.menu-options {
498-
position: absolute;
499498
right: 15px;
500-
top: 28px;
501-
z-index: 9999;
502-
min-width: 150px;
503-
display: inline-block;
504-
border-radius: 4px;
505-
max-width: 80%;
506-
font-size: 15px;
507-
overflow-y: auto;
508-
overflow-x: hidden;
509-
contain: content;
510-
box-shadow: 0 5px 5px -3px rgba(0, 0, 0, 0.2),
511-
0 8px 10px 1px rgba(0, 0, 0, 0.14), 0 3px 14px 2px rgba(0, 0, 0, 0.12);
512499
}
513500
514501
.menu-left {
515502
right: -118px;
516503
}
517504
518-
.menu-list {
519-
border-radius: 4px;
520-
display: block;
521-
cursor: pointer;
522-
background: var(--chat-bg-menu);
523-
524-
:hover {
525-
background: var(--chat-bg-menu-hover);
526-
-webkit-transition: background-color 0.3s cubic-bezier(0.25, 0.8, 0.5, 1);
527-
transition: background-color 0.3s cubic-bezier(0.25, 0.8, 0.5, 1);
528-
}
529-
530-
:not(:hover) {
531-
-webkit-transition: background-color 0.3s cubic-bezier(0.25, 0.8, 0.5, 1);
532-
transition: background-color 0.3s cubic-bezier(0.25, 0.8, 0.5, 1);
533-
}
534-
}
535-
536-
.menu-item {
537-
-webkit-box-align: center;
538-
-ms-flex-align: center;
539-
align-items: center;
540-
display: -webkit-box;
541-
display: -ms-flexbox;
542-
display: flex;
543-
-webkit-box-flex: 1;
544-
-ms-flex: 1 1 100%;
545-
flex: 1 1 100%;
546-
min-height: 30px;
547-
padding: 8px 16px;
548-
position: relative;
549-
}
550-
551-
.menu-divider {
552-
display: block;
553-
-webkit-box-flex: 1;
554-
-ms-flex: 1 1 0px;
555-
flex: 1 1 0px;
556-
max-width: 100%;
557-
height: 0;
558-
max-height: 0;
559-
border: solid;
560-
border-width: thin 0 0 0;
561-
border-color: rgba(0, 0, 0, 0.12);
562-
margin: 0;
563-
}
564-
565505
.icon-check {
566506
height: 14px;
567507
width: 14px;

src/ChatWindow/MessagesList.vue

Lines changed: 0 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -442,70 +442,6 @@ export default {
442442
margin-left: auto;
443443
}
444444
445-
.menu-options {
446-
position: absolute;
447-
right: 10px;
448-
top: 20px;
449-
z-index: 9999;
450-
min-width: 150px;
451-
display: inline-block;
452-
border-radius: 4px;
453-
max-width: 80%;
454-
font-size: 15px;
455-
overflow-y: auto;
456-
overflow-x: hidden;
457-
contain: content;
458-
box-shadow: 0 5px 5px -3px rgba(0, 0, 0, 0.2),
459-
0 8px 10px 1px rgba(0, 0, 0, 0.14), 0 3px 14px 2px rgba(0, 0, 0, 0.12);
460-
}
461-
462-
.menu-list {
463-
border-radius: 4px;
464-
display: block;
465-
cursor: pointer;
466-
background: var(--chat-bg-menu);
467-
468-
:hover {
469-
background: var(--chat-bg-menu-hover);
470-
-webkit-transition: background-color 0.3s cubic-bezier(0.25, 0.8, 0.5, 1);
471-
transition: background-color 0.3s cubic-bezier(0.25, 0.8, 0.5, 1);
472-
}
473-
474-
:not(:hover) {
475-
-webkit-transition: background-color 0.3s cubic-bezier(0.25, 0.8, 0.5, 1);
476-
transition: background-color 0.3s cubic-bezier(0.25, 0.8, 0.5, 1);
477-
}
478-
}
479-
480-
.menu-item {
481-
-webkit-box-align: center;
482-
-ms-flex-align: center;
483-
align-items: center;
484-
display: -webkit-box;
485-
display: -ms-flexbox;
486-
display: flex;
487-
-webkit-box-flex: 1;
488-
-ms-flex: 1 1 100%;
489-
flex: 1 1 100%;
490-
min-height: 35px;
491-
padding: 8px 16px;
492-
position: relative;
493-
}
494-
495-
.menu-divider {
496-
display: block;
497-
-webkit-box-flex: 1;
498-
-ms-flex: 1 1 0px;
499-
flex: 1 1 0px;
500-
max-width: 100%;
501-
height: 0;
502-
max-height: 0;
503-
border: solid;
504-
border-width: thin 0 0 0;
505-
border-color: rgba(0, 0, 0, 0.12);
506-
margin: 0;
507-
}
508-
509445
.container-scroll {
510446
background: var(--chat-bg-color-content);
511447
height: calc(100% - 120px);

src/styles/index.scss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
@import 'animation';
2+
@import 'menu';

src/styles/menu.scss

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
.menu-list {
2+
border-radius: 4px;
3+
display: block;
4+
cursor: pointer;
5+
background: var(--chat-bg-menu);
6+
7+
:hover {
8+
background: var(--chat-bg-menu-hover);
9+
-webkit-transition: background-color 0.3s cubic-bezier(0.25, 0.8, 0.5, 1);
10+
transition: background-color 0.3s cubic-bezier(0.25, 0.8, 0.5, 1);
11+
}
12+
13+
:not(:hover) {
14+
-webkit-transition: background-color 0.3s cubic-bezier(0.25, 0.8, 0.5, 1);
15+
transition: background-color 0.3s cubic-bezier(0.25, 0.8, 0.5, 1);
16+
}
17+
}
18+
19+
.menu-item {
20+
-webkit-box-align: center;
21+
-ms-flex-align: center;
22+
align-items: center;
23+
display: -webkit-box;
24+
display: -ms-flexbox;
25+
display: flex;
26+
-webkit-box-flex: 1;
27+
-ms-flex: 1 1 100%;
28+
flex: 1 1 100%;
29+
min-height: 30px;
30+
padding: 8px 16px;
31+
position: relative;
32+
}
33+
34+
.menu-divider {
35+
display: block;
36+
-webkit-box-flex: 1;
37+
-ms-flex: 1 1 0px;
38+
flex: 1 1 0px;
39+
max-width: 100%;
40+
height: 0;
41+
max-height: 0;
42+
border: solid;
43+
border-width: thin 0 0 0;
44+
border-color: rgba(0, 0, 0, 0.12);
45+
margin: 0;
46+
}
47+
48+
.menu-options {
49+
position: absolute;
50+
right: 10px;
51+
top: 20px;
52+
z-index: 9999;
53+
min-width: 150px;
54+
display: inline-block;
55+
border-radius: 4px;
56+
max-width: 80%;
57+
font-size: 15px;
58+
overflow-y: auto;
59+
overflow-x: hidden;
60+
contain: content;
61+
box-shadow: 0 5px 5px -3px rgba(0, 0, 0, 0.2),
62+
0 8px 10px 1px rgba(0, 0, 0, 0.14), 0 3px 14px 2px rgba(0, 0, 0, 0.12);
63+
}

0 commit comments

Comments
 (0)