Skip to content

Commit 15457b2

Browse files
copy button overlap fix
1 parent 4f89945 commit 15457b2

File tree

2 files changed

+63
-2
lines changed

2 files changed

+63
-2
lines changed

assets/css/index.css

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1074,6 +1074,21 @@ a[href*="#no-click"], img[src*="#no-click"] {
10741074
background-color: #ddd;
10751075
}
10761076

1077+
/* Copy button wrapper positioning */
1078+
.copy-button-wrapper {
1079+
position: absolute;
1080+
top: 24px;
1081+
right: 10px;
1082+
z-index: 1;
1083+
display: flex;
1084+
align-items: center;
1085+
gap: 6px;
1086+
}
1087+
1088+
.copy-button-wrapper.expand-content-wrapper {
1089+
right: 20px;
1090+
}
1091+
10771092
/* AI Agent Builder Styles */
10781093

10791094
.agent-builder-container {
@@ -1225,6 +1240,51 @@ a[href*="#no-click"], img[src*="#no-click"] {
12251240
}
12261241
}
12271242

1243+
/* Fix copy button overlap on smaller screens */
1244+
@media (max-width: 768px) {
1245+
/* Ensure code blocks have enough padding on the right to accommodate copy button */
1246+
.highlight {
1247+
padding-right: 60px !important;
1248+
}
1249+
1250+
/* Adjust copy button wrapper positioning for smaller screens */
1251+
.copy-button-wrapper {
1252+
right: 8px !important;
1253+
top: 8px !important;
1254+
}
1255+
1256+
.copy-button-wrapper.expand-content-wrapper {
1257+
right: 12px !important;
1258+
}
1259+
1260+
/* Make copy buttons slightly smaller on mobile */
1261+
.copy-button-wrapper .clipboard-button,
1262+
.copy-button-wrapper .download-yaml-btn {
1263+
width: 28px !important;
1264+
height: 28px !important;
1265+
padding: 2px !important;
1266+
}
1267+
}
1268+
1269+
@media (max-width: 480px) {
1270+
/* Even more padding for very small screens */
1271+
.highlight {
1272+
padding-right: 70px !important;
1273+
}
1274+
1275+
/* Stack buttons vertically on very small screens if both copy and download are present */
1276+
.copy-button-wrapper {
1277+
flex-direction: column !important;
1278+
gap: 4px !important;
1279+
right: 4px !important;
1280+
top: 4px !important;
1281+
}
1282+
1283+
.copy-button-wrapper.expand-content-wrapper {
1284+
right: 8px !important;
1285+
}
1286+
}
1287+
12281288
/* Form Groups */
12291289
.form-group {
12301290
@apply space-y-2;

layouts/partials/scripts.html

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,12 @@
1010
}
1111
// Create a wrapper for the button and message
1212
const wrapper = document.createElement('div');
13+
wrapper.className = 'copy-button-wrapper';
1314

1415
if (block.parentElement.classList.contains("expand-content")) {
15-
wrapper.style = 'position:absolute;top:24px;right:20px;z-index:1;display:flex;align-items:center;gap:6px;';
16+
wrapper.classList.add('expand-content-wrapper');
1617
} else {
17-
wrapper.style = 'position:absolute;top:24px;right:10px;z-index:1;display:flex;align-items:center;gap:6px;';
18+
wrapper.classList.add('standard-wrapper');
1819
}
1920

2021
// Check if this is a YAML embed with download functionality

0 commit comments

Comments
 (0)