-
Notifications
You must be signed in to change notification settings - Fork 1
/
SocialTextArea.css
166 lines (149 loc) · 4.03 KB
/
SocialTextArea.css
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
@import "emoji-mart-virtualized/css/emoji-mart.css";
.social-text-area {
/* TwemojiMozilla for fixing emoji flags on windows/chrome : https://github.com/missive/emoji-mart/issues/451#issuecomment-731150895
Also: https://prinsfrank.nl/2021/01/25/Non-existing-flag-emojis-on-windows */
--emoji-font: "TwemojiMozilla", "Segoe UI Emoji", "Segoe UI Symbol", "Segoe UI", "Noto Color Emoji", "Android Emoji";
--editor-bg-color: whitesmoke;
}
.social-text-area__emoji-popper .emoji-mart-emoji-native {
/* Cannot use --emoji-font because this is not under .social-text-area */
font-family: "TwemojiMozilla", "Segoe UI Emoji", "Segoe UI Symbol", "Segoe UI", "Noto Color Emoji", "Android Emoji";
}
.social-text-area .editor {
box-sizing: border-box;
border: none;
cursor: text;
border-radius: 2px;
width: 100%;
border-radius: 3px;
background-color: var(--editor-bg-color);
}
.social-text-area .editor:focus-within {
outline: 1px solid gray;
}
.social-text-area .mentionInputRoot {
height: auto;
min-height: 100px;
}
/* The entire control, containing the text area and the rendered mentions */
.social-text-area .mentionInputRoot__control,
.social-text-area .mentionInputRoot__input {
font-family: var(--emoji-font);
line-height: 1.5;
height: 100%;
padding: 9px;
}
/* The actual textearea */
.social-text-area .mentionInputRoot__input {
border: none;
}
.social-text-area .mentionInputRoot__input:focus-visible {
outline: none;
}
/* The overlay for showing mentions */
.social-text-area .mentionInputRoot .mentionInputRoot__highlighter {
overflow: visible;
}
.social-text-area .mentionInputRoot .mentionInputRoot__suggestions {
margin-top: 30px !important;
}
/* The suggestion list */
.social-text-area .mentionInputRoot .mentionInputRoot__suggestions__list {
box-shadow: none;
border: 1px solid lightgray;
max-height: 300px;
overflow: auto;
-ms-overflow-style: none;
scrollbar-width: none;
}
.social-text-area .mentionInputRoot .mentionInputRoot__suggestions__list::-webkit-scrollbar {
display: none;
}
/* A single item in the suggestion list */
.social-text-area .mentionInputRoot .mentionInputRoot__suggestions__item {
padding: 10px;
border-bottom: 1px solid rgba(0, 0, 0, 0.15);
display: flex;
align-items: center;
gap: 8px;
}
.social-text-area .mentionInputRoot .mentionInputRoot__suggestions__item--focused {
background: whitesmoke;
}
/*
* Mentions
*/
.social-text-area .social-text-area__mention {
background: dodgerblue;
padding: 2px;
margin-left: -3px;
border-radius: 3px;
position: relative;
z-index: 1;
pointer-events: none;
color: white;
}
/*
* Emojis
*/
.social-text-area .social-text-area__emoji-popper {
z-index: 100;
margin-top: 20;
}
.social-text-area .social-text-area__emoji-popper-arrow {
position: absolute;
width: 16px;
height: 16px;
z-index: -1;
top: -8px;
}
.social-text-area .social-text-area__emoji-popper-arrow:before {
position: absolute;
width: 16px;
height: 16px;
z-index: -1;
content: "";
transform: rotate(45deg);
background: "white";
border: "1px solid black";
}
.social-text-area .social-text-area__emoji-button {
border: none;
background: none;
cursor: pointer;
font-size: 16px;
padding: 0;
}
.social-text-area__emoji-suggestion {
width: 30px;
font-family: var(--emoji-font);
}
/*
* Links
*/
.social-text-area .social-text-area__link {
text-decoration: underline;
color: blue;
background: var(--editor-bg-color);
position: relative;
z-index: 1;
padding: 2px;
margin-left: -3px;
border-radius: 3px;
top: -2px;
cursor: default;
}
.social-text-area .link-preview__media {
background-size: contain;
max-height: 250px;
}
.social-text-area .link-preview__title {
-webkit-line-clamp: 2;
overflow: hidden;
display: -webkit-box;
-webkit-box-orient: vertical;
}
.social-text-area .link-preview__description {
overflow: hidden;
text-overflow: ellipsis;
}