/
topic-post.scss
345 lines (302 loc) · 7.53 KB
/
topic-post.scss
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
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
.placeholder-avatar {
display: inline-block;
background-color: dark-light-diff($primary, $secondary, 90%, -75%);
width: 45px;
height: 45px;
border-radius: 50%;
}
.placeholder-text {
display: inline-block;
background-color: dark-light-diff($primary, $secondary, 90%, -75%);
width: 100%;
height: 1.5em;
margin-bottom: 0.6em;
}
.names {
float: left;
.username {
font-weight: bold;
}
span {
font-size: 0.929em;
padding-right: 8px;
display: inline-block;
max-width: 280px;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
a {
color: dark-light-choose(scale-color($primary, $lightness: 30%), scale-color($secondary, $lightness: 70%));
}
}
.fa {
font-size: 11px;
margin-left: 3px;
color: dark-light-choose(scale-color($primary, $lightness: 40%), scale-color($secondary, $lightness: 60%));
}
.new_user a, .user-title, .user-title a {
color: dark-light-choose(scale-color($primary, $lightness: 50%), scale-color($secondary, $lightness: 50%));
}
}
// global styles for the cooked HTML content in posts (and preview)
.cooked, .d-editor-preview {
word-wrap: break-word;
h1, h2, h3, h4, h5, h6 { margin: 30px 0 10px; }
h1 { line-height: 1em; } /* normalize.css sets h1 font size but not line height */
a { word-wrap: break-word; }
ins { background-color: dark-light-choose(scale-color($success, $lightness: 90%), scale-color($success, $lightness: -60%)); }
del { background-color: dark-light-choose(scale-color($danger, $lightness: 90%), scale-color($danger, $lightness: -60%)); }
}
.cooked, .d-editor-preview {
video {
max-width: 100%;
}
sup sup {
top: 0;
}
}
// we use aside to hold expandable quotes (versus, say, static blockquotes)
aside.quote {
margin-top: 1em;
margin-bottom: 1em;
.badge-wrapper { margin-left: 5px; }
.title {
@include post-aside;
color: dark-light-choose(scale-color($primary, $lightness: 30%), scale-color($secondary, $lightness: 70%));
// IE will screw up the blockquote underneath if bottom padding is 0px
padding: 12px 12px 1px 12px;
// blockquote is underneath this and has top margin
.avatar { margin-right: 7px; }
img { margin-top: -4px; }
@include unselectable;
}
// blockquote is docked within aside for content
blockquote {
margin-top: 0;
}
}
.quote-controls, .quote-controls .back:before, .quote-controls .quote-other-topic:before {
color: dark-light-choose(scale-color($primary, $lightness: 70%), scale-color($secondary, $lightness: 30%));
}
.cooked .highlight {
background-color: dark-light-diff($tertiary, $secondary, 85%, -65%);
padding: 2px;
margin: -2px;
}
.post-action {
.undo-action, .act-action{
margin-left: 5px;
}
}
.post-hidden {
opacity: 0.5;
}
.quote-controls {
float: right;
a {
margin: 0;
}
.back:before, .quote-other-topic:before
{
display: inline-block;
margin-left: 8px;
font-family: "FontAwesome";
position: relative;
z-index: 20;
content: "\f062";
}
.quote-other-topic:before
{
content: "\f061";
}
}
.quote-button {
display: none;
position: absolute;
background-color: dark-light-diff($primary, $secondary, 50%, -50%);
color: dark-light-choose($secondary, $primary);
padding: 10px;
z-index: 401;
&:before {
font-family: "FontAwesome";
content: "\f10e\00a0\00a0";
}
&:hover {
background-color: dark-light-diff($primary, $secondary, 40%, -40%);
cursor: pointer;
}
}
.topic-avatar .poster-avatar-extra {
display: none;
}
.topic-body {
&.highlighted {
background-color: dark-light-diff($tertiary, $secondary, 85%, -65%);
}
}
// this ensures consistent top margin on topic posts even if the first line of a post
// is a top-margin-less element like a list or image.
.topic-body .regular {
margin-top: 15px;
}
.post-info {
&.wiki, &.via-email, &.whisper {
margin-right: 5px;
i.fa {
font-size: 1em;
}
}
&.wiki {
cursor: pointer;
color: #408040;
}
&.via-email {
color: dark-light-choose(scale-color($primary, $lightness: 70%), scale-color($secondary, $lightness: 30%));
}
&.raw-email {
cursor: pointer;
}
}
pre {
code {
word-wrap: normal;
display: block;
padding: 5px 10px;
color: $primary;
background: blend-primary-secondary(5%);
max-height: 500px;
}
}
kbd
{
background-color: $secondary;
border: 1px solid dark-light-diff($primary, $secondary, 90%, -60%);
border-radius: 3px;
box-shadow: 0 1px 0 rgba(0,0,0, .8);
color: $primary;
display: inline-block;
font-size: 0.857em;
line-height: 1.4;
margin: 0 .1em;
padding: .1em .6em;
// don't allow more than 3 nested elements to prevent FF from crashing
// cf. http://what.thedailywtf.com/t/nested-elements/7927
// 3 levels are needed to prevent highlighted words being hidden
// cf. https://meta.discourse.org/t/word-disappears-when-searched-and-in-details-summary-kbd-b/25741
* * * { display: none; }
}
// we assume blockquotes have their own margins, so all blockquotes
// will remove margins from first (top) and last (bottom) child elements
blockquote > *:first-child {
margin-top: 0 !important;
}
blockquote > *:last-child {
margin-bottom: 0 !important;
}
.gap {
background-color: dark-light-diff($primary, $secondary, 90%, -60%);
padding: 5px 0;
color: dark-light-choose(scale-color($primary, $lightness: 60%), scale-color($secondary, $lightness: 40%));
cursor: pointer;
text-align: center;
&.jagged-border {
background-image:
linear-gradient(
135deg,
$secondary 50%, rgba(255,255,255,0) 50%
),
linear-gradient(
-135deg,
$secondary 50%, rgba(255,255,255,0) 50%
),
linear-gradient(
45deg,
$secondary 50%, rgba(255,255,255,0) 50%
),
linear-gradient(
-45deg,
$secondary 50%, rgba(255,255,255,0) 50%
);
background-position:
top center, top center,
bottom center, bottom center;
background-size: .9em .9em;
background-repeat: repeat-x;
padding: 20px 0;
margin-bottom: 20px;
}
}
.who-liked {
transition: height 0.5s;
a {
margin: 0 0.25em 0.5em 0;
display: inline-block;
}
}
table.md-table {
thead {
border-bottom: 2px solid lighten($primary, 80%);
th {
text-align: left;
padding-bottom: 2px;
}
}
td,th {
padding: 3px 3px 3px 10px;
}
tr {
border-bottom: 1px solid lighten($primary, 80%);
}
}
.small-action {
.topic-avatar {
padding: 5px 0;
border-top: none;
float: left;
i {
font-size: 35px;
width: 45px;
text-align: center;
color: dark-light-choose(scale-color($primary, $lightness: 75%), scale-color($secondary, $lightness: 25%));
}
}
.small-action-desc {
padding: 0.5em 0 0.5em 4em;
margin-top: 5px;
text-transform: uppercase;
font-weight: bold;
font-size: 0.9em;
color: dark-light-choose(scale-color($primary, $lightness: 75%), scale-color($secondary, $lightness: 25%));
.custom-message {
text-transform: none;
margin: 15px 0px 5px;
font-weight: normal;
font-size: 14px;
p {
margin: 5px 0;
}
}
.avatar {
margin-right: 0.8em;
float: left;
}
> p {
margin: 0;
padding-top: 4px;
}
}
button {
background: transparent;
border: 0;
float: right;
}
clear: both;
}
.whisper {
.topic-body {
.cooked {
font-style: italic;
color: dark-light-diff($primary, $secondary, 55%, -40%);
}
}
}