Skip to content

Commit ed2304d

Browse files
author
OpenClaw Sync
committed
Fix copy button: remove overflow:hidden clipping on highlight divs
1 parent 8c987c2 commit ed2304d

2 files changed

Lines changed: 4 additions & 2 deletions

File tree

assets/css/main.css

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -476,9 +476,10 @@ pre:hover .copy-btn {
476476

477477
/* Highlight wrapper from Rouge */
478478
.post-content div.highlight {
479+
position: relative;
479480
margin: 1.25rem 0;
480481
border-radius: var(--radius);
481-
overflow: hidden;
482+
overflow: visible;
482483
}
483484

484485
.post-content div.highlight pre {

assets/js/main.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
// Code block copy button
22
document.addEventListener('DOMContentLoaded', () => {
3-
document.querySelectorAll('.post-content .highlight, .post-content pre').forEach(el => {
3+
document.querySelectorAll('.post-content .highlight, .post-content > pre').forEach(el => {
44
// Avoid duplicates: if this pre is inside a .highlight we already processed, skip
55
if (el.tagName === 'PRE' && el.closest('.highlight')) return;
66

77
const container = el;
88
container.style.position = 'relative';
9+
container.style.overflow = 'visible';
910

1011
const btn = document.createElement('button');
1112
btn.className = 'copy-btn';

0 commit comments

Comments
 (0)