|
47 | 47 | commentsHeading.textContent = 'Comments & Feedback'; |
48 | 48 | commentsHeading.id = 'comments'; |
49 | 49 |
|
50 | | - // Add some spacing |
51 | | - const spacer = document.createElement('div'); |
52 | | - spacer.style.marginBottom = '2rem'; |
53 | | - |
54 | 50 | // Insert the comments section |
55 | 51 | insertPoint.appendChild(commentsHeading); |
56 | | - insertPoint.appendChild(spacer); |
57 | 52 | insertPoint.appendChild(cusdisContainer); |
58 | 53 | insertPoint.appendChild(cusdisScript); |
59 | 54 |
|
|
105 | 100 | style.textContent = ` |
106 | 101 | /* Main comments container */ |
107 | 102 | #cusdis_thread { |
108 | | - margin-top: 3rem; |
109 | | - padding-top: 2rem; |
110 | | - border-top: 1px solid var(--md-default-fg-color--lightest); |
| 103 | + margin-top: 1rem; |
| 104 | + padding-top: 0; |
| 105 | + border-top: none; |
111 | 106 | font-family: var(--md-text-font-family); |
112 | 107 | font-size: var(--md-typeset-font-size); |
113 | 108 | line-height: var(--md-typeset-line-height); |
| 109 | + max-height: none !important; |
| 110 | + overflow: visible !important; |
| 111 | + height: auto !important; |
114 | 112 | } |
115 | 113 | |
116 | 114 | /* Comments list styling */ |
117 | 115 | #cusdis_thread .cusdis-comments { |
118 | 116 | font-family: var(--md-text-font-family); |
119 | 117 | color: var(--md-default-fg-color); |
| 118 | + max-height: none !important; |
| 119 | + overflow: visible !important; |
| 120 | + } |
| 121 | + |
| 122 | + /* Individual comment styling */ |
| 123 | + #cusdis_thread .cusdis-comment { |
| 124 | + border: 1px solid var(--md-default-fg-color--lightest); |
| 125 | + border-radius: 8px; |
| 126 | + margin-bottom: 1.5rem; |
| 127 | + padding: 1.5rem; |
| 128 | + background: var(--md-default-bg-color); |
| 129 | + box-shadow: 0 1px 3px rgba(0,0,0,0.1); |
| 130 | + transition: box-shadow 0.2s ease; |
| 131 | + max-height: none !important; |
| 132 | + overflow: visible !important; |
120 | 133 | } |
121 | 134 | |
122 | 135 | /* Individual comment styling */ |
|
195 | 208 | line-height: 1.5 !important; |
196 | 209 | transition: all 0.2s ease !important; |
197 | 210 | box-sizing: border-box !important; |
| 211 | + min-height: 120px !important; |
| 212 | + resize: vertical !important; |
| 213 | + } |
| 214 | + |
| 215 | + /* Fix height constraints on all Cusdis containers */ |
| 216 | + #cusdis_thread * { |
| 217 | + max-height: none !important; |
| 218 | + overflow: visible !important; |
| 219 | + } |
| 220 | + |
| 221 | + /* Specific height fixes for common Cusdis elements */ |
| 222 | + #cusdis_thread .cusdis-comment-form, |
| 223 | + #cusdis_thread .cusdis-comments, |
| 224 | + #cusdis_thread .cusdis-comment, |
| 225 | + #cusdis_thread .cusdis-loading, |
| 226 | + #cusdis_thread .cusdis-error { |
| 227 | + max-height: none !important; |
| 228 | + overflow: visible !important; |
| 229 | + height: auto !important; |
| 230 | + } |
| 231 | + |
| 232 | + /* Ensure textarea has proper height */ |
| 233 | + #cusdis_thread .cusdis-comment-form textarea { |
| 234 | + min-height: 120px !important; |
| 235 | + max-height: none !important; |
| 236 | + overflow-y: auto !important; |
| 237 | + resize: vertical !important; |
198 | 238 | } |
199 | 239 | |
200 | 240 | #cusdis_thread .cusdis-comment-form textarea:focus, |
|
278 | 318 | border-color: var(--md-primary-fg-color); |
279 | 319 | } |
280 | 320 | |
281 | | - /* Reaction buttons styling */ |
282 | | - #cusdis_thread .cusdis-reaction { |
| 321 | + /* Reaction buttons styling - more specific selectors */ |
| 322 | + #cusdis_thread .cusdis-reaction, |
| 323 | + #cusdis_thread [class*="reaction"], |
| 324 | + #cusdis_thread .cusdis-reaction-button { |
283 | 325 | display: inline-flex !important; |
284 | 326 | align-items: center !important; |
285 | 327 | gap: 0.25rem !important; |
286 | 328 | margin-right: 0.5rem !important; |
287 | 329 | margin-bottom: 0.5rem !important; |
288 | | - padding: 0.25rem 0.5rem !important; |
| 330 | + padding: 0.5rem 0.75rem !important; |
289 | 331 | background: var(--md-default-bg-color) !important; |
290 | | - border: 1px solid var(--md-default-fg-color--lightest) !important; |
291 | | - border-radius: 16px !important; |
| 332 | + border: 2px solid var(--md-default-fg-color--lightest) !important; |
| 333 | + border-radius: 20px !important; |
292 | 334 | cursor: pointer !important; |
293 | 335 | transition: all 0.2s ease !important; |
294 | | - font-size: 0.875em !important; |
| 336 | + font-size: 1em !important; |
295 | 337 | color: var(--md-default-fg-color) !important; |
| 338 | + min-height: 36px !important; |
| 339 | + min-width: 60px !important; |
| 340 | + justify-content: center !important; |
296 | 341 | } |
297 | 342 | |
298 | | - #cusdis_thread .cusdis-reaction:hover { |
| 343 | + #cusdis_thread .cusdis-reaction:hover, |
| 344 | + #cusdis_thread [class*="reaction"]:hover, |
| 345 | + #cusdis_thread .cusdis-reaction-button:hover { |
299 | 346 | background: var(--md-primary-fg-color) !important; |
300 | 347 | color: var(--md-primary-bg-color) !important; |
301 | 348 | border-color: var(--md-primary-fg-color) !important; |
302 | 349 | transform: translateY(-1px) !important; |
| 350 | + box-shadow: 0 2px 8px rgba(0,0,0,0.15) !important; |
303 | 351 | } |
304 | 352 | |
305 | | - #cusdis_thread .cusdis-reaction.active { |
| 353 | + #cusdis_thread .cusdis-reaction.active, |
| 354 | + #cusdis_thread [class*="reaction"].active, |
| 355 | + #cusdis_thread .cusdis-reaction-button.active { |
306 | 356 | background: var(--md-primary-fg-color) !important; |
307 | 357 | color: var(--md-primary-bg-color) !important; |
308 | 358 | border-color: var(--md-primary-fg-color) !important; |
309 | 359 | } |
310 | 360 | |
311 | | - #cusdis_thread .cusdis-reaction-count { |
| 361 | + #cusdis_thread .cusdis-reaction-count, |
| 362 | + #cusdis_thread [class*="reaction-count"] { |
312 | 363 | font-weight: 600 !important; |
313 | | - margin-left: 0.25rem !important; |
| 364 | + margin-left: 0.5rem !important; |
| 365 | + font-size: 0.9em !important; |
314 | 366 | } |
315 | 367 | |
316 | | - /* Ensure reaction container is visible */ |
317 | | - #cusdis_thread .cusdis-reactions { |
| 368 | + /* Ensure reaction container is visible - multiple selector variations */ |
| 369 | + #cusdis_thread .cusdis-reactions, |
| 370 | + #cusdis_thread [class*="reactions"], |
| 371 | + #cusdis_thread .reactions-container { |
318 | 372 | display: flex !important; |
319 | 373 | flex-wrap: wrap !important; |
320 | | - gap: 0.5rem !important; |
321 | | - margin-top: 0.75rem !important; |
322 | | - margin-bottom: 0.75rem !important; |
323 | | - padding: 0.5rem 0 !important; |
| 374 | + gap: 0.75rem !important; |
| 375 | + margin-top: 1rem !important; |
| 376 | + margin-bottom: 1rem !important; |
| 377 | + padding: 0.75rem 0 !important; |
| 378 | + border-top: 1px solid var(--md-default-fg-color--lightest) !important; |
| 379 | + padding-top: 1rem !important; |
324 | 380 | } |
325 | 381 | |
326 | 382 | /* Responsive design */ |
|
347 | 403 | } |
348 | 404 |
|
349 | 405 | function checkReactions() { |
350 | | - // Check if reactions are visible |
351 | | - const reactions = document.querySelectorAll('.cusdis-reaction'); |
| 406 | + // Check if reactions are visible with multiple selector variations |
| 407 | + const reactions = document.querySelectorAll('.cusdis-reaction, [class*="reaction"], .cusdis-reaction-button'); |
352 | 408 | if (reactions.length === 0) { |
353 | 409 | console.log('Cusdis: No reaction buttons found, checking configuration...'); |
354 | 410 |
|
355 | 411 | // Try to force reactions to show |
356 | 412 | const cusdisThread = document.getElementById('cusdis_thread'); |
357 | 413 | if (cusdisThread) { |
358 | 414 | cusdisThread.setAttribute('data-reaction', 'true'); |
| 415 | + cusdisThread.setAttribute('data-theme', 'auto'); |
359 | 416 | console.log('Cusdis: Reactions should be enabled'); |
| 417 | + |
| 418 | + // Check again after a short delay |
| 419 | + setTimeout(() => { |
| 420 | + const retryReactions = document.querySelectorAll('.cusdis-reaction, [class*="reaction"], .cusdis-reaction-button'); |
| 421 | + console.log(`Cusdis: Retry found ${retryReactions.length} reaction buttons`); |
| 422 | + }, 1000); |
360 | 423 | } |
361 | 424 | } else { |
362 | 425 | console.log(`Cusdis: Found ${reactions.length} reaction buttons`); |
363 | 426 | } |
| 427 | + |
| 428 | + // Also check for reaction containers |
| 429 | + const reactionContainers = document.querySelectorAll('.cusdis-reactions, [class*="reactions"], .reactions-container'); |
| 430 | + console.log(`Cusdis: Found ${reactionContainers.length} reaction containers`); |
364 | 431 | } |
365 | 432 | })(); |
0 commit comments